From c04fba15d59015a89d84166a9f799b35cd94c8e9 Mon Sep 17 00:00:00 2001 From: Bartlomiej Gmerek Date: Tue, 10 Oct 2023 08:58:01 +0200 Subject: [PATCH] Workaround fixing integration tests --- .github/actions/ec2-github-runner/action.yml | 2 +- .github/workflows/integration-tests.yaml | 3 +++ tests/integration/fixtures.py | 12 ++++++++---- tests/integration/test_integration.py | 14 +++++++++----- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/.github/actions/ec2-github-runner/action.yml b/.github/actions/ec2-github-runner/action.yml index e96803c5..b97f0900 100644 --- a/.github/actions/ec2-github-runner/action.yml +++ b/.github/actions/ec2-github-runner/action.yml @@ -83,5 +83,5 @@ outputs: EC2 Instance Id of the created runner. The id is used to terminate the EC2 instance when the runner is not needed anymore. runs: - using: node12 + using: node16 main: ./dist/index.js diff --git a/.github/workflows/integration-tests.yaml b/.github/workflows/integration-tests.yaml index e7502b1f..e4b623b2 100644 --- a/.github/workflows/integration-tests.yaml +++ b/.github/workflows/integration-tests.yaml @@ -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 diff --git a/tests/integration/fixtures.py b/tests/integration/fixtures.py index c9be8498..56a78d58 100644 --- a/tests/integration/fixtures.py +++ b/tests/integration/fixtures.py @@ -87,10 +87,14 @@ 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, - ) + 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, diff --git a/tests/integration/test_integration.py b/tests/integration/test_integration.py index ab342171..590aca07 100644 --- a/tests/integration/test_integration.py +++ b/tests/integration/test_integration.py @@ -43,11 +43,15 @@ 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, - ) + deploy_sd_core_run_args = ["juju", "deploy", "sd-core", "--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,