From 8c3edcb15f1a0d311131c2d5abfff251bdb3d287 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 9 Apr 2024 02:09:26 +0000 Subject: [PATCH 1/4] Update dependency Juju 2 to v2.9.49 --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7008c97f7..73484236b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -52,7 +52,7 @@ jobs: fail-fast: false matrix: juju: - - agent: 2.9.47 # renovate: latest juju 2 + - agent: 2.9.49 # renovate: latest juju 2 libjuju: ==2.9.46.1 # renovate: latest libjuju 2 allure: false - agent: 3.1.7 # renovate: latest juju 3 From 1269dade3a4b0a9b6d95cb711b0a9aa4007d282b Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Tue, 9 Apr 2024 15:52:10 +0300 Subject: [PATCH 2/4] Try not to deploy LS --- tests/integration/test_subordinates.py | 47 +++++++------------------- 1 file changed, 13 insertions(+), 34 deletions(-) diff --git a/tests/integration/test_subordinates.py b/tests/integration/test_subordinates.py index 5d3c09b93..d43d3e66d 100644 --- a/tests/integration/test_subordinates.py +++ b/tests/integration/test_subordinates.py @@ -3,9 +3,7 @@ # See LICENSE file for licensing details. import logging -import subprocess from asyncio import gather -from base64 import b64encode import pytest from pytest_operator.plugin import OpsTest @@ -15,12 +13,11 @@ from .helpers.helpers import ( CLIENT_APP_NAME, FIRST_DATABASE_RELATION_NAME, + PG, PGB, scale_application, ) -from .helpers.postgresql_helpers import get_unit_address -PG = "pg" LS_CLIENT = "landscape-client" UBUNTU_PRO_APP_NAME = "ubuntu-advantage" @@ -30,11 +27,6 @@ @pytest.mark.group(1) @pytest.mark.abort_on_fail async def test_deploy(ops_test: OpsTest, pgb_charm_jammy, github_secrets): - landscape_config = { - "admin_email": "admin@example.com", - "admin_name": "Admin", - "admin_password": "qweqwepoipoi", - } await gather( ops_test.model.deploy( pgb_charm_jammy, @@ -42,52 +34,39 @@ async def test_deploy(ops_test: OpsTest, pgb_charm_jammy, github_secrets): num_units=None, ), ops_test.model.deploy( - "postgresql", - application_name=PG, + PG, num_units=3, channel="14/edge", - config={"profile": "testing"}, ), ops_test.model.deploy( CLIENT_APP_NAME, num_units=3, channel="latest/edge", ), - ops_test.model.deploy("landscape-scalable"), ops_test.model.deploy( UBUNTU_PRO_APP_NAME, config={"token": github_secrets["UBUNTU_PRO_TOKEN"]}, num_units=0, ), - ops_test.model.deploy(LS_CLIENT, num_units=0), + ops_test.model.deploy( + LS_CLIENT, + config={ + "account-name": github_secrets["LANDSCAPE_ACCOUNT_NAME"], + "registration-key": github_secrets["LANDSCAPE_REGISTRATION_KEY"], + "ppa": "ppa:landscape/self-hosted-beta", + }, + num_units=0, + ), ) - await ops_test.model.applications["landscape-server"].set_config(landscape_config) await ops_test.model.add_relation(f"{PGB}:{BACKEND_RELATION_NAME}", f"{PG}:database") await ops_test.model.add_relation(f"{CLIENT_APP_NAME}:{FIRST_DATABASE_RELATION_NAME}", PGB) await ops_test.model.wait_for_idle( - apps=["landscape-server", "haproxy", CLIENT_APP_NAME, PG, PGB], + apps=[CLIENT_APP_NAME, PG, PGB], status="active", timeout=3000, ) - haproxy_unit = ops_test.model.applications["haproxy"].units[0] - haproxy_addr = get_unit_address(ops_test, haproxy_unit.name) - haproxy_host = haproxy_unit.machine.hostname - cert = subprocess.check_output([ - "lxc", - "exec", - haproxy_host, - "cat", - "/var/lib/haproxy/selfsigned_ca.crt", - ]) - ssl_public_key = f"base64:{b64encode(cert).decode()}" - - await ops_test.model.applications[LS_CLIENT].set_config({ - "account-name": "standalone", - "ping-url": f"http://{haproxy_addr}/ping", - "url": f"https://{haproxy_addr}/message-system", - "ssl-public-key": ssl_public_key, - }) + await ops_test.model.relate(f"{CLIENT_APP_NAME}:juju-info", f"{LS_CLIENT}:container") await ops_test.model.relate(f"{CLIENT_APP_NAME}:juju-info", f"{UBUNTU_PRO_APP_NAME}:juju-info") await ops_test.model.relate(f"{PG}:juju-info", f"{LS_CLIENT}:container") From 8c226bf59f6eafc95746f9bfccf228350115180f Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Tue, 9 Apr 2024 17:14:37 +0300 Subject: [PATCH 3/4] Add saas landscape cred secrets --- .github/workflows/ci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 73484236b..6bb15ed49 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -75,4 +75,6 @@ jobs: integration-test: | { "UBUNTU_PRO_TOKEN" : "${{ secrets.UBUNTU_PRO_TOKEN }}", + "LANDSCAPE_ACCOUNT_NAME": "${{ secrets.LANDSCAPE_ACCOUNT_NAME }}", + "LANDSCAPE_REGISTRATION_KEY": "${{ secrets.LANDSCAPE_REGISTRATION_KEY }}", } From 594f676d3780ca5416fa00166862250770ead532 Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Tue, 9 Apr 2024 17:57:31 +0300 Subject: [PATCH 4/4] Switch to edge channels --- tests/integration/test_subordinates.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/integration/test_subordinates.py b/tests/integration/test_subordinates.py index d43d3e66d..cf3020f5d 100644 --- a/tests/integration/test_subordinates.py +++ b/tests/integration/test_subordinates.py @@ -46,6 +46,7 @@ async def test_deploy(ops_test: OpsTest, pgb_charm_jammy, github_secrets): ops_test.model.deploy( UBUNTU_PRO_APP_NAME, config={"token": github_secrets["UBUNTU_PRO_TOKEN"]}, + channel="latest/edge", num_units=0, ), ops_test.model.deploy( @@ -55,6 +56,7 @@ async def test_deploy(ops_test: OpsTest, pgb_charm_jammy, github_secrets): "registration-key": github_secrets["LANDSCAPE_REGISTRATION_KEY"], "ppa": "ppa:landscape/self-hosted-beta", }, + channel="latest/edge", num_units=0, ), )