Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests - Fixed many test issues (external PRs, code de-sync) by getting rid of git clone #315

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions test/api-integration-test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ ENV PATH $PATH:/usr/local/gcloud/google-cloud-sdk/bin
RUN go get -u github.com/jstemmer/go-junit-report
RUN go build github.com/jstemmer/go-junit-report

COPY ./run_test.sh /run_test.sh
RUN chmod +x /run_test.sh
COPY . /go/src/github.com/kubeflow/pipelines

ENTRYPOINT ["/run_test.sh"]
ENTRYPOINT ["/go/src/github.com/kubeflow/pipelines/test/api-integration-test/run_test.sh"]
12 changes: 1 addition & 11 deletions test/api-integration-test/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ usage()
{
echo "usage: run_test.sh
--results-gcs-dir GCS directory for the test results. Usually gs://<project-id>/<commit-sha>/api_integration_test
[--commit_sha commit SHA to pull code from]
[--namespace k8s namespace where ml-pipelines is deployed. The tests run against the instance in this namespace]
[-h help]"
}
Expand All @@ -33,9 +32,6 @@ while [ "$1" != "" ]; do
--results-gcs-dir )shift
RESULTS_GCS_DIR=$1
;;
--commit_sha ) shift
COMMIT_SHA=$1
;;
--namespace ) shift
NAMESPACE=$1
;;
Expand All @@ -58,13 +54,7 @@ BASE_DIR=/go/src/github.com/${GITHUB_REPO}
JUNIT_TEST_RESULT=junit_ApiIntegrationTestOutput.xml
TEST_DIR=backend/test

echo "Clone ML pipeline code in COMMIT SHA ${COMMIT_SHA}..."
git clone https://github.com/${GITHUB_REPO} ${BASE_DIR}
cd ${BASE_DIR}
git config --local user.name 'K8S Bootstrap'
git config --local user.email k8s_bootstrap@localhost
git merge --no-ff ${COMMIT_SHA} -m "Merged PR ${COMMIT_SHA}"
cd ${TEST_DIR}
cd "${BASE_DIR}/${TEST_DIR}"

echo "Run integration test..."
TEST_RESULT=`go test -v ./... -namespace ${NAMESPACE} 2>&1`
Expand Down
5 changes: 2 additions & 3 deletions test/backend-unit-test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ ENV PATH $PATH:/usr/local/gcloud/google-cloud-sdk/bin
RUN go get -u github.com/jstemmer/go-junit-report
RUN go build github.com/jstemmer/go-junit-report

COPY ./run_test.sh /run_test.sh
RUN chmod +x /run_test.sh
COPY . /go/src/github.com/kubeflow/pipelines

ENTRYPOINT ["/run_test.sh"]
ENTRYPOINT ["/go/src/github.com/kubeflow/pipelines/test/backend-unit-test/run_test.sh"]
39 changes: 0 additions & 39 deletions test/backend-unit-test/Makefile

This file was deleted.

12 changes: 1 addition & 11 deletions test/backend-unit-test/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ usage()
{
echo "usage: run_test.sh
--results-gcs-dir GCS directory for the test results. Usually gs://<project-id>/<commit-sha>/api_integration_test
[--commit_sha commit SHA to pull code from]
[-h help]"
}

Expand All @@ -29,9 +28,6 @@ while [ "$1" != "" ]; do
--results-gcs-dir )shift
RESULTS_GCS_DIR=$1
;;
--commit_sha ) shift
COMMIT_SHA=$1
;;
-h | --help ) usage
exit
;;
Expand All @@ -51,13 +47,7 @@ BASE_DIR=/go/src/github.com/${GITHUB_REPO}
JUNIT_TEST_RESULT=junit_BackendUnitTestOutput.xml
TEST_DIR=backend/src

