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.
This commit is contained in:
parent
f1733369fa
commit
7ff4d7ac9e
11
Makefile
11
Makefile
@ -4,6 +4,7 @@ PREFIX ?= /usr
|
|||||||
mandir ?= $(PREFIX)/share/man
|
mandir ?= $(PREFIX)/share/man
|
||||||
DOCKER ?= docker
|
DOCKER ?= docker
|
||||||
DOCS_VERSION ?= next
|
DOCS_VERSION ?= next
|
||||||
|
RUN_TESTS ?= ci
|
||||||
|
|
||||||
PKGNAME = lorax
|
PKGNAME = lorax
|
||||||
VERSION = $(shell awk '/Version:/ { print $$2 }' $(PKGNAME).spec)
|
VERSION = $(shell awk '/Version:/ { print $$2 }' $(PKGNAME).spec)
|
||||||
@ -73,6 +74,9 @@ test_openstack:
|
|||||||
test_vmware:
|
test_vmware:
|
||||||
sudo -E ./tests/test_cli.sh tests/cli/test_build_and_deploy_vmware.sh
|
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_cloud_envs:
|
||||||
# clean beakerlib logs from previous executions
|
# clean beakerlib logs from previous executions
|
||||||
sudo rm -rf /var/tmp/beakerlib-*/
|
sudo rm -rf /var/tmp/beakerlib-*/
|
||||||
@ -122,13 +126,16 @@ local:
|
|||||||
|
|
||||||
test-in-copy:
|
test-in-copy:
|
||||||
rsync -aP --exclude=.git /lorax-ro/ /lorax/
|
rsync -aP --exclude=.git /lorax-ro/ /lorax/
|
||||||
make -C /lorax/ ci
|
make -C /lorax/ $(RUN_TESTS)
|
||||||
cp /lorax/.coverage /test-results/
|
cp /lorax/.coverage /test-results/
|
||||||
|
|
||||||
test-in-docker:
|
test-in-docker:
|
||||||
sudo $(DOCKER) build -t welder/lorax-tests:$(IMAGE_RELEASE) -f Dockerfile.test .
|
sudo $(DOCKER) build -t welder/lorax-tests:$(IMAGE_RELEASE) -f Dockerfile.test .
|
||||||
@mkdir -p `pwd`/.test-results
|
@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:
|
docs-in-docker:
|
||||||
sudo $(DOCKER) run -it --rm -v `pwd`:/lorax-ro:ro \
|
sudo $(DOCKER) run -it --rm -v `pwd`:/lorax-ro:ro \
|
||||||
|
Loading…
Reference in New Issue
Block a user