Skip to content

Commit 3f34009

Browse files
authored
Merge pull request #1217 from dimaqq/ci-bring-unit-tests-back-to-life
#1217 A few changes interplayed badly and we were running `tox -e py3` in github actions, which only installed the dependencies and didn't run the unit tests 😱 This PR: - run unit tests again - run integration tests against Juju 3.6
2 parents 99dcd1f + 834705d commit 3f34009

3 files changed

Lines changed: 25 additions & 50 deletions

File tree

.github/workflows/test.yaml

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,12 @@ jobs:
3131
python:
3232
- "3.10"
3333
steps:
34-
- name: Check out code
35-
uses: actions/checkout@v4
36-
- name: Setup Python
37-
uses: actions/setup-python@v5
34+
- uses: actions/checkout@v4
35+
- uses: actions/setup-python@v5
3836
with:
3937
python-version: ${{ matrix.python }}
40-
- name: Install dependencies
41-
run: pip install tox
42-
- name: Run validation tests
43-
run: tox -e validate
38+
- uses: astral-sh/setup-uv@v3.2.2
39+
- run: uvx -p ${{ matrix.python }} tox -e validate
4440

4541
unit-tests:
4642
name: Unit tests
@@ -56,16 +52,12 @@ jobs:
5652
- "3.12"
5753
- "3.13"
5854
steps:
59-
- name: Check out code
60-
uses: actions/checkout@v4
61-
- name: Setup Python
62-
uses: actions/setup-python@v5
55+
- uses: actions/checkout@v4
56+
- uses: actions/setup-python@v5
6357
with:
6458
python-version: ${{ matrix.python }}
65-
- name: Install dependencies
66-
run: pip install tox
67-
- name: Run unit tests
68-
run: tox -e py3
59+
- uses: astral-sh/setup-uv@v3.2.2
60+
- run: uvx -p ${{ matrix.python }} tox -e unit
6961

7062
integration:
7163
name: Integration
@@ -85,21 +77,14 @@ jobs:
8577
- "3.3/stable"
8678
- "3.4/stable"
8779
- "3.5/stable"
88-
# A bunch of tests fail with juju.errors.JujuError: base: ubuntu@15.04/stable
89-
# * test_subordinate_units
90-
# * test_destroy_unit
91-
# * test_ssh
92-
# * ...
93-
# - "3.6/beta"
80+
- "3.6/candidate"
9481
steps:
95-
- name: Check out code
96-
uses: actions/checkout@v4
97-
- name: Setup Python
98-
uses: actions/setup-python@v5
82+
- uses: actions/checkout@v4
83+
- uses: actions/setup-python@v5
9984
with:
10085
python-version: ${{ matrix.python }}
101-
- name: Setup operator environment
102-
uses: charmed-kubernetes/actions-operator@main
86+
- uses: astral-sh/setup-uv@v3.2.2
87+
- uses: charmed-kubernetes/actions-operator@main
10388
with:
10489
provider: lxd
10590
juju-channel: ${{ matrix.juju }}
@@ -131,9 +116,7 @@ jobs:
131116
# # set model defaults
132117
# 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
133118
# juju model-defaults
134-
- name: Run integration
135-
# Force one single concurrent test
136-
run: tox -e integration
119+
- run: uvx -p ${{ matrix.python }} tox -e integration
137120

138121
integration-quarantine:
139122
name: Quarantined Integration Tests
@@ -151,16 +134,13 @@ jobs:
151134
- "3.4/stable"
152135
- "3.5/stable"
153136
steps:
154-
- name: Check out code
155-
uses: actions/checkout@v4
156-
- name: Setup Python
157-
uses: actions/setup-python@v5
137+
- uses: actions/checkout@v4
138+
- uses: actions/setup-python@v5
158139
with:
159140
python-version: ${{ matrix.python }}
160-
- name: Setup operator environment
161-
uses: charmed-kubernetes/actions-operator@main
141+
- uses: astral-sh/setup-uv@v3.2.2
142+
- uses: charmed-kubernetes/actions-operator@main
162143
with:
163144
provider: lxd
164145
juju-channel: ${{ matrix.juju }}
165-
- name: Run integration
166-
run: tox -e integration-quarantine
146+
- run: uvx -p ${{ matrix.python }} tox -e integration-quarantine

Makefile

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@ clean:
88
find . -name __pycache__ -type d -exec rm -r {} +
99
find . -name *.pyc -delete
1010
rm -rf .tox
11-
rm -rf docs/_build/
12-
13-
.PHONY: .tox
14-
.tox:
15-
tox -r --notest
11+
rm -rf build dist docs/_build/
1612

1713
.PHONY: client
1814
client:
@@ -21,19 +17,19 @@ client:
2117
pre-commit run --files $(shell echo juju/client/_[cd]*.py)
2218

2319
.PHONY: run-unit-tests
24-
run-unit-tests: .tox
25-
tox -e py3
20+
run-unit-tests:
21+
uvx tox -e unit
2622

2723
.PHONY: run-integration-tests
28-
run-integration-tests: .tox
29-
tox -e integration
24+
run-integration-tests:
25+
uvx tox -e integration
3026

3127
.PHONY: run-all-tests
3228
test: run-unit-tests run-integration-tests
3329

3430
.PHONY: docs
3531
docs:
36-
tox -e docs
32+
uvx tox -e docs
3733

3834
.PHONY: build-test
3935
build-test:

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# and then run "tox" from this directory.
66

77
[tox]
8-
envlist = py3,py38,py39,py310,py311,docs
98
skipsdist=True
109

1110
[testenv]

0 commit comments

Comments
 (0)