Skip to content

Commit 717a5d1

Browse files
Add s390x integration tests
1 parent 82a0ffd commit 717a5d1

File tree

4 files changed

+47
-3
lines changed

4 files changed

+47
-3
lines changed

.github/workflows/integration_test.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ jobs:
4242
_, runner, task, variant = job.split(":")
4343
# Example: "test_charm.py"
4444
task = task.removeprefix("tests/spread/")
45-
if runner.endswith("-arm"):
45+
if "s390x" in runner:
46+
architecture = "s390x"
47+
elif runner.endswith("-arm"):
4648
architecture = "arm64"
4749
else:
4850
architecture = "amd64"
@@ -86,15 +88,20 @@ jobs:
8688
runs-on: ${{ matrix.job.runner }}
8789
timeout-minutes: 217 # Sum of steps `timeout-minutes` + 5
8890
steps:
89-
- name: Free up disk space
91+
- name: (GitHub hosted) Free up disk space
9092
timeout-minutes: 1
93+
if: ${{ !contains(matrix.job.runner, 'self-hosted') }}
9194
run: |
9295
printf '\nDisk usage before cleanup\n'
9396
df --human-readable
9497
# Based on https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
9598
rm -r /opt/hostedtoolcache/
9699
printf '\nDisk usage after cleanup\n'
97100
df --human-readable
101+
- name: (IS hosted) Disk usage
102+
timeout-minutes: 1
103+
if: ${{ contains(matrix.job.runner, 'self-hosted') }}
104+
run: df --human-readable
98105
- name: Checkout
99106
timeout-minutes: 3
100107
uses: actions/checkout@v4

spread.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ backends:
9797
username: runner
9898
variants:
9999
- -juju29_ubuntu22
100+
- self-hosted-linux-s390x-noble-edge:
101+
username: runner
102+
variants:
103+
- -juju29_ubuntu22
100104

101105
suites:
102106
tests/spread/:

tests/integration/markers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@
1111
arm64_only = pytest.mark.skipif(
1212
architecture.architecture != "arm64", reason="Requires arm64 architecture"
1313
)
14+
s390x_only = pytest.mark.skipif(
15+
architecture.architecture != "s390x", reason="Requires s390x architecture"
16+
)

tests/integration/test_architecture.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,34 @@ async def test_amd_charm_on_arm_host(ops_test: OpsTest, charm, series) -> None:
8181
)
8282

8383

84-
# TODO: add s390x test
84+
@markers.s390x_only
85+
async def test_amd_charm_on_s390x_host(ops_test: OpsTest, charm, series) -> None:
86+
"""Tries deploying an amd64 charm on s390x host."""
87+
charm = charm.replace("s390x", "amd64")
88+
89+
await asyncio.gather(
90+
ops_test.model.deploy(
91+
charm,
92+
application_name=MYSQL_ROUTER_APP_NAME,
93+
num_units=0,
94+
series=series,
95+
),
96+
ops_test.model.deploy(
97+
MYSQL_TEST_APP_NAME,
98+
application_name=MYSQL_TEST_APP_NAME,
99+
num_units=1,
100+
channel="latest/edge",
101+
series=series,
102+
),
103+
)
104+
105+
await ops_test.model.relate(
106+
f"{MYSQL_ROUTER_APP_NAME}:database",
107+
f"{MYSQL_TEST_APP_NAME}:database",
108+
)
109+
110+
await ops_test.model.wait_for_idle(
111+
apps=[MYSQL_ROUTER_APP_NAME],
112+
status="error",
113+
raise_on_error=False,
114+
)

0 commit comments

Comments
 (0)