Skip to content

Commit

Permalink
Fix backups integration test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zvirovyi committed Jun 19, 2024
1 parent 4663afc commit 662f235
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions tests/integration/test_backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,26 +59,16 @@ async def cloud_configs(ops_test: OpsTest, github_secrets) -> None:
configs = {
AWS: {
"endpoint": "https://s3.amazonaws.com",
"bucket": "data-charms-testing",
"path": f"/postgresql-vm/{uuid.uuid1()}",
"region": "us-east-1",
},
GCP: {
"endpoint": "https://storage.googleapis.com",
"bucket": "data-charms-testing",
"path": f"/postgresql-vm/{uuid.uuid1()}",
"region": "",
"bucket": "v-tarasenko",
"path": f"/pytest-vm/{uuid.uuid1()}",
"region": "eu-central-1",
},
}
credentials = {
AWS: {
"access-key": github_secrets["AWS_ACCESS_KEY"],
"secret-key": github_secrets["AWS_SECRET_KEY"],
},
GCP: {
"access-key": github_secrets["GCP_ACCESS_KEY"],
"secret-key": github_secrets["GCP_SECRET_KEY"],
},
}
yield configs, credentials
# Delete the previously created objects.
Expand Down Expand Up @@ -229,7 +219,11 @@ async def test_backup(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict], charm

# Wait for the restore to complete.
async with ops_test.fast_forward():
await ops_test.model.wait_for_idle(status="active", timeout=1000)
await ops_test.model.block_until(
lambda: remaining_unit.workload_status_message
== MOVE_RESTORED_CLUSTER_TO_ANOTHER_BUCKET,
timeout=1000,
)

# Check that the backup was correctly restored by having only the first created table.
logger.info("checking that the backup was correctly restored")
Expand Down

0 comments on commit 662f235

Please sign in to comment.