Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ kinds:
- playbook: "**/examples/*.yml"
skip_list:
- fqcn-builtins
- name[unique]
- var-naming[no-role-prefix]
exclude_paths:
- tests/roles/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Install tox, tox-lsr
run: |
set -euxo pipefail
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.11.0"
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.11.1"

- name: Convert role to collection format
id: collection
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ansible-managed-var-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install tox, tox-lsr
run: |
set -euxo pipefail
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.11.0"
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.11.1"

- name: Run ansible-plugin-scan
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Install tox, tox-lsr
run: |
set -euxo pipefail
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.11.0"
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.11.1"

- name: Convert role to collection format
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
tox=tox
virtualenv=virtualenv
fi
pip install "$tox" "$virtualenv" "git+https://github.com/linux-system-roles/tox-lsr@3.11.0"
pip install "$tox" "$virtualenv" "git+https://github.com/linux-system-roles/tox-lsr@3.11.1"
# If you have additional OS dependency packages e.g. libcairo2-dev
# then put them in .github/config/ubuntu-requirements.txt, one
# package per line.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/qemu-kvm-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
python3 -m pip install --upgrade pip
sudo apt update
sudo apt install -y --no-install-recommends git ansible-core genisoimage qemu-system-x86
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.11.0"
pip3 install "git+https://github.com/linux-system-roles/tox-lsr@3.11.1"

# HACK: Drop this when moving this workflow to 26.04 LTS
- name: Update podman to 5.x for compatibility with bootc-image-builder's podman 5
Expand Down Expand Up @@ -199,7 +199,7 @@ jobs:
if tox -e "$env" -- --image-file "$(pwd)/$image_file" \
--log-level debug $TOX_ARGS \
--lsr-report-errors-url DEFAULT \
-e __bootc_validation=true \
-e "__bootc_validation: true" \
-- "$test" >out 2>&1; then
mv out "${test}-PASS.log"
else
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/tft_citest_bad.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ jobs:
echo "The workflow $PENDING_RUN is still running, wait for it to finish to re-run"
exit 1
fi
# TF tests can fail or can be cancelled due to TF internal issues
RUN_ID=$(gh api "repos/$REPO/actions/workflows/tft.yml/runs?event=issue_comment" \
| jq -r "[.workflow_runs[] | select( .display_title == \"$PR_TITLE\" ) | select( .conclusion == \"failure\" ) | .id][0]")
| jq -r "[.workflow_runs[] | select( .display_title == \"$PR_TITLE\" ) | select( .conclusion == \"failure\" or .conclusion == \"cancelled\" ) | .id][0]")
if [ "$RUN_ID" = "null" ]; then
echo "Failed workflow not found, exiting"
exit 1
Expand Down
47 changes: 47 additions & 0 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,50 @@ supports EL7, and on py26 if the role supports EL6.[1]
to use a non-system python on the managed node, so it is a good idea to ensure
your code has broad python version compatibility, and do not assume your code
will only ever be run with the default system python.

## Running CI Tests Locally

### Use tox-lsr with qemu

The latest version of tox-lsr supports qemu testing.
<https://github.com/linux-system-roles/tox-lsr#qemu-testing>

**Steps:**

1. If you are using RHEL or CentOS, enable the EPEL repository for your
platform - <https://docs.fedoraproject.org/en-US/epel/>

2. Use yum or dnf to install `standard-test-roles-inventory-qemu`
* If for some reason dnf/yum do not work, just download the script from
<https://pagure.io/standard-test-roles/raw/master/f/inventory/standard-inventory-qcow2> <!--- wokeignore:rule=master -->
* copy to your `$PATH`, and make sure it is executable

3. Install tox
* Use yum/dnf to install `python3-tox` - if that does not work, then use
`pip install --user tox`, then make sure `~/.local/bin` is in your `$PATH`

4. Install tox-lsr <https://github.com/linux-system-roles/tox-lsr#how-to-get-it>

```bash
pip install --user git+https://github.com/linux-system-roles/tox-lsr@main
```

5. Download the config file to `~/.config/linux-system-roles.json` from
<https://github.com/linux-system-roles/linux-system-roles.github.io/blob/main/download/linux-system-roles.json>

6. Assuming you are in a git clone of a role repo which has a tox.ini file -
you can use e.g.

```bash
tox -e qemu-ansible-core-2.14 -- --image-name centos-9 tests/tests_default.yml
```

There are many command line options and environment variables which can be used
to control the behavior, and you can customize the testenv in tox.ini. See
<https://github.com/linux-system-roles/tox-lsr#qemu-testing>

This method supports RHEL also - will download the latest image for a compose,
and will set up the yum repos to point to internal composes.

See <https://linux-system-roles.github.io/contribute.html> for general
development guidelines.
Loading