Skip to content

Commit 0c554ea

Browse files
committed
ci: rollout several recent changes to CI testing
* Pass in a YAML true value as `__bootc_validation: true` using the --extra-vars option to ensure that `__bootc_validation` is treated as a boolean and not a string value. `-e "__bootc_validation: true"` You can also use JSON format: `-e '{"__bootc_validation": true}'` but YAML is simpler in this case. * Use tox-lsr version 3.11.1 * Ensure the citest bad comment works when the test was cancelled in addition to the failure case. * Update contributing.md documentation * Update number of nodes to use in testing farm, if needed * remove unnecessary ansible-lint skips Signed-off-by: Rich Megginson <[email protected]>
1 parent 774b6ad commit 0c554ea

File tree

7 files changed

+55
-7
lines changed

7 files changed

+55
-7
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/[email protected].0"
35+
pip3 install "git+https://github.com/linux-system-roles/[email protected].1"
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/[email protected].0"
33+
pip3 install "git+https://github.com/linux-system-roles/[email protected].1"
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/[email protected].0"
36+
pip3 install "git+https://github.com/linux-system-roles/[email protected].1"
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
@@ -67,7 +67,7 @@ jobs:
6767
tox=tox
6868
virtualenv=virtualenv
6969
fi
70-
pip install "$tox" "$virtualenv" "git+https://github.com/linux-system-roles/[email protected].0"
70+
pip install "$tox" "$virtualenv" "git+https://github.com/linux-system-roles/[email protected].1"
7171
# If you have additional OS dependency packages e.g. libcairo2-dev
7272
# then put them in .github/config/ubuntu-requirements.txt, one
7373
# package per line.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
python3 -m pip install --upgrade pip
106106
sudo apt update
107107
sudo apt install -y --no-install-recommends git ansible-core genisoimage qemu-system-x86
108-
pip3 install "git+https://github.com/linux-system-roles/[email protected].0"
108+
pip3 install "git+https://github.com/linux-system-roles/[email protected].1"
109109
110110
# HACK: Drop this when moving this workflow to 26.04 LTS
111111
- name: Update podman to 5.x for compatibility with bootc-image-builder's podman 5
@@ -199,7 +199,7 @@ jobs:
199199
if tox -e "$env" -- --image-file "$(pwd)/$image_file" \
200200
--log-level debug $TOX_ARGS \
201201
--lsr-report-errors-url DEFAULT \
202-
-e __bootc_validation=true \
202+
-e "__bootc_validation: true" \
203203
-- "$test" >out 2>&1; then
204204
mv out "${test}-PASS.log"
205205
else

.github/workflows/tft_citest_bad.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ jobs:
3333
echo "The workflow $PENDING_RUN is still running, wait for it to finish to re-run"
3434
exit 1
3535
fi
36+
# TF tests can fail or can be cancelled due to TF internal issues
3637
RUN_ID=$(gh api "repos/$REPO/actions/workflows/tft.yml/runs?event=issue_comment" \
37-
| jq -r "[.workflow_runs[] | select( .display_title == \"$PR_TITLE\" ) | select( .conclusion == \"failure\" ) | .id][0]")
38+
| jq -r "[.workflow_runs[] | select( .display_title == \"$PR_TITLE\" ) | select( .conclusion == \"failure\" or .conclusion == \"cancelled\" ) | .id][0]")
3839
if [ "$RUN_ID" = "null" ]; then
3940
echo "Failed workflow not found, exiting"
4041
exit 1

contributing.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,50 @@ supports EL7, and on py26 if the role supports EL6.[1]
5050
to use a non-system python on the managed node, so it is a good idea to ensure
5151
your code has broad python version compatibility, and do not assume your code
5252
will only ever be run with the default system python.
53+
54+
## Running CI Tests Locally
55+
56+
### Use tox-lsr with qemu
57+
58+
The latest version of tox-lsr supports qemu testing.
59+
<https://github.com/linux-system-roles/tox-lsr#qemu-testing>
60+
61+
**Steps:**
62+
63+
1. If you are using RHEL or CentOS, enable the EPEL repository for your
64+
platform - <https://docs.fedoraproject.org/en-US/epel/>
65+
66+
2. Use yum or dnf to install `standard-test-roles-inventory-qemu`
67+
* If for some reason dnf/yum do not work, just download the script from
68+
<https://pagure.io/standard-test-roles/raw/master/f/inventory/standard-inventory-qcow2> <!--- wokeignore:rule=master -->
69+
* copy to your `$PATH`, and make sure it is executable
70+
71+
3. Install tox
72+
* Use yum/dnf to install `python3-tox` - if that does not work, then use
73+
`pip install --user tox`, then make sure `~/.local/bin` is in your `$PATH`
74+
75+
4. Install tox-lsr <https://github.com/linux-system-roles/tox-lsr#how-to-get-it>
76+
77+
```bash
78+
pip install --user git+https://github.com/linux-system-roles/tox-lsr@main
79+
```
80+
81+
5. Download the config file to `~/.config/linux-system-roles.json` from
82+
<https://github.com/linux-system-roles/linux-system-roles.github.io/blob/main/download/linux-system-roles.json>
83+
84+
6. Assuming you are in a git clone of a role repo which has a tox.ini file -
85+
you can use e.g.
86+
87+
```bash
88+
tox -e qemu-ansible-core-2.14 -- --image-name centos-9 tests/tests_default.yml
89+
```
90+
91+
There are many command line options and environment variables which can be used
92+
to control the behavior, and you can customize the testenv in tox.ini. See
93+
<https://github.com/linux-system-roles/tox-lsr#qemu-testing>
94+
95+
This method supports RHEL also - will download the latest image for a compose,
96+
and will set up the yum repos to point to internal composes.
97+
98+
See <https://linux-system-roles.github.io/contribute.html> for general
99+
development guidelines.

0 commit comments

Comments
 (0)