From 7ff4d7ac9edc662aba587767056ebba004bfd93d Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Mon, 24 Jun 2019 11:19:12 -0700 Subject: [PATCH] tests: Add RUN_TESTS to Makefile so you can pass in targets Also add a test_cli target to run things like the blueprint cli tests. Run this like so: RUN_TESTS="ci test_cli" make test-in-docker If nothing is passed it will run the "ci" target. --- Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ef358553..e68b19f2 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ PREFIX ?= /usr mandir ?= $(PREFIX)/share/man DOCKER ?= docker DOCS_VERSION ?= next +RUN_TESTS ?= ci PKGNAME = lorax VERSION = $(shell awk '/Version:/ { print $$2 }' $(PKGNAME).spec) @@ -73,6 +74,9 @@ test_openstack: test_vmware: sudo -E ./tests/test_cli.sh tests/cli/test_build_and_deploy_vmware.sh +test_cli: + sudo -E ./tests/test_cli.sh + clean_cloud_envs: # clean beakerlib logs from previous executions sudo rm -rf /var/tmp/beakerlib-*/ @@ -122,13 +126,16 @@ local: test-in-copy: rsync -aP --exclude=.git /lorax-ro/ /lorax/ - make -C /lorax/ ci + make -C /lorax/ $(RUN_TESTS) cp /lorax/.coverage /test-results/ test-in-docker: sudo $(DOCKER) build -t welder/lorax-tests:$(IMAGE_RELEASE) -f Dockerfile.test . @mkdir -p `pwd`/.test-results - sudo $(DOCKER) run --rm -it -v `pwd`/.test-results/:/test-results -v `pwd`:/lorax-ro:ro --security-opt label=disable welder/lorax-tests:$(IMAGE_RELEASE) make test-in-copy + sudo $(DOCKER) run --rm -it -v `pwd`/.test-results/:/test-results \ + -v `pwd`:/lorax-ro:ro --security-opt label=disable \ + --env RUN_TESTS="$(RUN_TESTS)" \ + welder/lorax-tests:$(IMAGE_RELEASE) make test-in-copy docs-in-docker: sudo $(DOCKER) run -it --rm -v `pwd`:/lorax-ro:ro \