Skip to content

Commit

Permalink
Skipping fixtures and bump in timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
dragomirp committed Nov 9, 2023
1 parent 8e3fd79 commit 8376626
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 11 deletions.
14 changes: 14 additions & 0 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,17 @@ async def charm(ops_test: OpsTest):
"""Build the charm-under-test."""
# Build charm from local source folder.
yield await ops_test.build_charm(".")


@pytest.fixture(scope="module")
def juju2(ops_test):
"""Skip test if it is not on juju2."""
if hasattr(ops_test.model, "list_secrets"):
pytest.skip("Test can't run on Juju3")


@pytest.fixture(scope="module")
def juju3(ops_test):
"""Skip test if it is not on juju3."""
if not hasattr(ops_test.model, "list_secrets"):
pytest.skip("Test can't run on Juju2")
2 changes: 1 addition & 1 deletion tests/integration/ha_tests/test_replication.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None:

if wait_for_apps:
async with ops_test.fast_forward():
await ops_test.model.wait_for_idle(status="active", timeout=1000)
await ops_test.model.wait_for_idle(status="active", timeout=1500)


@pytest.mark.group(1)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/ha_tests/test_restore_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None:
config={"profile": "testing"},
)

await ops_test.model.wait_for_idle(status="active", timeout=1000)
await ops_test.model.wait_for_idle(status="active", timeout=1500)

# TODO have a better way to bootstrap clusters with existing storage
primary = await get_primary(
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/ha_tests/test_self_healing.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None:

if wait_for_apps:
async with ops_test.fast_forward():
await ops_test.model.wait_for_idle(status="active", timeout=1000)
await ops_test.model.wait_for_idle(status="active", timeout=1500)


@pytest.mark.group(1)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/ha_tests/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async def test_deploy_latest(ops_test: OpsTest) -> None:
logger.info("Wait for applications to become active")
async with ops_test.fast_forward():
await ops_test.model.wait_for_idle(
apps=[DATABASE_APP_NAME, APPLICATION_NAME], status="active", timeout=1000
apps=[DATABASE_APP_NAME, APPLICATION_NAME], status="active", timeout=1500
)
assert len(ops_test.model.applications[DATABASE_APP_NAME].units) == 3

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async def test_deploy(ops_test: OpsTest, charm: str):
# Reducing the update status frequency to speed up the triggering of deferred events.
await ops_test.model.set_config({"update-status-hook-interval": "10s"})

await ops_test.model.wait_for_idle(apps=[DATABASE_APP_NAME], status="active", timeout=1000)
await ops_test.model.wait_for_idle(apps=[DATABASE_APP_NAME], status="active", timeout=1500)
assert ops_test.model.applications[DATABASE_APP_NAME].units[0].workload_status == "active"


Expand Down
5 changes: 2 additions & 3 deletions tests/integration/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async def test_mailman3_core_db(ops_test: OpsTest, charm: str) -> None:
await ops_test.model.wait_for_idle(
apps=[DATABASE_APP_NAME],
status="active",
timeout=1000,
timeout=1500,
wait_for_exact_units=DATABASE_UNITS,
)

Expand Down Expand Up @@ -322,8 +322,7 @@ async def test_weebl_db(ops_test: OpsTest, charm: str) -> None:


@pytest.mark.group(1)
@pytest.mark.juju2
async def test_canonical_livepatch_onprem_bundle_db(ops_test: OpsTest) -> None:
async def test_canonical_livepatch_onprem_bundle_db(ops_test: OpsTest, juju2) -> None:
# Deploy and test the Livepatch onprem bundle (using this PostgreSQL charm
# and an overlay to make the Ubuntu Advantage charm work with PostgreSQL).
# We intentionally wait for the `✘ sync_token not set` status message as we
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_db_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ async def test_landscape_scalable_bundle_db(ops_test: OpsTest, charm: str) -> No
# rebooting the unit machine in the middle of a hook (what is needed when the issue from
# https://bugs.launchpad.net/juju/+bug/1999758 happens).
await ops_test.model.wait_for_idle(
apps=[DATABASE_APP_NAME], status="active", timeout=600, raise_on_error=False
apps=[DATABASE_APP_NAME], status="active", timeout=1500, raise_on_error=False
)

await ensure_correct_relation_data(ops_test, DATABASE_UNITS, LANDSCAPE_APP_NAME, RELATION_NAME)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_password_rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def test_deploy_active(ops_test: OpsTest):
series=CHARM_SERIES,
config={"profile": "testing"},
)
await ops_test.model.wait_for_idle(apps=[APP_NAME], status="active", timeout=1000)
await ops_test.model.wait_for_idle(apps=[APP_NAME], status="active", timeout=1500)


@pytest.mark.group(1)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async def test_plugins(ops_test: OpsTest) -> None:
series=CHARM_SERIES,
config={"profile": "testing"},
)
await ops_test.model.wait_for_idle(apps=[DATABASE_APP_NAME], status="active")
await ops_test.model.wait_for_idle(apps=[DATABASE_APP_NAME], status="active", timeout=1500)

# Check that the available plugins are disabled.
primary = await get_primary(ops_test, f"{DATABASE_APP_NAME}/0")
Expand Down

0 comments on commit 8376626

Please sign in to comment.