echo "Clone ML pipeline code in COMMIT SHA ${COMMIT_SHA}..."
git clone https://github.com/${GITHUB_REPO} ${BASE_DIR}
cd ${BASE_DIR}
git config --local user.name 'K8S Bootstrap'
git config --local user.email k8s_bootstrap@localhost
git merge --no-ff ${COMMIT_SHA} -m "Merged PR ${COMMIT_SHA}"
cd ${TEST_DIR}
cd "${BASE_DIR}/${TEST_DIR}"

# Run test and store the exit code.
echo "Run unit test..."
Expand Down
37 changes: 20 additions & 17 deletions test/build_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ spec:
entrypoint: build-images
arguments:
parameters:
- name: commit-sha
value: master
- name: image-build-context-gcs-uri
- name: bootstrapper-image
- name: api-image
- name: frontend-image
Expand All @@ -31,7 +30,6 @@ spec:
- name: build-images
inputs:
parameters:
- name: commit-sha
- name: bootstrapper-image
- name: api-image
- name: frontend-image
Expand All @@ -42,8 +40,8 @@ spec:
template: build-image
arguments:
parameters:
- name: commit-sha
value: "{{inputs.parameters.commit-sha}}"
- name: image-build-context-gcs-uri
value: "{{workflow.parameters.image-build-context-gcs-uri}}"
- name: docker-path
value: pipeline
- name: image-name
Expand All @@ -52,8 +50,8 @@ spec:
template: build-image
arguments:
parameters:
- name: commit-sha
value: "{{inputs.parameters.commit-sha}}"
- name: image-build-context-gcs-uri
value: "{{workflow.parameters.image-build-context-gcs-uri}}"
- name: docker-path
value: .
- name: image-name
Expand All @@ -64,8 +62,8 @@ spec:
template: build-image
arguments:
parameters:
- name: commit-sha
value: "{{inputs.parameters.commit-sha}}"
- name: image-build-context-gcs-uri
value: "{{workflow.parameters.image-build-context-gcs-uri}}"
- name: docker-path
value: .
- name: docker-file
Expand All @@ -76,8 +74,8 @@ spec:
template: build-image
arguments:
parameters:
- name: commit-sha
value: "{{inputs.parameters.commit-sha}}"
- name: image-build-context-gcs-uri
value: "{{workflow.parameters.image-build-context-gcs-uri}}"
- name: docker-path
value: .
- name: image-name
Expand All @@ -88,8 +86,8 @@ spec:
template: build-image
arguments:
parameters:
- name: commit-sha
value: "{{inputs.parameters.commit-sha}}"
- name: image-build-context-gcs-uri
value: "{{workflow.parameters.image-build-context-gcs-uri}}"
- name: docker-path
value: .
- name: image-name
Expand All @@ -101,19 +99,24 @@ spec:
- name: build-image
inputs:
parameters:
# The github commit-sha to pull code from
- name: commit-sha
# GCS URI prefix pointing to a .tar.gz archive of Docker build context
- name: image-build-context-gcs-uri
# The relative code path to the Dockerfile
- name: docker-path
# Name of the Docker file to use. "Dockerfile" by default
- name: docker-file
value: Dockerfile
- name: image-name
outputs:
parameters:
- name: strict-image-name
valueFrom:
path: /outputs/strict-image-name/file
container:
image: gcr.io/ml-pipeline-staging/image-builder:v20181108-0.1.1-39-g2274e35-e3b0c4
image: gcr.io/ml-pipeline-staging/image-builder:v20181120-0.1.3-rc.1-21-gb7c8af0-dirty-9786df
imagePullPolicy: 'Always'
args: [
"--commit_sha", "{{inputs.parameters.commit-sha}}",
"--image-build-context-gcs-uri", "{{inputs.parameters.image-build-context-gcs-uri}}",
"--docker_path", "{{inputs.parameters.docker-path}}",
"--docker_file", "{{inputs.parameters.docker-file}}",
"--image_name", "{{inputs.parameters.image-name}}",
Expand Down
Loading