I am writing
netscaler.adc ansible collection. This collection is used to configure NetScaler ADC (Application Delivery Controller).
ADC has different form factors, among others, VPX, CPX
VPX – virtual machine based
CPX – container based
I have written 3 integration tests –
ntpserver feature is not supported in
CPX form factor and hence integration test fails.
My integration test CI is on github-actions.
github-actions creates a ADC CPX container against which integration test will be run.
How to skip few of the integration tests?
One this I have explored is to
tag every task in every integration tests suite. This becomes cumbersome.
Do we have a not-allowed-list or something related OR grouping of the modules so that only CPX feature modules can be run?
There are two ways to do this:
- Wrap the integration test in a
block or conditional
include_tasks and first test whether the requirements for that test are present before executing it.
- Use CI groups: You can run assing to every integration test in its
aliases file an arbitrary group
this/is/a/group/name (I think zero slashes is also OK, though all group names I saw had at least one) and pass
this/is/a/group/name/ as a target name to
ansible-test integration this/is/a/group/name/. Then only tests from that group will be run.
See for example community.sops/tests/integration/targets/lookup_sops/aliases at main · ansible-collections/community.sops · GitHub, and see community.sops/.github/workflows/ansible-test.yml at main · ansible-collections/community.sops · GitHub for how this could be used with GHA. (If the groups are mostly identical, you can of course use the CI matrix feature from GHA itself, like here: community.docker/.github/workflows/ansible-test.yml at main · ansible-collections/community.docker · GitHub)
Thank you @felixfontein. You have become my ansible mentor
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.