Skip to content

Commit

Permalink
Set arch model constraint async tests
Browse files Browse the repository at this point in the history
  • Loading branch information
carlcsaposs-canonical committed May 10, 2024
1 parent b52719a commit 7d9c5d1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/integration/ha_tests/test_async_replication.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# See LICENSE file for licensing details.
import contextlib
import logging
import subprocess
from asyncio import gather
from typing import Optional

Expand All @@ -12,7 +13,7 @@
from pytest_operator.plugin import OpsTest
from tenacity import Retrying, stop_after_delay, wait_fixed

from .. import markers
from .. import architecture, markers
from ..helpers import (
APPLICATION_NAME,
DATABASE_APP_NAME,
Expand Down Expand Up @@ -70,6 +71,10 @@ async def second_model(ops_test: OpsTest, first_model, request) -> Model:
second_model_name = f"{first_model.info.name}-other"
if second_model_name not in await ops_test._controller.list_models():
await ops_test._controller.add_model(second_model_name)
subprocess.run(["juju", "switch", second_model_name], check=True)
subprocess.run(
["juju", "set-model-constraints", f"arch={architecture.architecture}"], check=True
)
second_model = Model()
await second_model.connect(model_name=second_model_name)
yield second_model
Expand Down

0 comments on commit 7d9c5d1

Please sign in to comment.