Skip to content

Commit 94e12e7

Browse files
authored
Merge pull request #1167 from dimaqq/fix-matrix-fail
#1167 Looks like I was wrong in #1163 Using https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast instead. Skip tests that are guaranteed to fail against older Juju controllers.
2 parents 74ab0f6 + 79ad99c commit 94e12e7

4 files changed

Lines changed: 55 additions & 5 deletions

File tree

.github/workflows/test.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ jobs:
9797
timeout-minutes: 150
9898
runs-on: ubuntu-latest
9999
strategy:
100+
fail-fast: false
100101
matrix:
101102
python:
102103
# We will reduce the workload to 3.10 to
@@ -114,7 +115,6 @@ jobs:
114115
# * test_ssh
115116
# * ...
116117
# - "3.6/beta"
117-
continue-on-error: false # ultimately fail a run if one of the matrix combinations fails
118118
steps:
119119
- name: Check out code
120120
uses: actions/checkout@v4
@@ -158,14 +158,14 @@ jobs:
158158
- name: Run integration
159159
# Force one single concurrent test
160160
run: tox -e integration
161-
continue-on-error: true # don't fail early, let other matrix combinations get tested
162161

163162
integration-quarantine:
164163
name: Quarantined Integration Tests
165164
needs: [lint, unit-tests]
166165
timeout-minutes: 150
167166
runs-on: ubuntu-latest
168167
strategy:
168+
fail-fast: false
169169
matrix:
170170
python:
171171
- "3.10"
@@ -174,10 +174,9 @@ jobs:
174174
- "3.3/stable"
175175
- "3.4/stable"
176176
- "3.5/stable"
177-
continue-on-error: false # ultimately fail the run if one of the matrix combinations fails
178177
steps:
179178
- name: Check out code
180-
uses: actions/checkout@v3
179+
uses: actions/checkout@v4
181180
- name: Setup Python
182181
uses: actions/setup-python@v5
183182
with:
@@ -189,4 +188,3 @@ jobs:
189188
juju-channel: ${{ matrix.juju }}
190189
- name: Run integration
191190
run: tox -e integration-quarantine
192-
continue-on-error: true # don't fail early, let other matrix combinations get tested

