Skip to content

Commit d2c925c

Browse files
[DPE-8315] Split integration and release tests (#702)
1 parent a2adc81 commit d2c925c

File tree

114 files changed

+719
-213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+719
-213
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright 2022 Canonical Ltd.
22
# See LICENSE file for licensing details.
3-
name: Tests
3+
name: Pull request
44

55
concurrency:
66
group: ${{ github.workflow }}-${{ github.ref }}
@@ -12,14 +12,6 @@ on:
1212
- '**.md'
1313
- '.github/renovate.json5'
1414
- 'docs/**'
15-
schedule:
16-
- cron: '53 0 * * *' # Daily at 00:53 UTC
17-
# Triggered on push to branch "main" by .github/workflows/release.yaml
18-
workflow_call:
19-
outputs:
20-
artifact-prefix:
21-
description: build_charm.yaml `artifact-prefix` output
22-
value: ${{ jobs.build.outputs.artifact-prefix }}
2315

2416
jobs:
2517
lint:
@@ -76,7 +68,7 @@ jobs:
7668
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
7769

7870
integration-test:
79-
name: Integration test charm
71+
name: Integration tests
8072
needs:
8173
- lint
8274
- unit-test

.github/workflows/integration_test.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Copyright 2025 Canonical Ltd.
2+
# See LICENSE file for licensing details.
3+
name: Integration tests
4+
15
on:
26
workflow_call:
37
inputs:
@@ -31,17 +35,20 @@ jobs:
3135
3236
spread_jobs = (
3337
subprocess.run(
34-
["charmcraft", "test", "--list", "github-ci"], capture_output=True, check=True, text=True
38+
["charmcraft", "test", "--list", "github-ci:tests/spread/integration/"],
39+
capture_output=True,
40+
check=True,
41+
text=True,
3542
)
3643
.stdout.strip()
3744
.split("\n")
3845
)
3946
jobs = []
4047
for job in spread_jobs:
41-
# Example `job`: "github-ci:ubuntu-24.04:tests/spread/test_charm.py:juju36"
48+
# Example `job`: "github-ci:ubuntu-24.04:tests/spread/integration/test_charm.py:juju36"
4249
_, runner, task, variant = job.split(":")
4350
# Example: "test_charm.py"
44-
task = task.removeprefix("tests/spread/")
51+
task = task.removeprefix("tests/spread/integration/")
4552
if runner.endswith("-arm"):
4653
architecture = "arm64"
4754
else:
@@ -62,7 +69,7 @@ jobs:
6269
file.write(output)
6370
- name: Generate Allure default test results
6471
if: ${{ github.event_name == 'schedule' && github.run_attempt == '1' }}
65-
run: tox run -e integration -- tests/integration --allure-default-dir=allure-default-results
72+
run: tox run -e integration -- tests/integration/integration --allure-default-dir=allure-default-results
6673
- name: Upload Allure default results
6774
# Default test results in case the integration tests time out or runner set up fails
6875
# (So that Allure report will show "unknown"/"failed" test result, instead of omitting the test)

.github/workflows/release.yaml

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,46 @@ on:
99
paths-ignore:
1010
- 'docs/**'
1111
- '.github/renovate.json5'
12+
- '.github/workflows/automatic-doc-checks.yml'
13+
- '.github/workflows/ci.yaml'
1214
- '.github/workflows/check_libs.yaml'
15+
- '.github/workflows/check_pr.yaml'
16+
- '.github/workflows/schedule.yaml'
17+
- '.github/workflows/tiobe_scan.yaml'
1318

1419
jobs:
15-
ci-tests:
16-
name: Tests
17-
uses: ./.github/workflows/ci.yaml
20+
build:
21+
name: Build charm
22+
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
23+
24+
integration-tests:
25+
name: Integration tests
26+
needs:
27+
- build
28+
uses: ./.github/workflows/integration_test.yaml
29+
with:
30+
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
31+
secrets: inherit
32+
permissions:
33+
contents: write # Needed for Allure Report
34+
35+
release-tests:
36+
name: Release tests
37+
needs:
38+
- build
39+
uses: ./.github/workflows/release_test.yaml
40+
with:
41+
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
1842
secrets: inherit
1943
permissions:
2044
contents: write # Needed for Allure Report
2145

2246
release-libraries:
2347
name: Release libraries
2448
needs:
25-
- ci-tests
49+
- build
50+
- integration-tests
51+
- release-tests
2652
runs-on: ubuntu-latest
2753
timeout-minutes: 60
2854
steps:
@@ -42,11 +68,13 @@ jobs:
4268
release:
4369
name: Release charm
4470
needs:
45-
- ci-tests
71+
- build
72+
- integration-tests
73+
- release-tests
4674
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
4775
with:
4876
track: '8.0'
49-
artifact-prefix: ${{ needs.ci-tests.outputs.artifact-prefix }}
77+
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
5078
secrets:
5179
charmhub-token: ${{ secrets.CHARMHUB_TOKEN }}
5280
permissions:

0 commit comments

Comments
 (0)