Skip to content

Commit be50dd5

Browse files
richmmartinpitt
authored andcommitted
ci: bump tox-lsr to 3.8.0; rename qemu/kvm tests
This will make the qemu/kvm tests be tested in either ascending or descending ASCII order. This should give us better test coverage of clean up scenarios which may fail depending on the order of the previous tests. Rename the qemu/kvm tests so that the statuses are shorter and more intuitive. Improve qemu/kvm test failure error reporting. Signed-off-by: Rich Megginson <[email protected]>
1 parent cfcf4c8 commit be50dd5

File tree

5 files changed

+62
-13
lines changed

5 files changed

+62
-13
lines changed

.github/workflows/ansible-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Install tox, tox-lsr
3333
run: |
3434
set -euxo pipefail
35-
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.6.0"
35+
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.8.0"
3636
3737
- name: Convert role to collection format
3838
id: collection

.github/workflows/ansible-managed-var-comment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Install tox, tox-lsr
3131
run: |
3232
set -euxo pipefail
33-
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.6.0"
33+
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.8.0"
3434
3535
- name: Run ansible-plugin-scan
3636
run: |

.github/workflows/ansible-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Install tox, tox-lsr
3434
run: |
3535
set -euxo pipefail
36-
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.6.0"
36+
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.8.0"
3737
3838
- name: Convert role to collection format
3939
run: |

.github/workflows/python-unit-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
tox=tox
6666
virtualenv=virtualenv
6767
fi
68-
pip install "$tox" "$virtualenv" "git+https://github.com/linux-system-roles/tox-lsr@3.6.0"
68+
pip install "$tox" "$virtualenv" "git+https://github.com/linux-system-roles/tox-lsr@3.8.0"
6969
# If you have additional OS dependency packages e.g. libcairo2-dev
7070
# then put them in .github/config/ubuntu-requirements.txt, one
7171
# package per line.

.github/workflows/qemu-kvm-integration-tests.yml

Lines changed: 58 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: QEMU/KVM Integration tests
2+
name: Test
33
on: # yamllint disable-line rule:truthy
44
pull_request:
55
merge_group:
@@ -17,18 +17,34 @@ permissions:
1717
# This is required for the ability to create/update the Pull request status
1818
statuses: write
1919
jobs:
20-
qemu_kvm:
20+
scenario:
2121
runs-on: ubuntu-latest
2222

