Skip to content

Commit ca9ad7f

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 76381bb commit ca9ad7f

File tree

6 files changed

+54
-6
lines changed

6 files changed

+54
-6
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/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
@@ -19,3 +19,50 @@ are likely to be suitable for new contributors!
1919

2020
**Code** is managed on [Github](https://github.com/linux-system-roles/postgresql), using
2121
[Pull Requests](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests).
22+
23+
## Running CI Tests Locally
24+
25+
### Use tox-lsr with qemu
26+
27+
The latest version of tox-lsr supports qemu testing.
28+
<https://github.com/linux-system-roles/tox-lsr#qemu-testing>
29+
30+
**Steps:**
31+
32+
1. If you are using RHEL or CentOS, enable the EPEL repository for your
33+
platform - <https://docs.fedoraproject.org/en-US/epel/>
34+
35+
2. Use yum or dnf to install `standard-test-roles-inventory-qemu`
36+
* If for some reason dnf/yum do not work, just download the script from
37+
<https://pagure.io/standard-test-roles/raw/master/f/inventory/standard-inventory-qcow2> <!--- wokeignore:rule=master -->
38+
* copy to your `$PATH`, and make sure it is executable
39+
40+
3. Install tox
41+
* Use yum/dnf to install `python3-tox` - if that does not work, then use
42+
`pip install --user tox`, then make sure `~/.local/bin` is in your `$PATH`
43+
44+
4. Install tox-lsr <https://github.com/linux-system-roles/tox-lsr#how-to-get-it>
45+
46+
```bash
47+
pip install --user git+https://github.com/linux-system-roles/tox-lsr@main
48+
```
49+
50+
5. Download the config file to `~/.config/linux-system-roles.json` from
51+
<https://github.com/linux-system-roles/linux-system-roles.github.io/blob/main/download/linux-system-roles.json>
52+
53+
6. Assuming you are in a git clone of a role repo which has a tox.ini file -
54+
you can use e.g.
55+
56+
```bash
57+
tox -e qemu-ansible-core-2.14 -- --image-name centos-9 tests/tests_default.yml
58+
```
59+
60+
There are many command line options and environment variables which can be used
61+
to control the behavior, and you can customize the testenv in tox.ini. See
62+
<https://github.com/linux-system-roles/tox-lsr#qemu-testing>
63+
64+
This method supports RHEL also - will download the latest image for a compose,
65+
and will set up the yum repos to point to internal composes.
66+
67+
See <https://linux-system-roles.github.io/contribute.html> for general
68+
development guidelines.

0 commit comments

Comments
 (0)