Skip to content

Commit

Permalink
personal nits
Browse files Browse the repository at this point in the history
  • Loading branch information
MiaAltieri committed Sep 17, 2024
1 parent 3a9e402 commit 61c48b9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
15 changes: 12 additions & 3 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
get_application_name,
)

TEST_DB = "continuous_writes_database"
TEST_COLL = "test_collection"


@pytest_asyncio.fixture
async def continuous_writes(ops_test: OpsTest) -> None:
Expand All @@ -20,15 +23,21 @@ async def continuous_writes(ops_test: OpsTest) -> None:

application_unit = ops_test.model.applications[application_name].units[0]

clear_writes_action = await application_unit.run_action("clear-continuous-writes")
clear_writes_action = await application_unit.run_action(
"clear-continuous-writes", **{"db-name": TEST_DB, "coll-name": TEST_COLL}
)
await clear_writes_action.wait()

start_writes_action = await application_unit.run_action("start-continuous-writes")
start_writes_action = await application_unit.run_action(
"start-continuous-writes", **{"db-name": TEST_DB, "coll-name": TEST_COLL}
)
await start_writes_action.wait()

yield

clear_writes_action = await application_unit.run_action("clear-continuous-writes")
clear_writes_action = await application_unit.run_action(
"clear-continuous-writes", **{"db-name": TEST_DB, "coll-name": TEST_COLL}
)
await clear_writes_action.wait()


Expand Down
1 change: 0 additions & 1 deletion tests/integration/ha_tests/application_charm/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

DATABASE_NAME = "continuous_writes_database"
COLLECTION_NAME = "test_collection"
COLLECTION_NAME = "continuous_writes_database"
PEER = "application-peers"
PROC_PID_KEY = "proc-pid"
LAST_WRITTEN_FILE = "last_written_value"
Expand Down
1 change: 0 additions & 1 deletion tests/integration/sharding_tests/writes_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ async def count_shard_writes(
connection_string = await mongodb_uri(ops_test, app_name=config_server_name, port=MONGOS_PORT)

client = MongoClient(connection_string)
print(connection_string)
db = client[db_name]
test_collection = db[collection_name]
count = test_collection.count_documents({})
Expand Down
3 changes: 0 additions & 3 deletions tests/integration/upgrades/test_upgrades.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@
@pytest.mark.group(1)
@pytest.mark.abort_on_fail
async def test_build_and_deploy(ops_test: OpsTest):

await deploy_and_scale_application(ops_test)

db_app_name = await get_app_name(ops_test)

if db_app_name:
await check_or_scale_app(ops_test, db_app_name, required_units=2)
return
Expand Down

0 comments on commit 61c48b9

Please sign in to comment.