Skip to content

Commit 5ea2fe6

Browse files
authored
Fix failing Collection CI Checks (#16157)
* Fix CI: Use Python 3.13 for ansible-test compatibility ansible-test only supports Python 3.11, 3.12, and 3.13. Changed collection-integration jobs from '3.x' to '3.13' to avoid using Python 3.14 which is not supported. * Fix ansible-test Python version for CI integration tests ansible-test only supports Python 3.11, 3.12, and 3.13. Added ANSIBLE_TEST_PYTHON_VERSION variable to explicitly pass --python 3.13 flag to ansible-test integration command. This prevents ansible-test from auto-detecting and using Python 3.14.0, which is not supported. * Fix CI: Execute ansible-test with Python 3.13 to avoid unsupported Python 3.14 * Fix CI: Use Python 3.13 across all jobs to avoid Python 3.14 compatibility issues * Fix CI: Use 'python' and 'ansible.test' module for Python 3.13 compatibility * Fix CI: Use 'python' instead of 'python3' for Python 3.13 compatibility * Fix CI: Ensure ansible-test uses Python 3.13 environment explicitly * Fix: Remove silent failure check for ansible-core in test suite * Fix CI: Export PYTHONPATH to make awxkit available to ansible-test * Fix CI: Use 'python' in run_awx_devel to maintain Python 3.13 environment * Fix CI: Remove setup-python from awx_devel_image that was resetting Python 3.13 to 3.14
1 parent f3f10ae commit 5ea2fe6

File tree

4 files changed

+29
-18
lines changed

4 files changed

+29
-18
lines changed

.github/actions/awx_devel_image/action.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ inputs:
1111
runs:
1212
using: composite
1313
steps:
14-
- uses: ./.github/actions/setup-python
15-
1614
- name: Set lower case owner name
1715
shell: bash
1816
run: echo "OWNER_LC=${OWNER,,}" >> $GITHUB_ENV

.github/actions/run_awx_devel/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ runs:
3636

3737
- name: Upgrade ansible-core
3838
shell: bash
39-
run: python3 -m pip install --upgrade ansible-core
39+
run: python -m pip install --upgrade ansible-core
4040

4141
- name: Install system deps
4242
shell: bash

.github/workflows/ci.yml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ jobs:
145145

146146
- uses: ./.github/actions/setup-python
147147
with:
148-
python-version: '3.x'
148+
python-version: '3.13'
149149

150150
- uses: ./.github/actions/run_awx_devel
151151
id: awx
@@ -188,11 +188,11 @@ jobs:
188188
- name: Setup python, referencing action at awx relative path
189189
uses: ./awx/.github/actions/setup-python
190190
with:
191-
python-version: '3.x'
191+
python-version: '3.13'
192192

193193
- name: Install playbook dependencies
194194
run: |
195-
python3 -m pip install docker
195+
python -m pip install docker
196196
197197
- name: Build AWX image
198198
working-directory: awx
@@ -206,8 +206,8 @@ jobs:
206206
- name: Run test deployment with awx-operator
207207
working-directory: awx-operator
208208
run: |
209-
python3 -m pip install -r molecule/requirements.txt
210-
python3 -m pip install PyYAML # for awx/tools/scripts/rewrite-awx-operator-requirements.py
209+
python -m pip install -r molecule/requirements.txt
210+
python -m pip install PyYAML # for awx/tools/scripts/rewrite-awx-operator-requirements.py
211211
$(realpath ../awx/tools/scripts/rewrite-awx-operator-requirements.py) molecule/requirements.yml $(realpath ../awx)
212212
ansible-galaxy collection install -r molecule/requirements.yml
213213
sudo rm -f $(which kustomize)
@@ -294,7 +294,11 @@ jobs:
294294

295295
- uses: ./.github/actions/setup-python
296296
with:
297-
python-version: '3.x'
297+
python-version: '3.13'
298+
299+
- name: Remove system ansible to avoid conflicts
300+
run: |
301+
python -m pip uninstall -y ansible ansible-core || true
298302
299303
- uses: ./.github/actions/run_awx_devel
300304
id: awx
@@ -305,8 +309,9 @@ jobs:
305309

306310
- name: Install dependencies for running tests
307311
run: |
308-
python3 -m pip install -e ./awxkit/
309-
python3 -m pip install -r awx_collection/requirements.txt
312+
python -m pip install -e ./awxkit/
313+
python -m pip install -r awx_collection/requirements.txt
314+
hash -r # Rehash to pick up newly installed scripts
310315
311316
- name: Run integration tests
312317
id: make-run
@@ -318,6 +323,7 @@ jobs:
318323
echo 'password = password' >> ~/.tower_cli.cfg
319324
echo 'verify_ssl = false' >> ~/.tower_cli.cfg
320325
TARGETS="$(ls awx_collection/tests/integration/targets | grep '${{ matrix.target-regex.regex }}' | tr '\n' ' ')"
326+
export PYTHONPATH="$(python -c 'import site; print(":".join(site.getsitepackages()))')${PYTHONPATH:+:$PYTHONPATH}"
321327
make COLLECTION_VERSION=100.100.100-git COLLECTION_TEST_TARGET="--requirements $TARGETS" test_collection_integration
322328
env:
323329
ANSIBLE_TEST_PREFER_PODMAN: 1
@@ -372,10 +378,14 @@ jobs:
372378

373379
- uses: ./.github/actions/setup-python
374380
with:
375-
python-version: '3.x'
381+
python-version: '3.13'
382+
383+
- name: Remove system ansible to avoid conflicts
384+
run: |
385+
python -m pip uninstall -y ansible ansible-core || true
376386
377387
- name: Upgrade ansible-core
378-
run: python3 -m pip install --upgrade ansible-core
388+
run: python -m pip install --upgrade ansible-core
379389

380390
- name: Download coverage artifacts
381391
uses: actions/download-artifact@v4
@@ -390,11 +400,12 @@ jobs:
390400
mkdir -p ~/.ansible/collections/ansible_collections/awx/awx/tests/output/coverage
391401
cp -rv coverage/* ~/.ansible/collections/ansible_collections/awx/awx/tests/output/coverage/
392402
cd ~/.ansible/collections/ansible_collections/awx/awx
393-
ansible-test coverage combine --requirements
394-
ansible-test coverage html
403+
hash -r # Rehash to pick up newly installed scripts
404+
PATH="$(python -c 'import sys; import os; print(os.path.dirname(sys.executable))'):$PATH" ansible-test coverage combine --requirements
405+
PATH="$(python -c 'import sys; import os; print(os.path.dirname(sys.executable))'):$PATH" ansible-test coverage html
395406
echo '## AWX Collection Integration Coverage' >> $GITHUB_STEP_SUMMARY
396407
echo '```' >> $GITHUB_STEP_SUMMARY
397-
ansible-test coverage report >> $GITHUB_STEP_SUMMARY
408+
PATH="$(python -c 'import sys; import os; print(os.path.dirname(sys.executable))'):$PATH" ansible-test coverage report >> $GITHUB_STEP_SUMMARY
398409
echo '```' >> $GITHUB_STEP_SUMMARY
399410
echo >> $GITHUB_STEP_SUMMARY
400411
echo '## AWX Collection Integration Coverage HTML' >> $GITHUB_STEP_SUMMARY

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ TEST_DIRS ?= awx/main/tests/unit awx/main/tests/functional awx/conf/tests
2727
PARALLEL_TESTS ?= -n auto
2828
# collection integration test directories (defaults to all)
2929
COLLECTION_TEST_TARGET ?=
30+
# Python version for ansible-test (must be 3.11, 3.12, or 3.13)
31+
ANSIBLE_TEST_PYTHON_VERSION ?= 3.13
3032
# args for collection install
3133
COLLECTION_PACKAGE ?= awx
3234
COLLECTION_NAMESPACE ?= awx
@@ -431,8 +433,8 @@ test_collection_sanity:
431433

432434
test_collection_integration: install_collection
433435
cd $(COLLECTION_INSTALL) && \
434-
ansible-test integration --coverage -vvv $(COLLECTION_TEST_TARGET) && \
435-
ansible-test coverage xml --requirements --group-by command --group-by version
436+
PATH="$$($(PYTHON) -c 'import sys; import os; print(os.path.dirname(sys.executable))'):$$PATH" ansible-test integration --python $(ANSIBLE_TEST_PYTHON_VERSION) --coverage -vvv $(COLLECTION_TEST_TARGET) && \
437+
PATH="$$($(PYTHON) -c 'import sys; import os; print(os.path.dirname(sys.executable))'):$$PATH" ansible-test coverage xml --requirements --group-by command --group-by version
436438
@if [ "${GITHUB_ACTIONS}" = "true" ]; \
437439
then \
438440
echo cov-report-files="$$(find "$(COLLECTION_INSTALL)/tests/output/reports/" -type f -name 'coverage=integration*.xml' -print0 | tr '\0' ',' | sed 's#,$$##')" >> "${GITHUB_OUTPUT}"; \

0 commit comments

Comments
 (0)