diff --git a/.travis.yml b/.travis.yml index ecc738cc0c5..69f81a7e558 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,3 +43,9 @@ script: # SDK Components tests - cd $TRAVIS_BUILD_DIR/sdk/python - python3 -m unittest discover --verbose --start-dir tests --top-level-directory=.. + + # Backend unit tests + - cd $TRAVIS_BUILD_DIR/backend/src + - gimme -f 1.11.4 + - source ~/.gimme/envs/go1.11.4.env + - go test ./... diff --git a/test/backend-unit-test/Dockerfile b/test/backend-unit-test/Dockerfile deleted file mode 100644 index ff7824eee36..00000000000 --- a/test/backend-unit-test/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# This image has the script to kick off the ML pipeline backend unit test, -# and upload the result to GCS - -FROM golang:1.11 - -RUN curl https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz > /tmp/google-cloud-sdk.tar.gz -RUN mkdir -p /usr/local/gcloud -RUN tar -C /usr/local/gcloud -xf /tmp/google-cloud-sdk.tar.gz -RUN /usr/local/gcloud/google-cloud-sdk/install.sh -ENV PATH $PATH:/usr/local/gcloud/google-cloud-sdk/bin - -# install go-junit-report. It converts go test result to junit xml. -RUN go get -u github.com/jstemmer/go-junit-report -RUN go build github.com/jstemmer/go-junit-report - -COPY . /go/src/github.com/kubeflow/pipelines - -ENTRYPOINT ["/go/src/github.com/kubeflow/pipelines/test/backend-unit-test/run_test.sh"] diff --git a/test/backend-unit-test/OWNERS b/test/backend-unit-test/OWNERS deleted file mode 100644 index 23d368bc30f..00000000000 --- a/test/backend-unit-test/OWNERS +++ /dev/null @@ -1,6 +0,0 @@ -approvers: - - vicaire - - IronPan -reviewers: - - vicaire - - IronPan \ No newline at end of file diff --git a/test/backend-unit-test/run_test.sh b/test/backend-unit-test/run_test.sh deleted file mode 100755 index f68066b412f..00000000000 --- a/test/backend-unit-test/run_test.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash - -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -xe - -usage() -{ - echo "usage: run_test.sh - --results-gcs-dir GCS directory for the test results. Usually gs:////api_integration_test - [-h help]" -} - -while [ "$1" != "" ]; do - case $1 in - --results-gcs-dir )shift - RESULTS_GCS_DIR=$1 - ;; - -h | --help ) usage - exit - ;; - * ) usage - exit 1 - esac - shift -done - -if [ -z "$RESULTS_GCS_DIR" ]; then - usage - exit 1 -fi - -GITHUB_REPO=kubeflow/pipelines -BASE_DIR=/go/src/github.com/${GITHUB_REPO} -JUNIT_TEST_RESULT=junit_BackendUnitTestOutput.xml -TEST_DIR=backend/src - -cd "${BASE_DIR}/${TEST_DIR}" - -# turn on go module -export GO111MODULE=on - -# Run test and store the exit code. -echo "Run unit test..." -TEST_RESULT=`go test -v ./... 2>&1` -TEST_EXIT_CODE=$? - -# Log the test result -printf '%s\n' "$TEST_RESULT" -# Convert test result to junit.xml -printf '%s\n' "$TEST_RESULT" | go-junit-report > ${JUNIT_TEST_RESULT} - -echo "Copy test result to GCS ${RESULTS_GCS_DIR}/${JUNIT_TEST_RESULT}" -gsutil cp ${JUNIT_TEST_RESULT} ${RESULTS_GCS_DIR}/${JUNIT_TEST_RESULT} - -exit $TEST_EXIT_CODE diff --git a/test/unit_test_gke.yaml b/test/unit_test_gke.yaml deleted file mode 100644 index eb4e4be01a6..00000000000 --- a/test/unit_test_gke.yaml +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: argoproj.io/v1alpha1 -kind: Workflow -metadata: - generateName: unit-test- -spec: - entrypoint: unit-test - arguments: - parameters: - - name: image-build-context-gcs-uri - - name: target-image-prefix - - name: test-results-gcs-dir - - name: backend-unit-test-image-suffix - value: backend-unit-test - templates: - - name: unit-test - inputs: - parameters: - - name: target-image-prefix - - name: test-results-gcs-dir - - name: backend-unit-test-image-suffix - value: backend-unit-test - steps: - - - name: build-backend-unit-tests-image - template: build-image - arguments: - parameters: - - name: docker-path - value: . - - name: docker-file - value: test/backend-unit-test/Dockerfile - - name: image-name - value: "{{inputs.parameters.target-image-prefix}}{{inputs.parameters.backend-unit-test-image-suffix}}" - - - name: run-backend-unit-tests - template: run-backend-unit-tests - arguments: - parameters: - - name: test-results-gcs-dir - value: "{{inputs.parameters.test-results-gcs-dir}}" - - name: backend-unit-test-image - value: "{{inputs.parameters.target-image-prefix}}{{inputs.parameters.backend-unit-test-image-suffix}}" - - - name: run-backend-unit-tests - inputs: - parameters: - - name: test-results-gcs-dir - - name: backend-unit-test-image - container: - image: "{{inputs.parameters.backend-unit-test-image}}" - imagePullPolicy: 'Always' - args: [ - "--results-gcs-dir", "{{inputs.parameters.test-results-gcs-dir}}", - ] - - # Build and push image - - name: build-image - inputs: - parameters: - # GCS URI prefix pointing to a .tar.gz archive of Docker build context - - name: image-build-context-gcs-uri - value: "{{workflow.parameters.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-test/image-builder:v20181128-0.1.3-rc.1-109-ga5a14dc-e3b0c4 - imagePullPolicy: 'Always' - args: [ - "--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}}", - ] - env: - - name: DOCKER_HOST - value: 127.0.0.1 - sidecars: - - name: dind - image: docker:17.10-dind - securityContext: - privileged: true - mirrorVolumeMounts: true