Skip to content

Commit e807101

Browse files
[DPE-6523] Remove AMD64-only test markers (#605)
1 parent 24fea96 commit e807101

File tree

4 files changed

+27
-30
lines changed

4 files changed

+27
-30
lines changed

tests/integration/helpers.py

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -317,29 +317,23 @@ async def app_name(ops_test: OpsTest) -> str:
317317
return None
318318

319319

320-
def cluster_name(unit: Unit, model_name: str) -> str:
321-
"""Returns the MySQL cluster name.
320+
async def get_model_logs(ops_test: OpsTest, log_level: str, log_lines: int = 100) -> str:
321+
"""Return the juju logs from a specific model.
322322
323323
Args:
324-
unit: A unit to get data from
325-
model_name: The current model name
326-
Returns:
327-
The (str) mysql cluster name
328-
"""
329-
output = subprocess.check_output([
330-
"juju",
331-
"show-unit",
332-
unit.name,
333-
"--format=json",
334-
f"--model={model_name}",
335-
])
336-
output = json.loads(output.decode("utf-8"))
337-
338-
for relation in output[unit.name]["relation-info"]:
339-
if relation["endpoint"] == "database-peers":
340-
return relation["application-data"]["cluster-name"]
341-
logger.error(f"Failed to retrieve cluster name from unit {unit.name}")
342-
raise ValueError("Failed to retrieve cluster name")
324+
ops_test: The ops test object passed into every test case
325+
log_level: The logging level to return messages from
326+
log_lines: The maximum lines to return at once
327+
"""
328+
_, output, _ = await ops_test.juju(
329+
"debug-log",
330+
f"--model={ops_test.model.info.name}",
331+
f"--level={log_level}",
332+
f"--lines={log_lines}",
333+
"--no-tail",
334+
)
335+
336+
return output
343337

344338

345339
async def get_process_pid(ops_test: OpsTest, unit_name: str, process: str) -> int:

tests/integration/high_availability/test_upgrade_from_stable.py

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

10-
from .. import juju_, markers
10+
from .. import juju_
1111
from ..helpers import get_leader_unit, get_primary_unit_wrapper, retrieve_database_variable_value
1212
from .high_availability_helpers import (
1313
ensure_all_units_continuous_writes_incrementing,
@@ -23,7 +23,6 @@
2323

2424

2525
@pytest.mark.group(1)
26-
@markers.amd64_only # TODO: remove after arm64 stable release
2726
@pytest.mark.abort_on_fail
2827
async def test_deploy_stable(ops_test: OpsTest) -> None:
2928
"""Simple test to ensure that the mysql and application charms get deployed."""
@@ -55,7 +54,6 @@ async def test_deploy_stable(ops_test: OpsTest) -> None:
5554

5655

5756
@pytest.mark.group(1)
58-
@markers.amd64_only # TODO: remove after arm64 stable release
5957
@pytest.mark.abort_on_fail
6058
async def test_pre_upgrade_check(ops_test: OpsTest) -> None:
6159
"""Test that the pre-upgrade-check action runs successfully."""
@@ -80,7 +78,6 @@ async def test_pre_upgrade_check(ops_test: OpsTest) -> None:
8078

8179

8280
@pytest.mark.group(1)
83-
@markers.amd64_only # TODO: remove after arm64 stable release
8481
async def test_upgrade_from_stable(ops_test: OpsTest):
8582
"""Test updating from stable channel."""
8683
application = ops_test.model.applications[MYSQL_APP_NAME]

tests/integration/high_availability/test_upgrade_rollback_incompat.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
from pytest_operator.plugin import OpsTest
1616

1717
from .. import juju_, markers
18-
from ..helpers import get_leader_unit, get_relation_data, get_unit_by_index
18+
from ..helpers import (
19+
get_leader_unit,
20+
get_model_logs,
21+
get_relation_data,
22+
get_unit_by_index,
23+
)
1924
from .high_availability_helpers import (
2025
ensure_all_units_continuous_writes_incrementing,
2126
relate_mysql_and_application,
@@ -173,6 +178,11 @@ async def test_rollback(ops_test, continuous_writes) -> None:
173178
)
174179
await ops_test.model.wait_for_idle(apps=[MYSQL_APP_NAME], status="active", timeout=TIMEOUT)
175180

181+
logger.info("Ensure rollback has taken place")
182+
message = "Downgrade is incompatible. Resetting workload"
183+
warnings = await get_model_logs(ops_test, log_level="WARNING")
184+
assert message in warnings
185+
176186
logger.info("Ensure continuous_writes after rollback procedure")
177187
await ensure_all_units_continuous_writes_incrementing(ops_test)
178188

tests/integration/high_availability/test_upgrade_skip_pre_upgrade_check.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import pytest
1010
from pytest_operator.plugin import OpsTest
1111

12-
from .. import markers
1312
from .high_availability_helpers import (
1413
ensure_all_units_continuous_writes_incrementing,
1514
relate_mysql_and_application,
@@ -24,7 +23,6 @@
2423

2524

2625
@pytest.mark.group(1)
27-
@markers.amd64_only # TODO: remove after arm64 stable release
2826
@pytest.mark.abort_on_fail
2927
async def test_deploy_stable(ops_test: OpsTest) -> None:
3028
"""Simple test to ensure that the mysql and application charms get deployed."""
@@ -57,7 +55,6 @@ async def test_deploy_stable(ops_test: OpsTest) -> None:
5755

5856

5957
@pytest.mark.group(1)
60-
@markers.amd64_only # TODO: remove after arm64 stable release
6158
async def test_refresh_without_pre_upgrade_check(ops_test: OpsTest):
6259
"""Test updating from stable channel."""
6360
application = ops_test.model.applications[MYSQL_APP_NAME]
@@ -90,7 +87,6 @@ async def test_refresh_without_pre_upgrade_check(ops_test: OpsTest):
9087

9188

9289
@pytest.mark.group(1)
93-
@markers.amd64_only # TODO: remove after arm64 stable release
9490
async def test_rollback_without_pre_upgrade_check(ops_test: OpsTest):
9591
"""Test refresh back to stable channel."""
9692
application = ops_test.model.applications[MYSQL_APP_NAME]

0 commit comments

Comments
 (0)