[stable-3] Backport CI improvements (#1055)

* Fix/improve tests (#1052)

* Improve unit test condition.

* Improve/fix tests.

(cherry picked from commit fdb97428a3)

* Make sure that community.internal_test_tools is installed for unit tests.

(cherry picked from commit 9972eee967)
This commit is contained in:
Felix Fontein 2025-03-12 21:30:15 +01:00 committed by GitHub
parent 8fb1a7e4ff
commit 30db88c26a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -88,6 +88,8 @@ jobs:
testing-type: units
pre-test-cmd: >-
git clone --depth=1 --single-branch --branch stable-1 https://github.com/ansible-collections/community.library_inventory_filtering.git ../../community/library_inventory_filtering_v1
;
git clone --depth=1 --single-branch --branch main https://github.com/ansible-collections/community.internal_test_tools.git ../../community/internal_test_tools
integration:
# Ansible-test on various stable branches does not yet work well with cgroups v2.

View File

@ -77,7 +77,7 @@ retry git clone --depth=1 --single-branch --branch stable-1 https://github.com/a
# NOTE: we're installing with git to work around Galaxy being a huge PITA (https://github.com/ansible/galaxy/issues/2429)
# retry ansible-galaxy -vvv collection install community.library_inventory_filtering_v1
if [ "${test}" == "sanity/extra" ]; then
if [ "${test}" == "sanity/extra" ] || [ "${test}" == "units/1" ]; then
# Nothing further should be added to this list.
# This is to prevent modules or plugins in this collection having a runtime dependency on other collections.
retry git clone --depth=1 --single-branch https://github.com/ansible-collections/community.internal_test_tools.git "${ANSIBLE_COLLECTIONS_PATHS}/ansible_collections/community/internal_test_tools"
@ -85,7 +85,7 @@ if [ "${test}" == "sanity/extra" ]; then
# retry ansible-galaxy -vvv collection install community.internal_test_tools
fi
if [ "${script}" != "sanity" ] && [ "${script}" != "units" ] && [ "${test}" != "sanity/extra" ]; then
if [ "${script}" != "sanity/1" ] && [ "${script}" != "units/1" ] && [ "${test}" != "sanity/extra" ]; then
# To prevent Python dependencies on other collections only install other collections for integration tests
retry git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.posix.git "${ANSIBLE_COLLECTIONS_PATHS}/ansible_collections/ansible/posix"
retry git clone --depth=1 --single-branch https://github.com/ansible-collections/community.crypto.git "${ANSIBLE_COLLECTIONS_PATHS}/ansible_collections/community/crypto"