From 212546f92ba0d6e048f5cbc5cd16433695be70ee Mon Sep 17 00:00:00 2001 From: Dirk Julich Date: Fri, 6 Mar 2026 14:19:24 +0100 Subject: [PATCH] fix: narrow vendor_collections_dir fixture teardown scope (#16326) Only remove the collection directory the fixture created (redhat/indirect_accounting) instead of the entire /var/lib/awx/vendor_collections/ root, so we don't accidentally delete vendor collections that may have been installed by the build process. Forward-port of ansible/tower#7350. Co-authored-by: Claude Opus 4.6 --- .../live/tests/test_indirect_counting_external_queries.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awx/main/tests/live/tests/test_indirect_counting_external_queries.py b/awx/main/tests/live/tests/test_indirect_counting_external_queries.py index 29e6cc7f3d..6dd445cab2 100644 --- a/awx/main/tests/live/tests/test_indirect_counting_external_queries.py +++ b/awx/main/tests/live/tests/test_indirect_counting_external_queries.py @@ -111,8 +111,8 @@ def vendor_collections_dir(): yield base - # Cleanup - shutil.rmtree(VENDOR_COLLECTIONS_BASE, ignore_errors=True) + # Cleanup: only remove the collection we created, not the entire vendor root + shutil.rmtree(base, ignore_errors=True) @pytest.fixture(autouse=True)