Skip to content

Commit

Permalink
[DPE-4976] Add workflow for nightly scheduled tests with juju 3.6 (#502)
Browse files Browse the repository at this point in the history
* Add workflow for nightly scheduled tests with juju 3.6

* For testing purposes, only run 3.6 tests on amd64

* Only run 3.6 tests on PR + specify juju channel

* Explicitly specify base for mysql-test-app + charmcraft prime files with consistent approach

* Explicitly use base instead of series, and hardcode base as [email protected]

* Explicitly specify base for subordinate charms as well

* Enable juju 3.4.3 testing on PRs and only run 3.6 tests on nightly schedule

* Run juju 3.6 tests on arm64 + amd64; run them on PR to confirm pass

* Avoid running juju 3.6 tests on PRs

* Add juju 3.6 in CI matrix and dpw will run it nightly only

* Address PR feedback

* Use dpw v21.0.0

* Remove duplicate entry + add entry for running tests on 3.6 on arm64

* Remove pin of lxd-snap-channel to always use the latest lxd channel

* Upgrade all dpw dependencies to v21.0.0
  • Loading branch information
shayancanonical authored Aug 29, 2024
1 parent 25a8a79 commit a33f413
Show file tree
Hide file tree
Showing 19 changed files with 66 additions and 44 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,26 +70,32 @@ jobs:
allure_on_amd64: false
- agent: 3.4.4 # renovate: juju-agent-pin-minor
allure_on_amd64: true
- snap_channel: 3.6/beta
allure_on_amd64: false
architecture:
- amd64
include:
- juju:
agent: 3.4.4 # renovate: juju-agent-pin-minor
allure_on_amd64: true
architecture: arm64
name: Integration | ${{ matrix.juju.agent }} | ${{ matrix.architecture }}
- juju:
snap_channel: 3.6/beta
allure_on_amd64: false
architecture: arm64
name: Integration | ${{ matrix.juju.agent || matrix.juju.snap_channel }} | ${{ matrix.architecture }}
needs:
- lint
- unit-test
- build
uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v20.0.2
uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v21.0.0
with:
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
architecture: ${{ matrix.architecture }}
cloud: lxd
juju-agent-version: ${{ matrix.juju.agent }}
juju-snap-channel: ${{ matrix.juju.snap_channel }}
libjuju-version-constraint: ${{ matrix.juju.libjuju }}
lxd-snap-channel: 5.21/stable
_beta_allure_report: ${{ matrix.juju.allure_on_amd64 && matrix.architecture == 'amd64' }}
secrets:
# GitHub appears to redact each line of a multi-line secret
Expand Down
7 changes: 5 additions & 2 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ bases:
channel: "22.04"
architectures: [arm64]
parts:
files:
plugin: dump
source: .
prime:
- snap_revisions.json
charm:
override-pull: |
craftctl default
Expand All @@ -19,8 +24,6 @@ parts:
exit 1
fi
charm-strict-dependencies: true
prime:
- snap_revisions.json
build-packages:
- libffi-dev
- libssl-dev
Expand Down
32 changes: 16 additions & 16 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ parameterized = "^0.9.0"

[tool.poetry.group.integration.dependencies]
pytest = "^7.4.0"
pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v20.0.2", subdirectory = "python/pytest_plugins/github_secrets"}
pytest-microceph = {git = "https://github.com/canonical/data-platform-workflows", tag = "v20.0.2", subdirectory = "python/pytest_plugins/microceph"}
pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v21.0.0", subdirectory = "python/pytest_plugins/github_secrets"}
pytest-microceph = {git = "https://github.com/canonical/data-platform-workflows", tag = "v21.0.0", subdirectory = "python/pytest_plugins/microceph"}
pytest-operator = "^0.28.0"
pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v20.0.2", subdirectory = "python/pytest_plugins/pytest_operator_cache"}
pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v20.0.2", subdirectory = "python/pytest_plugins/pytest_operator_groups"}
juju = "^3.2.2"
pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v21.0.0", subdirectory = "python/pytest_plugins/pytest_operator_cache"}
pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v21.0.0", subdirectory = "python/pytest_plugins/pytest_operator_groups"}
juju = "^3.5.2.0"
mysql-connector-python = "~8.0.33"
tenacity = "^8.2.2"
boto3 = "^1.28.11"
pyyaml = "^6.0"
urllib3 = "^1.26.16"
allure-pytest = "^2.13.2"
allure-pytest-collection-report = {git = "https://github.com/canonical/data-platform-workflows", tag = "v20.0.2", subdirectory = "python/pytest_plugins/allure_pytest_collection_report"}
allure-pytest-collection-report = {git = "https://github.com/canonical/data-platform-workflows", tag = "v21.0.0", subdirectory = "python/pytest_plugins/allure_pytest_collection_report"}


[tool.coverage.run]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ async def deploy_and_scale_mysql(
application_name=mysql_application_name,
config=config,
num_units=num_units,
series="jammy",
base="[email protected]",
)

await ops_test.model.wait_for_idle(
Expand Down Expand Up @@ -177,6 +177,7 @@ async def deploy_and_scale_application(ops_test: OpsTest) -> str:
application_name=APPLICATION_DEFAULT_APP_NAME,
num_units=1,
channel="latest/edge",
base="[email protected]",
)

await ops_test.model.wait_for_idle(
Expand Down
6 changes: 4 additions & 2 deletions tests/integration/high_availability/test_async_replication.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,15 @@ async def test_build_and_deploy(
application_name=MYSQL_APP1,
num_units=3,
config=config,
base="[email protected]",
)
config["cluster-name"] = "cuzco"
await second_model.deploy(
charm,
application_name=MYSQL_APP2,
num_units=3,
config=config,
base="[email protected]",
)

logger.info("Waiting for the applications to settle")
Expand Down Expand Up @@ -175,15 +177,15 @@ async def test_deploy_router_and_app(first_model: Model) -> None:
await first_model.deploy(
MYSQL_ROUTER_APP_NAME,
application_name=MYSQL_ROUTER_APP_NAME,
series="jammy",
base="[email protected]",
channel="dpe/edge",
num_units=1,
trust=True,
)
await first_model.deploy(
APPLICATION_APP_NAME,
application_name=APPLICATION_APP_NAME,
series="jammy",
base="[email protected]",
channel="latest/edge",
num_units=1,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/high_availability/test_replication.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ async def test_cluster_isolation(ops_test: OpsTest, highly_available_cluster) ->
charm,
application_name=ANOTHER_APP_NAME,
num_units=1,
series="jammy",
base="[email protected]",
)
async with ops_test.fast_forward("60s"):
await ops_test.model.block_until(
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/high_availability/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ async def test_deploy_latest(ops_test: OpsTest) -> None:
num_units=3,
channel="8.0/edge",
config={"profile": "testing"},
series="jammy",
base="[email protected]",
),
ops_test.model.deploy(
TEST_APP_NAME,
application_name=TEST_APP_NAME,
num_units=1,
channel="latest/edge",
base="[email protected]",
),
)
await relate_mysql_and_application(ops_test, MYSQL_APP_NAME, TEST_APP_NAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ async def test_deploy_stable(ops_test: OpsTest) -> None:
application_name=MYSQL_APP_NAME,
num_units=3,
channel="8.0/stable",
series="jammy",
base="[email protected]",
config={"profile": "testing"},
),
ops_test.model.deploy(
TEST_APP_NAME,
application_name=TEST_APP_NAME,
num_units=1,
channel="latest/edge",
base="[email protected]",
),
)
await relate_mysql_and_application(ops_test, MYSQL_APP_NAME, TEST_APP_NAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None:
charm,
application_name=MYSQL_APP_NAME,
num_units=3,
series="jammy",
base="[email protected]",
config={"profile": "testing", "plugin-audit-enabled": "false"},
)

