Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(FIX) Workaround fixing integration tests #88

Merged
merged 3 commits into from
Oct 10, 2023
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
3 changes: 3 additions & 0 deletions .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ jobs:

echo "# Install Juju"
snap install juju --channel=3.1/stable

echo "# Install juju-crashdump"
snap install --classic juju-crashdump

echo "# Install charmcraft"
snap install charmcraft --classic
Expand Down
14 changes: 10 additions & 4 deletions tests/integration/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,16 @@ async def deploy_cos_lite(ops_test: OpsTest):
)

with ops_test.model_context(COS_MODEL_NAME):
await ops_test.model.deploy( # type: ignore[union-attr]
entity_url="https://charmhub.io/cos-lite",
trust=True,
)
# TODO: Remove below workaround and uncomment the proper deployment once
# https://github.com/charmed-kubernetes/pytest-operator/issues/116 is fixed.
deploy_cos_lite_run_args = ["juju", "deploy", "cos-lite", "--trust"]
retcode, stdout, stderr = await ops_test.run(*deploy_cos_lite_run_args)
if retcode != 0:
raise RuntimeError(f"Error: {stderr}")
# await ops_test.model.deploy( # type: ignore[union-attr]
# entity_url="https://charmhub.io/cos-lite",
# trust=True,
# )
await ops_test.model.wait_for_idle( # type: ignore[union-attr]
apps=[*ops_test.model.applications], # type: ignore[union-attr]
raise_on_error=False,
Expand Down
17 changes: 12 additions & 5 deletions tests/integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,18 @@ async def _deploy_sdcore(self, ops_test: OpsTest):
ops_test: OpsTest
"""
await self._deploy_sdcore_router(ops_test)
await ops_test.model.deploy( # type: ignore[union-attr]
entity_url="https://charmhub.io/sdcore",
channel="latest/edge",
trust=True,
)

# TODO: Remove below workaround and uncomment the proper deployment once
# https://github.com/charmed-kubernetes/pytest-operator/issues/116 is fixed.
deploy_sd_core_run_args = ["juju", "deploy", "sdcore", "--trust", "--channel=edge"]
retcode, stdout, stderr = await ops_test.run(*deploy_sd_core_run_args)
if retcode != 0:
raise RuntimeError(f"Error: {stderr}")
# await ops_test.model.deploy( # type: ignore[union-attr]
# entity_url="https://charmhub.io/sdcore",
# channel="latest/edge",
# trust=True,
# )

await self._create_cross_model_relation(
ops_test,
Expand Down
Loading