Skip to content

Commit

Permalink
WIP: upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
Gu1nness committed Sep 23, 2024
1 parent c1fa57c commit ed8a941
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,8 @@ def _on_mongod_pebble_ready(self, event) -> None:
if not self._configure_container(container):
event.defer()

self.upgrade._reconcile_upgrade(event)

def is_db_service_ready(self) -> bool:
"""Checks if the MongoDB service is ready to accept connections."""
with MongoDBConnection(self.mongodb_config, "localhost", direct=True) as direct_mongo:
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/upgrades/test_upgrades.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# See LICENSE file for licensing details.

import logging
from pathlib import Path

import pytest
from pytest_operator.plugin import OpsTest
Expand Down Expand Up @@ -53,7 +54,7 @@ async def test_build_and_deploy(ops_test: OpsTest):
@pytest.mark.group(1)
@pytest.mark.abort_on_fail
async def test_successful_upgrade(ops_test: OpsTest, continuous_writes) -> None:
new_charm = await ops_test.build_charm(".")
new_charm: Path = await ops_test.build_charm(".")
db_app_name = await get_app_name(ops_test)
await assert_successful_run_upgrade_sequence(ops_test, db_app_name, new_charm=new_charm)

Expand Down

0 comments on commit ed8a941

Please sign in to comment.