Skip to content

Commit 7575700

Browse files
Add s390x integration tests
1 parent 82a0ffd commit 7575700

File tree

4 files changed

+41
-2
lines changed

4 files changed

+41
-2
lines changed

.github/workflows/integration_test.yaml

Lines changed: 3 additions & 1 deletion
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"

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)