From 298a2073e0f72522d98b54943f0754acf0d37cf5 Mon Sep 17 00:00:00 2001 From: Artyom Lukianov Date: Thu, 28 Feb 2019 17:56:22 +0200 Subject: [PATCH] Bring cirros images to the sandbox where the test runs --- .travis.yml | 2 +- Makefile | 5 ++++- pkg/virtctl/imageupload/BUILD.bazel | 1 + pkg/virtctl/imageupload/imageupload_test.go | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index c02d51468051..b08cf92705ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ script: - make build - if [[ -n "$(git status --porcelain)" ]] ; then echo "It seems like you need to run `make`. Please run it and commit the changes"; git status --porcelain; false; fi -- if [[ $TRAVIS_REPO_SLUG == "kubevirt/kubevirt" ]]; then make goveralls; else make test; fi +- if [[ $TRAVIS_REPO_SLUG == "kubevirt/kubevirt" ]]; then make goveralls; else make bazel-tests; fi - make apidocs - make client-python - make manifests DOCKER_PREFIX="docker.io/kubevirt" DOCKER_TAG=$TRAVIS_TAG # falls back to latest if not on a tag diff --git a/Makefile b/Makefile index 2c595e890dca..bd68dc891880 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,9 @@ bazel-push-images: --define container_tag=${CONTAINER_TAG} \ //:push-images" +bazel-tests: + hack/dockerized "bazel test --test_output=errors -- //pkg/... " + generate: bazel-generate hack/dockerized "DOCKER_PREFIX=${DOCKER_PREFIX} DOCKER_TAG=${DOCKER_TAG} IMAGE_PULL_POLICY=${IMAGE_PULL_POLICY} VERBOSITY=${VERBOSITY} ./hack/generate.sh" @@ -115,8 +118,8 @@ builder-publish: .PHONY: \ bazel-generate \ bazel-build \ - bazel-build-images \ bazel-push-images \ + bazel-tests \ build \ test \ clean \ diff --git a/pkg/virtctl/imageupload/BUILD.bazel b/pkg/virtctl/imageupload/BUILD.bazel index af843b4a0d9d..7546e9b1fd0a 100644 --- a/pkg/virtctl/imageupload/BUILD.bazel +++ b/pkg/virtctl/imageupload/BUILD.bazel @@ -28,6 +28,7 @@ go_test( "imageupload_suite_test.go", "imageupload_test.go", ], + data = ["@cirros_image//file"], embed = [":go_default_library"], deps = [ "//pkg/kubecli:go_default_library", diff --git a/pkg/virtctl/imageupload/imageupload_test.go b/pkg/virtctl/imageupload/imageupload_test.go index 1e82ec44d14a..1867e377f3c2 100644 --- a/pkg/virtctl/imageupload/imageupload_test.go +++ b/pkg/virtctl/imageupload/imageupload_test.go @@ -36,7 +36,7 @@ var _ = Describe("ImageUpload", func() { pvcNamespace = "default" pvcName = "test-pvc" pvcSize = "500Mi" - imagePath = "../../../vendor/kubevirt.io/containerized-data-importer/tests/images/cirros-qcow2.img" + imagePath = "../../../external/cirros_image/file/downloaded" ) var (