Skip to content

Commit b247247

Browse files
[DPE-6523] Remove AMD64-only test markers (#576)
1 parent 1301de0 commit b247247

File tree

4 files changed

+26
-14
lines changed

4 files changed

+26
-14
lines changed

tests/integration/helpers.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,25 @@ def is_connection_possible(credentials: Dict, **extra_opts) -> bool:
365365
return False
366366

367367

368+
async def get_model_logs(ops_test: OpsTest, log_level: str, log_lines: int = 100) -> str:
369+
"""Return the juju logs from a specific model.
370+
371+
Args:
372+
ops_test: The ops test object passed into every test case
373+
log_level: The logging level to return messages from
374+
log_lines: The maximum lines to return at once
375+
"""
376+
_, output, _ = await ops_test.juju(
377+
"debug-log",
378+
f"--model={ops_test.model.info.name}",
379+
f"--level={log_level}",
380+
f"--lines={log_lines}",
381+
"--no-tail",
382+
)
383+
384+
return output
385+
386+
368387
async def get_process_pid(
369388
ops_test: OpsTest, unit_name: str, container_name: str, process: str, full_match: bool = False
370389
) -> Optional[int]:

tests/integration/high_availability/test_async_replication.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ async def second_model(ops_test: OpsTest, first_model, request) -> Model: # pyr
7070

7171
@pytest.mark.group(1)
7272
@markers.juju3
73-
@markers.amd64_only # TODO: remove after mysql-router-k8s arm64 stable release
7473
@pytest.mark.abort_on_fail
7574
async def test_build_and_deploy(
7675
ops_test: OpsTest, first_model: Model, second_model: Model
@@ -122,7 +121,6 @@ async def test_build_and_deploy(
122121

123122
@pytest.mark.group(1)
124123
@markers.juju3
125-
@markers.amd64_only # TODO: remove after mysql-router-k8s arm64 stable release
126124
@pytest.mark.abort_on_fail
127125
async def test_async_relate(ops_test: OpsTest, first_model: Model, second_model: Model) -> None:
128126
"""Relate the two mysql clusters."""
@@ -160,7 +158,6 @@ async def test_async_relate(ops_test: OpsTest, first_model: Model, second_model:
160158

161159
@pytest.mark.group(1)
162160
@markers.juju3
163-
@markers.amd64_only # TODO: remove after mysql-router-k8s arm64 stable release
164161
@pytest.mark.abort_on_fail
165162
async def test_create_replication(first_model: Model, second_model: Model) -> None:
166163
"""Run the create replication and wait for the applications to settle."""
@@ -191,7 +188,6 @@ async def test_create_replication(first_model: Model, second_model: Model) -> No
191188

192189
@pytest.mark.group(1)
193190
@markers.juju3
194-
@markers.amd64_only # TODO: remove after mysql-router-k8s arm64 stable release
195191
@pytest.mark.abort_on_fail
196192
async def test_deploy_router_and_app(first_model: Model) -> None:
197193
"""Deploy the router and the test application."""
@@ -229,7 +225,6 @@ async def test_deploy_router_and_app(first_model: Model) -> None:
229225

230226
@pytest.mark.group(1)
231227
@markers.juju3
232-
@markers.amd64_only # TODO: remove after mysql-router-k8s arm64 stable release
233228
@pytest.mark.abort_on_fail
234229
async def test_data_replication(
235230
first_model: Model, second_model: Model, continuous_writes
@@ -243,7 +238,6 @@ async def test_data_replication(
243238

244239
@pytest.mark.group(1)
245240
@markers.juju3
246-
@markers.amd64_only # TODO: remove after mysql-router-k8s arm64 stable release
247241
@pytest.mark.abort_on_fail
248242
async def test_standby_promotion(
249243
ops_test: OpsTest, first_model: Model, second_model: Model, continuous_writes
@@ -272,7 +266,6 @@ async def test_standby_promotion(
272266

273267
@pytest.mark.group(1)
274268
@markers.juju3
275-
@markers.amd64_only # TODO: remove after mysql-router-k8s arm64 stable release
276269
@pytest.mark.abort_on_fail
277270
async def test_failover(ops_test: OpsTest, first_model: Model, second_model: Model) -> None:
278271
"""Test switchover on primary cluster fail."""
@@ -311,7 +304,6 @@ async def test_failover(ops_test: OpsTest, first_model: Model, second_model: Mod
311304

312305
@pytest.mark.group(1)
313306
@markers.juju3
314-
@markers.amd64_only # TODO: remove after mysql-router-k8s arm64 stable release
315307
@pytest.mark.abort_on_fail
316308
async def test_rejoin_invalidated_cluster(
317309
first_model: Model, second_model: Model, continuous_writes
@@ -332,7 +324,6 @@ async def test_rejoin_invalidated_cluster(
332324

333325
@pytest.mark.group(1)
334326
@markers.juju3
335-
@markers.amd64_only # TODO: remove after mysql-router-k8s arm64 stable release
336327
@pytest.mark.abort_on_fail
337328
async def test_remove_relation_and_relate(
338329
first_model: Model, second_model: Model, continuous_writes

tests/integration/high_availability/test_upgrade_from_stable.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import pytest
99
from pytest_operator.plugin import OpsTest
1010

11-
from .. import juju_, markers
11+
from .. import juju_
1212
from ..helpers import (
1313
get_leader_unit,
1414
get_primary_unit,
@@ -31,7 +31,6 @@
3131

3232

3333
@pytest.mark.group(1)
34-
@markers.amd64_only # TODO: remove after arm64 stable release
3534
@pytest.mark.abort_on_fail
3635
async def test_deploy_stable(ops_test: OpsTest) -> None:
3736
"""Simple test to ensure that the mysql and application charms get deployed."""
@@ -65,7 +64,6 @@ async def test_deploy_stable(ops_test: OpsTest) -> None:
6564

6665

6766
@pytest.mark.group(1)
68-
@markers.amd64_only # TODO: remove after arm64 stable release
6967
@pytest.mark.abort_on_fail
7068
async def test_pre_upgrade_check(ops_test: OpsTest) -> None:
7169
"""Test that the pre-upgrade-check action runs successfully."""
@@ -92,7 +90,6 @@ async def test_pre_upgrade_check(ops_test: OpsTest) -> None:
9290

9391

9492
@pytest.mark.group(1)
95-
@markers.amd64_only # TODO: remove after arm64 stable release
9693
@pytest.mark.abort_on_fail
9794
async def test_upgrade_from_stable(ops_test: OpsTest, credentials):
9895
"""Test updating from stable channel."""

tests/integration/high_availability/test_upgrade_rollback_incompat.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from pytest_operator.plugin import OpsTest
1515

1616
from .. import juju_, markers
17-
from ..helpers import get_leader_unit, get_unit_by_index
17+
from ..helpers import get_leader_unit, get_model_logs, get_unit_by_index
1818
from .high_availability_helpers import get_sts_partition
1919

2020
logger = logging.getLogger(__name__)
@@ -152,6 +152,11 @@ async def test_rollback(ops_test) -> None:
152152
wait_period=5,
153153
)
154154

155+
logger.info("Ensure rollback has taken place")
156+
message = "Downgrade is incompatible. Resetting workload"
157+
warnings = await get_model_logs(ops_test, log_level="WARNING")
158+
assert message in warnings
159+
155160
logger.info("Resume upgrade")
156161
while get_sts_partition(ops_test, MYSQL_APP_NAME) == 2:
157162
# resume action sometime fails in CI, no clear reason

0 commit comments

Comments
 (0)