test: sort pytest params to guarantee identical ordering across workers #3629
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Observability Charm Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_call: | |
workflow_dispatch: | |
jobs: | |
o11y-charm-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- charm-repo: canonical/alertmanager-k8s-operator | |
commit: 76a98ac2e8eb94d2ef714039c2b8f365f937dedc # rev149 2025-01-25T12:09:32Z | |
- charm-repo: canonical/prometheus-k8s-operator | |
commit: 62cd2d9b8c3a528910ce12c553209817e1b7a889 # rev226 2024-12-19T16:01:25Z | |
- charm-repo: canonical/grafana-k8s-operator | |
commit: 3c8db2d5ca7106bb39b5745de44732053888e190 # rev135 2025-01-28T15:24:39Z | |
steps: | |
- name: Checkout the ${{ matrix.charm-repo }} repository | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ matrix.charm-repo }} | |
ref: ${{ matrix.commit }} | |
- name: Install dependencies | |
run: pip install tox~=4.2 uv~=0.6 | |
- name: Update 'ops' dependency in test charm to latest | |
run: | | |
if [ -e "requirements.txt" ]; then | |
sed -i -e "/^ops[ ><=]/d" -e "/canonical\/operator/d" -e "/#egg=ops/d" requirements.txt | |
echo -e "\ngit+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#egg=ops" >> requirements.txt | |
elif [ -e "uv.lock" ]; then | |
uv add git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA --raw-sources | |
else | |
echo "Error: no requirements.txt or uv.lock file found" | |
exit 1 | |
fi | |
- name: Run the charm's unit tests | |
if: ${{ !(matrix.disabled) }} | |
run: tox -vve unit | |
- name: Run the charm's static analysis checks | |
if: ${{ !(matrix.disabled) }} | |
run: tox -vve static-charm |