Expand All @@ -62,6 +62,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None:
application_name=TEST_APP,
channel="latest/edge",
num_units=1,
base="[email protected]",
)

await relate_mysql_and_application(ops_test, MYSQL_APP_NAME, TEST_APP)
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/relations/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None:
application_name=DATABASE_APP_NAME,
config=config,
num_units=3,
series="jammy",
base="[email protected]",
),
ops_test.model.deploy(
APPLICATION_APP_NAME,
application_name=APPLICATION_APP_NAME,
num_units=2,
channel="latest/edge",
base="[email protected]",
),
)

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/relations/test_db_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ async def test_keystone_bundle_db_router(ops_test: OpsTest) -> None:
config = {"cluster-name": CLUSTER_NAME, "profile": "testing"}

mysql_app = await ops_test.model.deploy(
charm, application_name=APP_NAME, config=config, num_units=1, series="jammy"
charm, application_name=APP_NAME, config=config, num_units=1, base="[email protected]"
)

# Deploy keystone
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/relations/test_relation_mysql_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None:
application_name=DATABASE_APP_NAME,
config=config,
num_units=3,
series="jammy",
base="[email protected]",
),
ops_test.model.deploy(
APPLICATION_APP_NAME,
application_name=APPLICATION_APP_NAME,
num_units=1,
channel="latest/edge",
base="[email protected]",
),
)

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/relations/test_shared_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ async def test_keystone_bundle_shared_db(ops_test: OpsTest) -> None:
application_name=APP_NAME,
config=config,
num_units=3,
series="jammy",
base="[email protected]",
)

