Skip to content

Commit

Permalink
Use charm fixture instead of building it on the fly
Browse files Browse the repository at this point in the history
  • Loading branch information
dragomirp committed Apr 5, 2024
1 parent 91c1f21 commit a6dfc0c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tests/integration/test_backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,8 @@ async def cloud_configs(ops_test: OpsTest, github_secrets) -> None:

@pytest.mark.group(1)
@pytest.mark.abort_on_fail
async def test_backup(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) -> None:
async def test_backup(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict], charm) -> None:
"""Build and deploy two units of PostgreSQL and then test the backup and restore actions."""
# Build the PostgreSQL charm.
charm = await ops_test.build_charm(".")

# Deploy S3 Integrator and TLS Certificates Operator.
await ops_test.model.deploy(S3_INTEGRATOR_APP_NAME)
await ops_test.model.deploy(TLS_CERTIFICATES_APP_NAME, config=TLS_CONFIG, channel=TLS_CHANNEL)
Expand Down Expand Up @@ -284,9 +281,8 @@ async def test_backup(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) -> No


@pytest.mark.group(1)
async def test_restore_on_new_cluster(ops_test: OpsTest, github_secrets) -> None:
async def test_restore_on_new_cluster(ops_test: OpsTest, github_secrets, charm) -> None:
"""Test that is possible to restore a backup to another PostgreSQL cluster."""
charm = await ops_test.build_charm(".")
previous_database_app_name = f"{DATABASE_APP_NAME}-gcp"
database_app_name = f"new-{DATABASE_APP_NAME}"
await ops_test.model.deploy(charm, application_name=previous_database_app_name)
Expand Down

0 comments on commit a6dfc0c

Please sign in to comment.