Skip to content

Commit 1d35a66

Browse files
Run integration tests on arm64 (#464)
1 parent ce40968 commit 1d35a66

File tree

13 files changed

+86
-52
lines changed

13 files changed

+86
-52
lines changed

.github/workflows/ci.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ on:
2222
jobs:
2323
lint:
2424
name: Lint
25-
uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v13.1.2
25+
uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v13.2.0
2626

2727
unit-test:
2828
name: Unit test charm
@@ -42,7 +42,7 @@ jobs:
4242

4343
build:
4444
name: Build charm
45-
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v13.1.2
45+
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v13.2.0
4646
with:
4747
cache: true
4848

@@ -53,21 +53,25 @@ jobs:
5353
juju:
5454
- agent: 2.9.49 # renovate: latest juju 2
5555
libjuju: ==2.9.49.0 # renovate: latest libjuju 2
56-
allure: false
56+
allure_on_amd64: false
5757
- agent: 3.1.8 # renovate: latest juju 3
58-
allure: true
59-
name: Integration test charm | ${{ matrix.juju.agent }}
58+
allure_on_amd64: true
59+
architecture:
60+
- amd64
61+
- arm64
62+
name: Integration test charm | ${{ matrix.juju.agent }} | ${{ matrix.architecture }}
6063
needs:
6164
- lint
6265
- unit-test
6366
- build
64-
uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v13.1.2
67+
uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v13.2.0
6568
with:
6669
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
70+
architecture: ${{ matrix.architecture }}
6771
cloud: lxd
6872
juju-agent-version: ${{ matrix.juju.agent }}
6973
libjuju-version-constraint: ${{ matrix.juju.libjuju }}
70-
_beta_allure_report: ${{ matrix.juju.allure }}
74+
_beta_allure_report: ${{ matrix.juju.allure_on_amd64 && matrix.architecture == 'amd64' }}
7175
secrets:
7276
integration-test: |
7377
{

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ jobs:
2424

2525
build:
2626
name: Build charm
27-
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v13.1.2
27+
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v13.2.0
2828

2929
release:
3030
name: Release charm
3131
needs:
3232
- ci-tests
3333
- build
34-
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v13.1.2
34+
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v13.2.0
3535
with:
3636
channel: 14/edge
3737
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}

.github/workflows/sync_issue_to_jira.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
sync:
1111
name: Sync GitHub issue to Jira
12-
uses: canonical/data-platform-workflows/.github/workflows/sync_issue_to_jira.yaml@v13.1.2
12+
uses: canonical/data-platform-workflows/.github/workflows/sync_issue_to_jira.yaml@v13.2.0
1313
with:
1414
jira-base-url: https://warthogs.atlassian.net
1515
jira-project-key: DPE

poetry.lock

Lines changed: 7 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ optional = true
6666

6767
[tool.poetry.group.integration.dependencies]
6868
pytest = "^8.2.0"
69-
pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v13.1.2", subdirectory = "python/pytest_plugins/github_secrets"}
69+
pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v13.2.0", subdirectory = "python/pytest_plugins/github_secrets"}
7070
pytest-operator = "^0.35.0"
71-
pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v13.1.2", subdirectory = "python/pytest_plugins/pytest_operator_cache"}
72-
pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v13.1.2", subdirectory = "python/pytest_plugins/pytest_operator_groups"}
71+
pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v13.2.0", subdirectory = "python/pytest_plugins/pytest_operator_cache"}
72+
pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v13.2.0", subdirectory = "python/pytest_plugins/pytest_operator_groups"}
7373
# renovate caret doesn't work: https://github.com/renovatebot/renovate/issues/26940
7474
juju = "<=3.4.0.0"
7575
boto3 = "*"

tests/integration/architecture.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright 2024 Canonical Ltd.
2+
# See LICENSE file for licensing details.
3+
import subprocess
4+
5+
architecture = subprocess.run(
6+
["dpkg", "--print-architecture"], capture_output=True, check=True, encoding="utf-8"
7+
).stdout.strip()

tests/integration/ha_tests/test_async_replication.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# See LICENSE file for licensing details.
44
import contextlib
55
import logging
6+
import subprocess
67
from asyncio import gather
78
from typing import Optional
89

@@ -12,7 +13,7 @@
1213
from pytest_operator.plugin import OpsTest
1314
from tenacity import Retrying, stop_after_delay, wait_fixed
1415

15-
from .. import markers
16+
from .. import architecture, markers
1617
from ..helpers import (
1718
APPLICATION_NAME,
1819
DATABASE_APP_NAME,
@@ -70,6 +71,10 @@ async def second_model(ops_test: OpsTest, first_model, request) -> Model:
7071
second_model_name = f"{first_model.info.name}-other"
7172
if second_model_name not in await ops_test._controller.list_models():
7273
await ops_test._controller.add_model(second_model_name)
74+
subprocess.run(["juju", "switch", second_model_name], check=True)
75+
subprocess.run(
76+
["juju", "set-model-constraints", f"arch={architecture.architecture}"], check=True
77+
)
7378
second_model = Model()
7479
await second_model.connect(model_name=second_model_name)
7580
yield second_model

tests/integration/ha_tests/test_upgrade_from_stable.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import pytest
77
from pytest_operator.plugin import OpsTest
88

9+
from .. import markers
910
from ..helpers import (
1011
APPLICATION_NAME,
1112
DATABASE_APP_NAME,
@@ -26,6 +27,7 @@
2627

2728

2829
@pytest.mark.group(1)
30+
@markers.amd64_only # TODO: remove after arm64 stable release
2931
@pytest.mark.abort_on_fail
3032
async def test_deploy_stable(ops_test: OpsTest) -> None:
3133
"""Simple test to ensure that the PostgreSQL and application charms get deployed."""
@@ -77,6 +79,7 @@ async def test_deploy_stable(ops_test: OpsTest) -> None:
7779

7880

7981
@pytest.mark.group(1)
82+
@markers.amd64_only # TODO: remove after arm64 stable release
8083
@pytest.mark.abort_on_fail
8184
async def test_pre_upgrade_check(ops_test: OpsTest) -> None:
8285
"""Test that the pre-upgrade-check action runs successfully."""
@@ -95,6 +98,7 @@ async def test_pre_upgrade_check(ops_test: OpsTest) -> None:
9598

9699

97100
@pytest.mark.group(1)
101+
@markers.amd64_only # TODO: remove after arm64 stable release
98102
@pytest.mark.abort_on_fail
99103
async def test_upgrade_from_stable(ops_test: OpsTest):
100104
"""Test updating from stable channel."""

tests/integration/markers.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@
44

55
import pytest
66

7+
from . import architecture
78
from .juju_ import juju_major_version
89

910
juju2 = pytest.mark.skipif(juju_major_version != 2, reason="Requires juju 2")
1011
juju3 = pytest.mark.skipif(juju_major_version != 3, reason="Requires juju 3")
1112
juju_secrets = pytest.mark.skipif(juju_major_version < 3, reason="Requires juju secrets")
13+
amd64_only = pytest.mark.skipif(
14+
architecture.architecture != "amd64", reason="Requires amd64 architecture"
15+
)
16+
arm64_only = pytest.mark.skipif(
17+
architecture.architecture != "arm64", reason="Requires arm64 architecture"
18+
)

tests/integration/new_relations/test_new_relations.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import yaml
1313
from pytest_operator.plugin import OpsTest
1414

15+
from .. import markers
1516
from ..helpers import CHARM_SERIES, assert_sync_standbys, get_leader_unit, scale_application
1617
from ..juju_ import juju_major_version
1718
from .helpers import (
@@ -583,6 +584,7 @@ async def test_invalid_extra_user_roles(ops_test: OpsTest):
583584

584585

585586
@pytest.mark.group(1)
587+
@markers.amd64_only # nextcloud charm not available for arm64
586588
async def test_nextcloud_db_blocked(ops_test: OpsTest, charm: str) -> None:
587589
async with ops_test.fast_forward():
588590
# Deploy Nextcloud.

0 commit comments

Comments
 (0)