# Group ansible-test integration tests

**URL:** <https://forum.ansible.com/t/group-ansible-test-integration-tests/3263>\
**Category:** Get Help\
**Tags:** netscaler, ansible-test, collections\
**Created:** [January 11, 2024, 9:41am UTC](https://forum.ansible.com/t/group-ansible-test-integration-tests/3263 "2024-01-11T09:41:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sumanth-lingappa](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sumanth-lingappa/32/839_2.png) [@sumanth-lingappa](https://forum.ansible.com/u/sumanth-lingappa)\
**Post date:** [January 11, 2024, 9:41am UTC](https://forum.ansible.com/t/group-ansible-test-integration-tests/3263/1 "2024-01-11T09:41:46Z")

</div>

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 – `nsip`, `ipset`, `ntpserver`

`ntpserver` feature is not supported in `CPX` form factor and hence integration test fails.  
My [integration test CI is on github-actions](https://github.com/netscaler/ansible-collection-netscaleradc/blob/714dcb9aa22b39282c52e6fbd861a4862ee97346/.github/workflows/test.yml#L97).

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?

Sumanth

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [January 11, 2024, 11:57am UTC](https://forum.ansible.com/t/group-ansible-test-integration-tests/3263/2 "2024-01-11T11:57:44Z")

</div>

There are two ways to do this:

1. 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.
2. 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`: `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](https://github.com/ansible-collections/community.sops/blob/main/tests/integration/targets/lookup_sops/aliases#L5), and see [community.sops/.github/workflows/ansible-test.yml at main · ansible-collections/community.sops · GitHub](https://github.com/ansible-collections/community.sops/blob/main/.github/workflows/ansible-test.yml#L154) 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](https://github.com/ansible-collections/community.docker/blob/main/.github/workflows/ansible-test.yml#L242.))

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [January 11, 2024, 12:00pm UTC](https://forum.ansible.com/t/group-ansible-test-integration-tests/3263/3 "2024-01-11T12:00:24Z")

</div>

For 1., see [community.docker/tests/integration/targets/docker\_compose\_v2/tasks/main.yml at main · ansible-collections/community.docker · GitHub](https://github.com/ansible-collections/community.docker/blob/main/tests/integration/targets/docker_compose_v2/tasks/main.yml#L48) and [community.docker/tests/integration/targets/setup\_docker\_cli\_compose/tasks/main.yml at main · ansible-collections/community.docker · GitHub](https://github.com/ansible-collections/community.docker/blob/main/tests/integration/targets/setup_docker_cli_compose/tasks/main.yml#L59) as an example. You can also use an `end_play` meta task ([ansible.builtin.meta module – Execute Ansible ‘actions’ — Ansible Documentation](https://docs.ansible.com/ansible/devel/collections/ansible/builtin/meta_module.html#parameter-free_form)) if you notice that some requirements are not met.

---

<div class="post-metadata">

**Author:** ![sumanth-lingappa](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sumanth-lingappa/32/839_2.png) [@sumanth-lingappa](https://forum.ansible.com/u/sumanth-lingappa)\
**Post date:** [January 11, 2024, 3:33pm UTC](https://forum.ansible.com/t/group-ansible-test-integration-tests/3263/4 "2024-01-11T15:33:44Z")

</div>

Thank you @felixfontein. You have become my ansible mentor 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [February 10, 2024, 3:33pm UTC](https://forum.ansible.com/t/group-ansible-test-integration-tests/3263/5 "2024-02-10T15:33:46Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
