-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (32 loc) · 1.14 KB
/
Copy pathMakefile
File metadata and controls
38 lines (32 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
TEST_IMAGE := $(or $(TEST_IMAGE),ghcr.io/metal-stack/metal-deployment-base:metal-stack-release-vector)
ifeq ($(CI),true)
DOCKER_RUN_ARG=
else
DOCKER_RUN_ARG=t
endif
.PHONY: test
test: pull test-units test-integration
.PHONY: pull
pull:
docker pull $(TEST_IMAGE)
.PHONY: test-units
test-units:
docker run --rm -i$(DOCKER_RUN_ARG) -v $(PWD):/work -w /work $(TEST_IMAGE) make test-local
.PHONY: test-integration
test-integration:
docker stop ansible-common-test-registry || true
docker run --rm -d -p 5000:5000 --name ansible-common-test-registry registry:3
cd test/integration && ./fill-test-registry.sh
docker run --rm -i$(DOCKER_RUN_ARG) -v $(PWD):/work -w /work --network host \
-e ANSIBLE_LIBRARY=library \
-e ANSIBLE_ACTION_PLUGINS=action_plugins \
-e ANSIBLE_COLLECTIONS_PATH="" \
-e ANSIBLE_COLLECTIONS_SCAN_SYS_PATH=false \
-e ANSIBLE_INVENTORY=test/integration/inventory.yaml \
$(TEST_IMAGE) bash -c \
'ansible -m metal_stack_release_vector localhost -vvv && ansible-playbook test/integration/playbook.yaml -vvv'
docker stop ansible-common-test-registry
.PHONY: test-local
test-local:
python3 -m pip install mock
./test.sh