Skip to content

Commit b2889e0

Browse files
authored
[DPE-2904] Reenable backup tests and revert to reusable workflow (#301)
* Move dashboard legends to the bottom of the graph * Missed test marks
1 parent 3ceaeeb commit b2889e0

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- lint
6161
- unit-test
6262
- build
63-
uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm_self_hosted[email protected]
63+
uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm[email protected]
6464
with:
6565
artifact-name: ${{ needs.build.outputs.artifact-name }}
6666
cloud: lxd

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ exclude_lines = [
9090
minversion = "6.0"
9191
log_cli_level = "INFO"
9292
asyncio_mode = "auto"
93-
markers = ["unstable"]
93+
markers = ["unstable", "juju2", "juju3", "juju_secrets"]
9494

9595
# Formatting tools configuration
9696
[tool.black]

tests/integration/markers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88

99
juju2 = pytest.mark.skipif(juju_major_version != 2, reason="Requires juju 2")
1010
juju3 = pytest.mark.skipif(juju_major_version != 3, reason="Requires juju 3")
11+
juju_secrets = pytest.mark.skipif(juju_major_version < 3, reason="Requires juju secrets")

tests/integration/test_backups.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,13 @@ async def cloud_configs(ops_test: OpsTest, github_secrets) -> None:
7979
bucket_object.delete()
8080

8181

82+
@pytest.mark.group(1)
8283
async def test_none() -> None:
8384
"""Empty test so that the suite will not fail if all tests are skippedi."""
8485
pass
8586

8687

88+
@pytest.mark.group(1)
8789
@pytest.mark.abort_on_fail
8890
async def test_backup(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) -> None:
8991
"""Build and deploy two units of PostgreSQL and then test the backup and restore actions."""
@@ -221,6 +223,7 @@ async def test_backup(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) -> No
221223
await ops_test.model.remove_application(TLS_CERTIFICATES_APP_NAME, block_until_done=True)
222224

223225

226+
@pytest.mark.group(1)
224227
async def test_restore_on_new_cluster(ops_test: OpsTest, github_secrets) -> None:
225228
"""Test that is possible to restore a backup to another PostgreSQL cluster."""
226229
charm = await ops_test.build_charm(".")
@@ -298,6 +301,7 @@ async def test_restore_on_new_cluster(ops_test: OpsTest, github_secrets) -> None
298301
connection.close()
299302

300303

304+
@pytest.mark.group(1)
301305
async def test_invalid_config_and_recovery_after_fixing_it(
302306
ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]
303307
) -> None:

tests/integration/test_password_rotation.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import pytest
88
from pytest_operator.plugin import OpsTest
99

10+
from . import markers
1011
from .helpers import (
1112
CHARM_SERIES,
1213
METADATA,
@@ -80,7 +81,8 @@ async def test_password_rotation(ops_test: OpsTest):
8081
assert check_patroni(ops_test, unit.name, restart_time)
8182

8283

83-
@pytest.mark.juju3
84+
@pytest.mark.group(1)
85+
@markers.juju_secrets
8486
async def test_password_from_secret_same_as_cli(ops_test: OpsTest):
8587
"""Checking if password is same as returned by CLI.
8688
@@ -106,6 +108,7 @@ async def test_password_from_secret_same_as_cli(ops_test: OpsTest):
106108
assert data[secret_id]["content"]["Data"]["replication-password"] == password
107109

108110

111+
@pytest.mark.group(1)
109112
async def test_empty_password(ops_test: OpsTest) -> None:
110113
"""Test that the password can't be set to an empty string."""
111114
leader_unit = await get_leader_unit(ops_test, APP_NAME)
@@ -118,6 +121,7 @@ async def test_empty_password(ops_test: OpsTest) -> None:
118121
assert password == "None"
119122

120123

124+
@pytest.mark.group(1)
121125
async def test_no_password_change_on_invalid_password(ops_test: OpsTest) -> None:
122126
"""Test that in general, there is no change when password validation fails."""
123127
leader_unit = await get_leader_unit(ops_test, APP_NAME)

0 commit comments

Comments
 (0)