-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (26 loc) · 1.83 KB
/
Copy pathMakefile
File metadata and controls
31 lines (26 loc) · 1.83 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
TEST_ARGS ?= ""
PYTHON_VERSION ?= `python -c 'import platform; print(".".join(platform.python_version_tuple()[0:2]))'`
unit-test:
ansible-test units --docker -v --color --python $(PYTHON_VERSION) $(?TEST_ARGS)
integration-test: write-integration-config
ansible-test integration --docker --diff --color --python $(PYTHON_VERSION) -v $(?TEST_ARGS)
# Running an integration test for the connection plugin is possible, but currently marked as
# unsupported in ansible-test and thus does not run in CI.
#
# To run the integration test locally, requirements are a running flightctl server as well as an
# onboarded and connected device. The ansible_flightctl_device_name in the test (test_connection.yml)
# must be manually set to the name of the device you want to test against.
integration-test-connection: write-integration-config
ansible-test integration connection_flightctl_console \
--docker --diff --color --python $(PYTHON_VERSION) --allow-unsupported -v
sanity-test:
ansible-test sanity --docker -v --color --python $(PYTHON_VERSION) $(?TEST_ARGS)
write-integration-config:
@token="$$(grep '^ access-token:' ~/.config/flightctl/client.yaml | awk '{print $$2}')"; \
service_addr="$$(awk '/^service:/,/^ server:/' ~/.config/flightctl/client.yaml | grep 'server:' | awk '{print $$2}')"; \
ib_addr="$$(awk '/^imageBuilderService:/,/^ server:/' ~/.config/flightctl/client.yaml | grep 'server:' | awk '{print $$2}')"; \
org="$$(awk '$$1=="organization:" {print $$2; exit}' ~/.config/flightctl/client.yaml)"; \
echo "flightctl_token: $$token" > ./tests/integration/integration_config.yml; \
echo "flightctl_host: $$service_addr" >> ./tests/integration/integration_config.yml; \
echo "flightctl_image_builder_host: $$ib_addr" >> ./tests/integration/integration_config.yml; \
echo "flightctl_organization: $$org" >> ./tests/integration/integration_config.yml;