2323
strategy:
2424
fail-fast: false
2525
matrix:
2626
scenario:
27+
# QEMU
2728
- { image: "centos-9", env: "qemu-ansible-core-2.16" }
2829
- { image: "centos-10", env: "qemu-ansible-core-2.17" }
2930
# ansible/libdnf5 bug: https://issues.redhat.com/browse/RHELMISC-10110
3031
# - { image: "fedora-41", env: "qemu-ansible-core-2.17" }
3132
- { image: "fedora-42", env: "qemu-ansible-core-2.17" }
33+
34+
# container
35+
- { image: "centos-9", env: "container-ansible-core-2.16" }
36+
- { image: "centos-9-bootc", env: "container-ansible-core-2.16" }
37+
# broken on non-running dbus
38+
# - { image: "centos-10", env: "container-ansible-core-2.17" }
39+
- { image: "centos-10-bootc", env: "container-ansible-core-2.17" }
40+
- { image: "fedora-41", env: "container-ansible-core-2.17" }
41+
- { image: "fedora-42", env: "container-ansible-core-2.17" }
42+
- { image: "fedora-41-bootc", env: "container-ansible-core-2.17" }
43+
- { image: "fedora-42-bootc", env: "container-ansible-core-2.17" }
44+
45+
env:
46+
TOX_ARGS: "--skip-tags tests::infiniband,tests::nvme,tests::scsi"
47+
3248
steps:
3349
- name: Checkout repo
3450
uses: actions/checkout@v4
@@ -38,6 +54,7 @@ jobs:
3854
run: |
3955
set -euxo pipefail
4056
image="${{ matrix.scenario.image }}"
57+
image="${image%-bootc}"
4158
4259
# convert image to tag formats
4360
platform=
@@ -51,6 +68,20 @@ jobs:
5168
supported=true
5269
fi
5370
71+
# bootc build support (in buildah) has a separate flag
72+
if [ "${{ matrix.scenario.image }}" != "$image" ]; then
73+
if ! yq -e '.galaxy_info.galaxy_tags[] | select(. == "containerbuild")' meta/main.yml; then
74+
supported=
75+
fi
76+
else
77+
# roles need to opt into support for running in a system container
78+
env="${{ matrix.scenario.env }}"
79+
if [ "${env#container}" != "$env" ] &&
80+
! yq -e '.galaxy_info.galaxy_tags[] | select(. == "container")' meta/main.yml; then
81+
supported=
82+
fi
83+
fi
84+
5485
echo "supported=$supported" >> "$GITHUB_OUTPUT"
5586
5687
- name: Set up /dev/kvm
@@ -74,22 +105,22 @@ jobs:
74105
python3 -m pip install --upgrade pip
75106
sudo apt update
76107
sudo apt install -y --no-install-recommends git ansible-core genisoimage qemu-system-x86
77-
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.6.0"
108+
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.8.0"
78109
79110
- name: Configure tox-lsr
80111
if: steps.check_platform.outputs.supported
81112
run: >-
82113
curl -o ~/.config/linux-system-roles.json
83114
https://raw.githubusercontent.com/linux-system-roles/linux-system-roles.github.io/master/download/linux-system-roles.json
84115
85-
- name: Run qemu/kvm tox integration tests
86-
if: steps.check_platform.outputs.supported
116+
- name: Run qemu integration tests
117+
if: steps.check_platform.outputs.supported && startsWith(matrix.scenario.env, 'qemu')
87118
run: >-
88119
tox -e ${{ matrix.scenario.env }} -- --image-name ${{ matrix.scenario.image }} --make-batch
89120
--log-level=debug --skip-tags tests::infiniband,tests::nvme,tests::scsi --
90121
91-
- name: Test result summary
92-
if: steps.check_platform.outputs.supported && always()
122+
- name: Qemu result summary
123+
if: steps.check_platform.outputs.supported && startsWith(matrix.scenario.env, 'qemu') && always()
93124
run: |
94125
set -euo pipefail
95126
# some platforms may have setup/cleanup playbooks - need to find the
@@ -109,6 +140,24 @@ jobs:
109140
echo "$f"
110141
done < batch.report
111142
143+
- name: Run container tox integration tests
144+
if: steps.check_platform.outputs.supported && startsWith(matrix.scenario.env, 'container')
145+
run: |
146+
set -euo pipefail
147+
# HACK: debug.py/profile.py setup is broken
148+
export LSR_CONTAINER_PROFILE=false
149+
export LSR_CONTAINER_PRETTY=false
150+
rc=0
151+
for t in tests/tests_*.yml; do
152+
if tox -e ${{ matrix.scenario.env }} -- --image-name ${{ matrix.scenario.image }} $t > ${t}.log 2>&1; then
153+
echo "PASS: $(basename $t)"
154+
else
155+
echo "FAIL: $(basename $t)"
156+
rc=1
157+
fi
158+
done
159+
exit $rc
160+
112161
- name: Upload test logs on failure
113162
if: failure()
114163
uses: actions/upload-artifact@v4
@@ -127,7 +176,7 @@ jobs:
127176
run: |
128177
set -euo pipefail
129178
for f in tests/*.log; do
130-
if FAIL=$(grep -B100 -A30 "fatal:" "$f"); then
179+
if FAIL=$(grep -E -B100 -A30 "fatal:|An exception occurred" "$f"); then
131180
echo "::group::$(basename $f)"
132181
echo "$FAIL"
133182
echo "::endgroup::"
@@ -139,6 +188,6 @@ jobs:
139188
uses: myrotvorets/set-commit-status-action@master
140189
with:
141190
status: success
142-
context: "${{ github.workflow }} / qemu_kvm (${{ matrix.scenario.image }}, ${{ matrix.scenario.env }}) (pull_request)"
191+
context: "${{ github.workflow }} / scenario (${{ matrix.scenario.image }}, ${{ matrix.scenario.env }}) (pull_request)"
143192
description: The role does not support this platform. Skipping.
144193
targetUrl: ""

0 commit comments

Comments
 (0)