# Reduce the update_status frequency for the duration of the test
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_backup_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None:

logger.info("Deploying s3 integrator")

await ops_test.model.deploy(S3_INTEGRATOR, channel=S3_INTEGRATOR_CHANNEL)
await ops_test.model.deploy(S3_INTEGRATOR, channel=S3_INTEGRATOR_CHANNEL, base="[email protected]")
await ops_test.model.relate(mysql_application_name, S3_INTEGRATOR)

await ops_test.model.wait_for_idle(
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_backup_ceph.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None:

logger.info("Deploying s3 integrator")

await ops_test.model.deploy(S3_INTEGRATOR, channel=S3_INTEGRATOR_CHANNEL)
await ops_test.model.deploy(S3_INTEGRATOR, channel=S3_INTEGRATOR_CHANNEL, base="[email protected]")
await ops_test.model.relate(mysql_application_name, S3_INTEGRATOR)

await ops_test.model.wait_for_idle(
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_backup_gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None:

logger.info("Deploying s3 integrator")

await ops_test.model.deploy(S3_INTEGRATOR, channel=S3_INTEGRATOR_CHANNEL)
await ops_test.model.deploy(S3_INTEGRATOR, channel=S3_INTEGRATOR_CHANNEL, base="[email protected]")
await ops_test.model.relate(mysql_application_name, S3_INTEGRATOR)

await ops_test.model.wait_for_idle(
Expand Down
5 changes: 4 additions & 1 deletion tests/integration/test_subordinate_charms.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,20 @@ async def test_ubuntu_pro(ops_test, github_secrets):
db_charm,
application_name=DATABASE_APP_NAME,
config={"cluster-name": CLUSTER_NAME, "profile": "testing"},
series="jammy",
base="[email protected]",
),
ops_test.model.deploy(
APPLICATION_APP_NAME,
application_name=APPLICATION_APP_NAME,
channel="latest/edge",
base="[email protected]",
),
ops_test.model.deploy(
UBUNTU_PRO_APP_NAME,
application_name=UBUNTU_PRO_APP_NAME,
channel="latest/edge",
config={"token": github_secrets["UBUNTU_PRO_TOKEN"]},
base="[email protected]",
),
)
await ops_test.model.relate(
Expand All @@ -59,6 +61,7 @@ async def test_landscape_client(ops_test, github_secrets):
"registration-key": github_secrets["LANDSCAPE_REGISTRATION_KEY"],
"ppa": "ppa:landscape/self-hosted-beta",
},
base="[email protected]",
)
await ops_test.model.relate(DATABASE_APP_NAME, LANDSCAPE_CLIENT_APP_NAME)
async with ops_test.fast_forward("60s"):
Expand Down
Loading

0 comments on commit a33f413

Please sign in to comment.