Skip to content

Commit

Permalink
Merge pull request #1152 from james-garner-canonical/24.10/ci/fix-24-…
Browse files Browse the repository at this point in the history
…04-tox

#1152

#### Description

Github's rollout of `24.04` for `ubuntu-latest` has now reached `python-libjuju`, so `pip install tox` no longer works -- `24.04` prevents installing packages using `pip`. This causes an error with in 'Setup operator environment' using `charmed-kubernetes/actions-operator@main`. The fix is to run our 'Setup Python' step using `actions/setup-python` before `actions-operator` instead of after.

Since this takes care of installing `tox`, we can remove `pip install tox` for the jobs using these steps.

Also bump `setup-python` to `v5` for integration-quarantine, matching the recent PR bumping the version for other jobs.

#### QA Steps

Tests no longer fail when trying to install `tox`, as they started doing in the last 12 hours.

#### Notes

Fix documented in charmed-kubernetes/actions-operator [here](charmed-kubernetes/actions-operator#82 (comment)).
  • Loading branch information
jujubot authored Oct 9, 2024
2 parents 1f5d361 + a4ce7ad commit 244e01b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 28 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Setup operator environment
uses: charmed-kubernetes/actions-operator@main
with:
Expand Down Expand Up @@ -112,12 +116,6 @@ jobs:
# # set model defaults
# juju model-defaults apt-http-proxy=$PROXY apt-https-proxy=$PROXY juju-http-proxy=$PROXY juju-https-proxy=$PROXY snap-http-proxy=$PROXY snap-https-proxy=$PROXY
# juju model-defaults
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
- name: Run integration
# Force one single concurrent test
run: tox -e integration
Expand All @@ -134,16 +132,14 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Setup operator environment
uses: charmed-kubernetes/actions-operator@main
with:
provider: lxd
juju-channel: 3.4/stable
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox
- name: Run integration
run: tox -e integration-quarantine
13 changes: 5 additions & 8 deletions .github/workflows/test_candidate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,17 @@ jobs:
- name: Check out code
uses: actions/checkout@v4
if: ${{ env.next-test != 'NA' }}
- name: Setup operator environment
if: ${{ env.next-test != 'NA' }}
uses: charmed-kubernetes/actions-operator@main
with:
provider: lxd
juju-channel: 3.4/candidate
- name: Setup Python
if: ${{ env.next-test != 'NA' }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
- name: Setup operator environment
if: ${{ env.next-test != 'NA' }}
run: pip install tox
uses: charmed-kubernetes/actions-operator@main
with:
provider: lxd
juju-channel: 3.4/candidate
- name: Run integration
if: ${{ env.next-test != 'NA' }}
# Force one single concurrent test
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/test_edge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,17 @@ jobs:
- name: Check out code
uses: actions/checkout@v4
if: ${{ env.next-test != 'NA' }}
- name: Setup operator environment
if: ${{ env.next-test != 'NA' }}
uses: charmed-kubernetes/actions-operator@main
with:
provider: lxd
juju-channel: 3.4/edge
- name: Setup Python
if: ${{ env.next-test != 'NA' }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
- name: Setup operator environment
if: ${{ env.next-test != 'NA' }}
run: pip install tox
uses: charmed-kubernetes/actions-operator@main
with:
provider: lxd
juju-channel: 3.4/edge
- name: Run integration
if: ${{ env.next-test != 'NA' }}
# Force one single concurrent test
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# (pre ubuntu 24.04 -- otherwise consider using pipx or apt instead of pip)
# and then run "tox" from this directory.

[tox]
Expand Down

0 comments on commit 244e01b

Please sign in to comment.