tests/integration/test_crossmodel.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ async def test_remove_saas():
9898
async def test_relate_with_offer():
9999
# pytest.skip('Revise: intermittent problem with the remove_saas call')
100100
async with base.CleanModel() as model_1:
101+
assert model_1._info
102+
if str(model_1._info.agent_version) < "3.4.3":
103+
pytest.skip("postgresql charm requires Juju 3.4.3 or later")
104+
101105
application = await model_1.deploy(
102106
'postgresql',
103107
application_name='postgresql',

tests/integration/test_model.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ async def test_deploy_bundle_with_storage_constraint():
217217
bundle_path = INTEGRATION_TEST_DIR / 'bundle' / 'bundle-with-storage-constraint.yaml'
218218

219219
async with base.CleanModel() as model:
220+
assert model._info
221+
if str(model._info.agent_version) < "3.4.3":
222+
pytest.skip("bundle/postgresql charm requires Juju 3.4.3 or later")
223+
220224
await model.deploy(bundle_path)
221225
await wait_for_bundle(model, bundle_path)
222226
storage = await model.list_storage()
@@ -237,6 +241,10 @@ async def test_deploy_local_charm():
237241
@base.bootstrapped
238242
async def test_deploy_charm_assumes():
239243
async with base.CleanModel() as model:
244+
assert model._info
245+
if str(model._info.agent_version) < "3.4.3":
246+
pytest.skip("postgresql charm requires Juju 3.4.3 or later")
247+
240248
await model.deploy('postgresql', channel='14/edge')
241249

242250

@@ -298,6 +306,10 @@ async def test_deploy_bundle():
298306
@pytest.mark.bundle
299307
async def test_deploy_local_bundle_with_overlay_multi():
300308
async with base.CleanModel() as model:
309+
assert model._info
310+
if str(model._info.agent_version) < "3.4.3":
311+
pytest.skip("bundle/postgresql charm requires Juju 3.4.3 or later")
312+
301313
bundle_with_overlay_path = OVERLAYS_DIR / 'bundle-with-overlay-multi.yaml'
302314
await model.deploy(bundle_with_overlay_path)
303315

@@ -312,6 +324,10 @@ async def test_deploy_local_bundle_with_overlay_multi():
312324
@pytest.mark.skip("Always fails -- investigate bundle charms")
313325
async def test_deploy_bundle_with_overlay_as_argument():
314326
async with base.CleanModel() as model:
327+
assert model._info
328+
if str(model._info.agent_version) < "3.4.3":
329+
pytest.skip("bundle/postgresql charm requires Juju 3.4.3 or later")
330+
315331
overlay_path = OVERLAYS_DIR / 'test-overlay.yaml'
316332

317333
await model.deploy('juju-qa-bundle-test', overlays=[overlay_path])
@@ -333,6 +349,10 @@ async def test_deploy_bundle_with_overlay_as_argument():
333349
@pytest.mark.bundle
334350
async def test_deploy_bundle_with_multi_overlay_as_argument():
335351
async with base.CleanModel() as model:
352+
assert model._info
353+
if str(model._info.agent_version) < "3.4.3":
354+
pytest.skip("bundle/postgresql charm requires Juju 3.4.3 or later")
355+
336356
overlay_path = OVERLAYS_DIR / 'test-multi-overlay.yaml'
337357

338358
await model.deploy('juju-qa-bundle-test', overlays=[overlay_path])
@@ -381,6 +401,10 @@ async def test_deploy_local_charm_folder_symlink():
381401
@base.bootstrapped
382402
async def test_deploy_from_ch_channel_revision_success():
383403
async with base.CleanModel() as model:
404+
assert model._info
405+
if str(model._info.agent_version) < "3.4.3":
406+
pytest.skip("postgresql charm requires Juju 3.4.3 or later")
407+
384408
# Ensure we're able to resolve charm these with channel and revision,
385409
# or channel without revision (note that revision requires channel,
386410
# but not vice versa)

tests/integration/test_secrets.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
@pytest.mark.bundle
1111
async def test_add_secret():
1212
async with base.CleanModel() as model:
13+
assert model._info
14+
if str(model._info.agent_version) < "3.3.0":
15+
pytest.skip("Juju too old, need Secrets API v2")
16+
1317
secret = await model.add_secret(name='my-apitoken', data_args=['token=34ae35facd4'])
1418
assert secret.startswith('secret:')
1519

@@ -28,6 +32,10 @@ async def test_list_secrets():
2832
charm_path = TESTS_DIR / 'charm-secret/charm-secret_ubuntu-22.04-amd64.charm'
2933

3034
async with base.CleanModel() as model:
35+
assert model._info
36+
if str(model._info.agent_version) < "3.3.0":
37+
pytest.skip("Juju too old, need Secrets API v2")
38+
3139
await model.deploy(str(charm_path))
3240
assert 'charm-secret' in model.applications
3341
await model.wait_for_idle(status="active")
@@ -42,6 +50,10 @@ async def test_list_secrets():
4250
@pytest.mark.bundle
4351
async def test_update_secret():
4452
async with base.CleanModel() as model:
53+
assert model._info
54+
if str(model._info.agent_version) < "3.3.0":
55+
pytest.skip("Juju too old, need Secrets API v2")
56+
4557
secret = await model.add_secret(name='my-apitoken', data_args=['token=34ae35facd4'])
4658
assert secret.startswith('secret:')
4759

@@ -56,6 +68,10 @@ async def test_update_secret():
5668
@pytest.mark.bundle
5769
async def test_remove_secret():
5870
async with base.CleanModel() as model:
71+
assert model._info
72+
if str(model._info.agent_version) < "3.3.0":
73+
pytest.skip("Juju too old, need Secrets API v2")
74+
5975
secret = await model.add_secret(name='my-apitoken', data_args=['token=34ae35facd4'])
6076
assert secret.startswith('secret:')
6177

@@ -69,6 +85,10 @@ async def test_remove_secret():
6985
@pytest.mark.bundle
7086
async def test_grant_secret():
7187
async with base.CleanModel() as model:
88+
assert model._info
89+
if str(model._info.agent_version) < "3.3.0":
90+
pytest.skip("Juju too old, need Secrets API v2")
91+
7292
secret = await model.add_secret(name='my-apitoken', data_args=['token=34ae35facd4'])
7393
assert secret.startswith('secret:')
7494

@@ -81,6 +101,10 @@ async def test_grant_secret():
81101
@pytest.mark.bundle
82102
async def test_revoke_secret():
83103
async with base.CleanModel() as model:
104+
assert model._info
105+
if str(model._info.agent_version) < "3.3.0":
106+
pytest.skip("Juju too old, need Secrets API v2")
107+
84108
secret = await model.add_secret(name='my-apitoken', data_args=['token=34ae35facd4'])
85109
assert secret.startswith('secret:')
86110
await model.revoke_secret('my-apitoken', 'ubuntu')

0 commit comments

Comments
 (0)