diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 81f869c3ae..bfcf6008fb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -60,7 +60,7 @@ jobs: - lint - unit-test - build - uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm_self_hosted.yaml@v6.3.2 + uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v6.3.2 with: artifact-name: ${{ needs.build.outputs.artifact-name }} cloud: lxd diff --git a/pyproject.toml b/pyproject.toml index 71d88759b4..3540311670 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,7 +90,7 @@ exclude_lines = [ minversion = "6.0" log_cli_level = "INFO" asyncio_mode = "auto" -markers = ["unstable"] +markers = ["unstable", "juju2", "juju3", "juju_secrets"] # Formatting tools configuration [tool.black] diff --git a/tests/integration/markers.py b/tests/integration/markers.py index 834cfac03e..6dc2d6949f 100644 --- a/tests/integration/markers.py +++ b/tests/integration/markers.py @@ -8,3 +8,4 @@ juju2 = pytest.mark.skipif(juju_major_version != 2, reason="Requires juju 2") juju3 = pytest.mark.skipif(juju_major_version != 3, reason="Requires juju 3") +juju_secrets = pytest.mark.skipif(juju_major_version < 3, reason="Requires juju secrets") diff --git a/tests/integration/test_backups.py b/tests/integration/test_backups.py index 254ceabcb4..75a9f4c343 100644 --- a/tests/integration/test_backups.py +++ b/tests/integration/test_backups.py @@ -79,11 +79,13 @@ async def cloud_configs(ops_test: OpsTest, github_secrets) -> None: bucket_object.delete() +@pytest.mark.group(1) async def test_none() -> None: """Empty test so that the suite will not fail if all tests are skippedi.""" pass +@pytest.mark.group(1) @pytest.mark.abort_on_fail async def test_backup(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) -> None: """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 await ops_test.model.remove_application(TLS_CERTIFICATES_APP_NAME, block_until_done=True) +@pytest.mark.group(1) async def test_restore_on_new_cluster(ops_test: OpsTest, github_secrets) -> None: """Test that is possible to restore a backup to another PostgreSQL cluster.""" charm = await ops_test.build_charm(".") @@ -298,6 +301,7 @@ async def test_restore_on_new_cluster(ops_test: OpsTest, github_secrets) -> None connection.close() +@pytest.mark.group(1) async def test_invalid_config_and_recovery_after_fixing_it( ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict] ) -> None: diff --git a/tests/integration/test_password_rotation.py b/tests/integration/test_password_rotation.py index 7690390e14..c05b3ddaf0 100644 --- a/tests/integration/test_password_rotation.py +++ b/tests/integration/test_password_rotation.py @@ -7,6 +7,7 @@ import pytest from pytest_operator.plugin import OpsTest +from . import markers from .helpers import ( CHARM_SERIES, METADATA, @@ -80,7 +81,8 @@ async def test_password_rotation(ops_test: OpsTest): assert check_patroni(ops_test, unit.name, restart_time) -@pytest.mark.juju3 +@pytest.mark.group(1) +@markers.juju_secrets async def test_password_from_secret_same_as_cli(ops_test: OpsTest): """Checking if password is same as returned by CLI. @@ -106,6 +108,7 @@ async def test_password_from_secret_same_as_cli(ops_test: OpsTest): assert data[secret_id]["content"]["Data"]["replication-password"] == password +@pytest.mark.group(1) async def test_empty_password(ops_test: OpsTest) -> None: """Test that the password can't be set to an empty string.""" leader_unit = await get_leader_unit(ops_test, APP_NAME) @@ -118,6 +121,7 @@ async def test_empty_password(ops_test: OpsTest) -> None: assert password == "None" +@pytest.mark.group(1) async def test_no_password_change_on_invalid_password(ops_test: OpsTest) -> None: """Test that in general, there is no change when password validation fails.""" leader_unit = await get_leader_unit(ops_test, APP_NAME)