mirror of
https://github.com/ansible/awx.git
synced 2026-01-09 23:12:08 -03:30
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
This commit is contained in:
parent
f3f10ae9ce
commit
5ea2fe65b0
2
.github/actions/awx_devel_image/action.yml
vendored
2
.github/actions/awx_devel_image/action.yml
vendored
@ -11,8 +11,6 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- uses: ./.github/actions/setup-python
|
|
||||||
|
|
||||||
- name: Set lower case owner name
|
- name: Set lower case owner name
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo "OWNER_LC=${OWNER,,}" >> $GITHUB_ENV
|
run: echo "OWNER_LC=${OWNER,,}" >> $GITHUB_ENV
|
||||||
|
|||||||
2
.github/actions/run_awx_devel/action.yml
vendored
2
.github/actions/run_awx_devel/action.yml
vendored
@ -36,7 +36,7 @@ runs:
|
|||||||
|
|
||||||
- name: Upgrade ansible-core
|
- name: Upgrade ansible-core
|
||||||
shell: bash
|
shell: bash
|
||||||
run: python3 -m pip install --upgrade ansible-core
|
run: python -m pip install --upgrade ansible-core
|
||||||
|
|
||||||
- name: Install system deps
|
- name: Install system deps
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
37
.github/workflows/ci.yml
vendored
37
.github/workflows/ci.yml
vendored
@ -145,7 +145,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: ./.github/actions/setup-python
|
- uses: ./.github/actions/setup-python
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.13'
|
||||||
|
|
||||||
- uses: ./.github/actions/run_awx_devel
|
- uses: ./.github/actions/run_awx_devel
|
||||||
id: awx
|
id: awx
|
||||||
@ -188,11 +188,11 @@ jobs:
|
|||||||
- name: Setup python, referencing action at awx relative path
|
- name: Setup python, referencing action at awx relative path
|
||||||
uses: ./awx/.github/actions/setup-python
|
uses: ./awx/.github/actions/setup-python
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.13'
|
||||||
|
|
||||||
- name: Install playbook dependencies
|
- name: Install playbook dependencies
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install docker
|
python -m pip install docker
|
||||||
|
|
||||||
- name: Build AWX image
|
- name: Build AWX image
|
||||||
working-directory: awx
|
working-directory: awx
|
||||||
@ -206,8 +206,8 @@ jobs:
|
|||||||
- name: Run test deployment with awx-operator
|
- name: Run test deployment with awx-operator
|
||||||
working-directory: awx-operator
|
working-directory: awx-operator
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install -r molecule/requirements.txt
|
python -m pip install -r molecule/requirements.txt
|
||||||
python3 -m pip install PyYAML # for awx/tools/scripts/rewrite-awx-operator-requirements.py
|
python -m pip install PyYAML # for awx/tools/scripts/rewrite-awx-operator-requirements.py
|
||||||
$(realpath ../awx/tools/scripts/rewrite-awx-operator-requirements.py) molecule/requirements.yml $(realpath ../awx)
|
$(realpath ../awx/tools/scripts/rewrite-awx-operator-requirements.py) molecule/requirements.yml $(realpath ../awx)
|
||||||
ansible-galaxy collection install -r molecule/requirements.yml
|
ansible-galaxy collection install -r molecule/requirements.yml
|
||||||
sudo rm -f $(which kustomize)
|
sudo rm -f $(which kustomize)
|
||||||
@ -294,7 +294,11 @@ jobs:
|
|||||||
|
|
||||||
- uses: ./.github/actions/setup-python
|
- uses: ./.github/actions/setup-python
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.13'
|
||||||
|
|
||||||
|
- name: Remove system ansible to avoid conflicts
|
||||||
|
run: |
|
||||||
|
python -m pip uninstall -y ansible ansible-core || true
|
||||||
|
|
||||||
- uses: ./.github/actions/run_awx_devel
|
- uses: ./.github/actions/run_awx_devel
|
||||||
id: awx
|
id: awx
|
||||||
@ -305,8 +309,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Install dependencies for running tests
|
- name: Install dependencies for running tests
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install -e ./awxkit/
|
python -m pip install -e ./awxkit/
|
||||||
python3 -m pip install -r awx_collection/requirements.txt
|
python -m pip install -r awx_collection/requirements.txt
|
||||||
|
hash -r # Rehash to pick up newly installed scripts
|
||||||
|
|
||||||
- name: Run integration tests
|
- name: Run integration tests
|
||||||
id: make-run
|
id: make-run
|
||||||
@ -318,6 +323,7 @@ jobs:
|
|||||||
echo 'password = password' >> ~/.tower_cli.cfg
|
echo 'password = password' >> ~/.tower_cli.cfg
|
||||||
echo 'verify_ssl = false' >> ~/.tower_cli.cfg
|
echo 'verify_ssl = false' >> ~/.tower_cli.cfg
|
||||||
TARGETS="$(ls awx_collection/tests/integration/targets | grep '${{ matrix.target-regex.regex }}' | tr '\n' ' ')"
|
TARGETS="$(ls awx_collection/tests/integration/targets | grep '${{ matrix.target-regex.regex }}' | tr '\n' ' ')"
|
||||||
|
export PYTHONPATH="$(python -c 'import site; print(":".join(site.getsitepackages()))')${PYTHONPATH:+:$PYTHONPATH}"
|
||||||
make COLLECTION_VERSION=100.100.100-git COLLECTION_TEST_TARGET="--requirements $TARGETS" test_collection_integration
|
make COLLECTION_VERSION=100.100.100-git COLLECTION_TEST_TARGET="--requirements $TARGETS" test_collection_integration
|
||||||
env:
|
env:
|
||||||
ANSIBLE_TEST_PREFER_PODMAN: 1
|
ANSIBLE_TEST_PREFER_PODMAN: 1
|
||||||
@ -372,10 +378,14 @@ jobs:
|
|||||||
|
|
||||||
- uses: ./.github/actions/setup-python
|
- uses: ./.github/actions/setup-python
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.13'
|
||||||
|
|
||||||
|
- name: Remove system ansible to avoid conflicts
|
||||||
|
run: |
|
||||||
|
python -m pip uninstall -y ansible ansible-core || true
|
||||||
|
|
||||||
- name: Upgrade ansible-core
|
- name: Upgrade ansible-core
|
||||||
run: python3 -m pip install --upgrade ansible-core
|
run: python -m pip install --upgrade ansible-core
|
||||||
|
|
||||||
- name: Download coverage artifacts
|
- name: Download coverage artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@ -390,11 +400,12 @@ jobs:
|
|||||||
mkdir -p ~/.ansible/collections/ansible_collections/awx/awx/tests/output/coverage
|
mkdir -p ~/.ansible/collections/ansible_collections/awx/awx/tests/output/coverage
|
||||||
cp -rv coverage/* ~/.ansible/collections/ansible_collections/awx/awx/tests/output/coverage/
|
cp -rv coverage/* ~/.ansible/collections/ansible_collections/awx/awx/tests/output/coverage/
|
||||||
cd ~/.ansible/collections/ansible_collections/awx/awx
|
cd ~/.ansible/collections/ansible_collections/awx/awx
|
||||||
ansible-test coverage combine --requirements
|
hash -r # Rehash to pick up newly installed scripts
|
||||||
ansible-test coverage html
|
PATH="$(python -c 'import sys; import os; print(os.path.dirname(sys.executable))'):$PATH" ansible-test coverage combine --requirements
|
||||||
|
PATH="$(python -c 'import sys; import os; print(os.path.dirname(sys.executable))'):$PATH" ansible-test coverage html
|
||||||
echo '## AWX Collection Integration Coverage' >> $GITHUB_STEP_SUMMARY
|
echo '## AWX Collection Integration Coverage' >> $GITHUB_STEP_SUMMARY
|
||||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||||
ansible-test coverage report >> $GITHUB_STEP_SUMMARY
|
PATH="$(python -c 'import sys; import os; print(os.path.dirname(sys.executable))'):$PATH" ansible-test coverage report >> $GITHUB_STEP_SUMMARY
|
||||||
echo '```' >> $GITHUB_STEP_SUMMARY
|
echo '```' >> $GITHUB_STEP_SUMMARY
|
||||||
echo >> $GITHUB_STEP_SUMMARY
|
echo >> $GITHUB_STEP_SUMMARY
|
||||||
echo '## AWX Collection Integration Coverage HTML' >> $GITHUB_STEP_SUMMARY
|
echo '## AWX Collection Integration Coverage HTML' >> $GITHUB_STEP_SUMMARY
|
||||||
|
|||||||
6
Makefile
6
Makefile
@ -27,6 +27,8 @@ TEST_DIRS ?= awx/main/tests/unit awx/main/tests/functional awx/conf/tests
|
|||||||
PARALLEL_TESTS ?= -n auto
|
PARALLEL_TESTS ?= -n auto
|
||||||
# collection integration test directories (defaults to all)
|
# collection integration test directories (defaults to all)
|
||||||
COLLECTION_TEST_TARGET ?=
|
COLLECTION_TEST_TARGET ?=
|
||||||
|
# Python version for ansible-test (must be 3.11, 3.12, or 3.13)
|
||||||
|
ANSIBLE_TEST_PYTHON_VERSION ?= 3.13
|
||||||
# args for collection install
|
# args for collection install
|
||||||
COLLECTION_PACKAGE ?= awx
|
COLLECTION_PACKAGE ?= awx
|
||||||
COLLECTION_NAMESPACE ?= awx
|
COLLECTION_NAMESPACE ?= awx
|
||||||
@ -431,8 +433,8 @@ test_collection_sanity:
|
|||||||
|
|
||||||
test_collection_integration: install_collection
|
test_collection_integration: install_collection
|
||||||
cd $(COLLECTION_INSTALL) && \
|
cd $(COLLECTION_INSTALL) && \
|
||||||
ansible-test integration --coverage -vvv $(COLLECTION_TEST_TARGET) && \
|
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) && \
|
||||||
ansible-test coverage xml --requirements --group-by command --group-by version
|
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
|
||||||
@if [ "${GITHUB_ACTIONS}" = "true" ]; \
|
@if [ "${GITHUB_ACTIONS}" = "true" ]; \
|
||||||
then \
|
then \
|
||||||
echo cov-report-files="$$(find "$(COLLECTION_INSTALL)/tests/output/reports/" -type f -name 'coverage=integration*.xml' -print0 | tr '\0' ',' | sed 's#,$$##')" >> "${GITHUB_OUTPUT}"; \
|
echo cov-report-files="$$(find "$(COLLECTION_INSTALL)/tests/output/reports/" -type f -name 'coverage=integration*.xml' -print0 | tr '\0' ',' | sed 's#,$$##')" >> "${GITHUB_OUTPUT}"; \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user