Skip to content

Commit 9964611

Browse files
authored
Merge pull request #1149 from james-garner-canonical/24.10/ci/quarantine-and-serialise
#1149 Tests in `integration/test_model.py` seem to be flaky even when run serially. All tests in `integration/test_crossmodel.py` are currently skipped, except one which used to be skipped, and is currently flaky even when run serially. This PR: * Serialises all integration tests following #1143 * Skips two tests from `test_model.py` that seem to always fail currently, whether run in serial or in parallel, following #1145 * Moves the flaky tests noted above into a separate job, so that the job running the remaining integration tests will hopefully have a shot at succeeding As a bonus feature, this split of the tests into two runners with `-n 1` seems to be faster than the original method of running all the integration tests in a single runner with `-n auto` (which worked out to be 4 processes on github).
2 parents 50b42d0 + 32979df commit 9964611

3 files changed

Lines changed: 51 additions & 1 deletion

File tree

.github/workflows/test.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,29 @@ jobs:
121121
- name: Run integration
122122
# Force one single concurrent test
123123
run: tox -e integration
124+
125+
integration-quarantine:
126+
name: Quarantined Integration Tests
127+
needs: [lint, unit-tests]
128+
timeout-minutes: 150
129+
runs-on: ubuntu-latest
130+
strategy:
131+
matrix:
132+
python:
133+
- "3.10"
134+
steps:
135+
- name: Check out code
136+
uses: actions/checkout@v3
137+
- name: Setup operator environment
138+
uses: charmed-kubernetes/actions-operator@main
139+
with:
140+
provider: lxd
141+
juju-channel: 3.4/stable
142+
- name: Setup Python
143+
uses: actions/setup-python@v4
144+
with:
145+
python-version: ${{ matrix.python }}
146+
- name: Install dependencies
147+
run: pip install tox
148+
- name: Run integration
149+
run: tox -e integration-quarantine

tests/integration/test_model.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ async def test_deploy_local_bundle_with_overlay_multi():
309309

310310
@base.bootstrapped
311311
@pytest.mark.bundle
312+
@pytest.mark.skip("Always fails -- investigate bundle charms")
312313
async def test_deploy_bundle_with_overlay_as_argument():
313314
async with base.CleanModel() as model:
314315
overlay_path = OVERLAYS_DIR / 'test-overlay.yaml'
@@ -342,6 +343,7 @@ async def test_deploy_bundle_with_multi_overlay_as_argument():
342343

343344
@base.bootstrapped
344345
@pytest.mark.bundle
346+
@pytest.mark.skip("Always fails -- investigate bundle charms")
345347
async def test_deploy_bundle_with_multiple_overlays_with_include_files():
346348
async with base.CleanModel() as model:
347349
bundle_yaml_path = TESTS_DIR / 'integration' / 'bundle' / 'bundle.yaml'

tox.ini

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,27 @@ envdir = {toxworkdir}/py3
6363
commands =
6464
pip install urllib3<2
6565
pip install pylxd
66-
python -m pytest --tb native -ra -v -n auto -k 'integration' -m 'not serial' {posargs}
66+
python -m pytest \
67+
--tb native \
68+
-ra -v -n 1 \
69+
-k 'integration' \
70+
--ignore {toxinidir}/tests/integration/test_crossmodel.py \
71+
--ignore {toxinidir}/tests/integration/test_model.py \
72+
-m 'not serial' \
73+
{posargs}
74+
75+
[testenv:integration-quarantine]
76+
envdir = {toxworkdir}/py3
77+
commands =
78+
pip install urllib3<2
79+
pip install pylxd
80+
python -m pytest \
81+
--tb native \
82+
-ra -v -n 1 \
83+
-m 'not serial' \
84+
{posargs} \
85+
{toxinidir}/tests/integration/test_crossmodel.py \
86+
{toxinidir}/tests/integration/test_model.py
6787

6888
[testenv:unit]
6989
envdir = {toxworkdir}/py3
@@ -74,6 +94,8 @@ commands =
7494

7595
[testenv:serial]
7696
# tests that can't be run in parallel
97+
# there's one test marked with 'serial'
98+
# it doesn't get run in CI
7799
envdir = {toxworkdir}/py3
78100
commands =
79101
pip install urllib3<2

0 commit comments

Comments
 (0)