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
433 changes: 209 additions & 224 deletions poetry.lock

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ requires-poetry = ">=2.0.0"
[tool.poetry.dependencies]
python = "^3.10"
ops = "^2.23.1"
boto3 = "^1.42.10"
boto3 = "^1.42.22"
pgconnstr = "^1.0.1"
requests = "^2.32.5"
tenacity = "^9.1.2"
pydantic = "^1.10.24"
pydantic = "^1.10.26"
jinja2 = "^3.1.6"
lightkube = "^0.18.0"
lightkube = "^0.19.0"
lightkube-models = "^1.28.1.4"
psycopg2 = "^2.9.11"

Expand All @@ -40,7 +40,7 @@ jsonschema = "*"
optional = true

[tool.poetry.group.format.dependencies]
ruff = "^0.14.9"
ruff = "^0.14.10"

[tool.poetry.group.lint]
optional = true
Expand All @@ -52,14 +52,14 @@ codespell = "^2.4.1"
optional = true

[tool.poetry.group.unit.dependencies]
coverage = {extras = ["toml"], version = "^7.13.0"}
coverage = {extras = ["toml"], version = "^7.13.1"}
pytest = "^8.4.2"

[tool.poetry.group.integration]
optional = true

[tool.poetry.group.integration.dependencies]
lightkube = "^0.18.0"
lightkube = "^0.19.0"
pytest = "^8.4.2"
pytest-operator = "^0.43.2"
allure-pytest-default-results = "^0.1.3"
Expand All @@ -68,7 +68,7 @@ juju = "<=3.6.1.3"
psycopg2-binary = "^2.9.11"
boto3 = "*"
tenacity = "^9.1.2"
allure-pytest = "^2.15.2"
allure-pytest = "^2.15.3"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/ha_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ async def continuous_writes(ops_test: OpsTest) -> None:
for attempt in Retrying(stop=stop_after_delay(60 * 5), wait=wait_fixed(3), reraise=True):
with attempt:
action = (
await ops_test.model.applications[APPLICATION_NAME]
await ops_test.model
.applications[APPLICATION_NAME]
.units[0]
.run_action("clear-continuous-writes")
)
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/ha_tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,8 @@ async def start_continuous_writes(ops_test: OpsTest, app: str, model: Model = No
for attempt in Retrying(stop=stop_after_delay(60 * 5), wait=wait_fixed(3), reraise=True):
with attempt:
action = (
await model.applications[APPLICATION_NAME]
await model
.applications[APPLICATION_NAME]
.units[0]
.run_action("start-continuous-writes")
)
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/ha_tests/test_async_replication.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ async def second_model_continuous_writes(second_model) -> None:
for attempt in Retrying(stop=stop_after_delay(10), wait=wait_fixed(3), reraise=True):
with attempt:
action = (
await second_model.applications[APPLICATION_NAME]
await second_model
.applications[APPLICATION_NAME]
.units[0]
.run_action("clear-continuous-writes")
)
Expand Down
6 changes: 4 additions & 2 deletions tests/integration/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,8 +786,10 @@ async def wait_for_idle_on_blocked(
await asyncio.gather(
ops_test.model.wait_for_idle(apps=[other_app_name], status="active"),
ops_test.model.block_until(
lambda: unit.workload_status == "blocked"
and unit.workload_status_message == status_message
lambda: (
unit.workload_status == "blocked"
and unit.workload_status_message == status_message
)
),
)

Expand Down
6 changes: 4 additions & 2 deletions tests/integration/test_backups_pitr_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ async def pitr_backup_operations(
logger.info("1: waiting for the database charm to become blocked after restore")
async with ops_test.fast_forward():
await ops_test.model.block_until(
lambda: ops_test.model.units.get(f"{database_app_name}/0").workload_status_message
== CANNOT_RESTORE_PITR,
lambda: (
ops_test.model.units.get(f"{database_app_name}/0").workload_status_message
== CANNOT_RESTORE_PITR
),
timeout=1000,
)
logger.info(
Expand Down
6 changes: 4 additions & 2 deletions tests/integration/test_backups_pitr_gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ async def pitr_backup_operations(
logger.info("1: waiting for the database charm to become blocked after restore")
async with ops_test.fast_forward():
await ops_test.model.block_until(
lambda: ops_test.model.units.get(f"{database_app_name}/0").workload_status_message
== CANNOT_RESTORE_PITR,
lambda: (
ops_test.model.units.get(f"{database_app_name}/0").workload_status_message
== CANNOT_RESTORE_PITR
),
timeout=1000,
)
logger.info(
Expand Down
18 changes: 12 additions & 6 deletions tests/integration/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,12 @@ async def test_application_removal(ops_test: OpsTest) -> None:

# Block until the application is completely removed, or any unit gets in an error state.
await ops_test.model.block_until(
lambda: APP_NAME not in ops_test.model.applications
or any(
unit.workload_status == "error" for unit in ops_test.model.applications[APP_NAME].units
lambda: (
APP_NAME not in ops_test.model.applications
or any(
unit.workload_status == "error"
for unit in ops_test.model.applications[APP_NAME].units
)
)
)

Expand Down Expand Up @@ -416,9 +419,12 @@ async def test_redeploy_charm_same_model_after_forcing_removal(ops_test: OpsTest

# Block until the application is completely removed, or any unit gets in an error state.
await ops_test.model.block_until(
lambda: APP_NAME not in ops_test.model.applications
or any(
unit.workload_status == "error" for unit in ops_test.model.applications[APP_NAME].units
lambda: (
APP_NAME not in ops_test.model.applications
or any(
unit.workload_status == "error"
for unit in ops_test.model.applications[APP_NAME].units
)
)
)

Expand Down
5 changes: 3 additions & 2 deletions tests/integration/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@ async def test_config_parameters(ops_test: OpsTest, charm) -> None:
charm_config[k] = v[0]
await ops_test.model.applications[DATABASE_APP_NAME].set_config(charm_config)
await ops_test.model.block_until(
lambda: ops_test.model.units[f"{DATABASE_APP_NAME}/0"].workload_status
== "blocked",
lambda: (
ops_test.model.units[f"{DATABASE_APP_NAME}/0"].workload_status == "blocked"
),
timeout=100,
)
assert "Configuration Error" in leader_unit.workload_status_message
Expand Down