From d34b5c52019832a6a0400afc44fbd887f29d4bcc Mon Sep 17 00:00:00 2001 From: Lucas Gameiro Borges Date: Thu, 5 Sep 2024 15:19:07 -0300 Subject: [PATCH] use build_and_deploy --- tests/integration/test_storage.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/tests/integration/test_storage.py b/tests/integration/test_storage.py index f6c102e34..d8d57431f 100644 --- a/tests/integration/test_storage.py +++ b/tests/integration/test_storage.py @@ -9,7 +9,7 @@ from .helpers import ( DATABASE_APP_NAME, - METADATA, + build_and_deploy, db_connect, get_leader_unit, get_password, @@ -25,18 +25,11 @@ @pytest.mark.group(1) @pytest.mark.abort_on_fail -async def test_filling_and_emptying_pgdata_storage(ops_test: OpsTest, database_charm): +async def test_filling_and_emptying_pgdata_storage(ops_test: OpsTest): """Build and deploy the charm and saturate its pgdata volume.""" # Build and deploy the PostgreSQL charm. - await ops_test.model.deploy( - database_charm, - resources={ - "postgresql-image": METADATA["resources"]["postgresql-image"]["upstream-source"] - }, - application_name=DATABASE_APP_NAME, - num_units=1, - trust=True, - ) + async with ops_test.fast_forward(): + await build_and_deploy(ops_test, 1) # Saturate storage with some data primary = await get_primary(ops_test)