Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 1 addition & 0 deletions tests/integration/markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
4 changes: 4 additions & 0 deletions tests/integration/test_backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -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(".")
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 5 additions & 1 deletion tests/integration/test_password_rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import pytest
from pytest_operator.plugin import OpsTest

from . import markers
from .helpers import (
CHARM_SERIES,
METADATA,
Expand Down Expand Up @@ -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.

Expand All @@ -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)
Expand All @@ -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)
Expand Down