Skip to content

Commit

Permalink
Add Landscape client subordinate charm test (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlcsaposs-canonical authored Mar 14, 2024
1 parent ba81fd2 commit 2af413a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ jobs:
"GCP_ACCESS_KEY": "${{ secrets.GCP_ACCESS_KEY }}",
"GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}",
"UBUNTU_PRO_TOKEN" : "${{ secrets.UBUNTU_PRO_TOKEN }}",
"LANDSCAPE_ACCOUNT_NAME": "${{ secrets.LANDSCAPE_ACCOUNT_NAME }}",
"LANDSCAPE_REGISTRATION_KEY": "${{ secrets.LANDSCAPE_REGISTRATION_KEY }}",
}
permissions:
contents: write # Needed for Allure Report beta
24 changes: 23 additions & 1 deletion tests/integration/test_subordinate_charms.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from .relations.test_database import APPLICATION_APP_NAME, CLUSTER_NAME, DATABASE_APP_NAME, TIMEOUT

UBUNTU_PRO_APP_NAME = "ubuntu-advantage"
LANDSCAPE_CLIENT_APP_NAME = "landscape-client"


@pytest.mark.group(1)
Expand Down Expand Up @@ -37,11 +38,32 @@ async def test_ubuntu_pro(ops_test, mysql_charm_series, github_secrets):
await ops_test.model.relate(
f"{DATABASE_APP_NAME}:database", f"{APPLICATION_APP_NAME}:database"
)
await ops_test.model.relate(f"{DATABASE_APP_NAME}", f"{UBUNTU_PRO_APP_NAME}")
await ops_test.model.relate(DATABASE_APP_NAME, UBUNTU_PRO_APP_NAME)
async with ops_test.fast_forward("60s"):
await ops_test.model.wait_for_idle(
apps=[DATABASE_APP_NAME, APPLICATION_APP_NAME, UBUNTU_PRO_APP_NAME],
status="active",
raise_on_blocked=True,
timeout=TIMEOUT,
)


@pytest.mark.group(1)
async def test_landscape_client(ops_test, github_secrets):
await ops_test.model.deploy(
LANDSCAPE_CLIENT_APP_NAME,
application_name=LANDSCAPE_CLIENT_APP_NAME,
channel="latest/edge",
config={
"account-name": github_secrets["LANDSCAPE_ACCOUNT_NAME"],
"registration-key": github_secrets["LANDSCAPE_REGISTRATION_KEY"],
},
)
await ops_test.model.relate(DATABASE_APP_NAME, LANDSCAPE_CLIENT_APP_NAME)
async with ops_test.fast_forward("60s"):
await ops_test.model.wait_for_idle(
apps=[DATABASE_APP_NAME, APPLICATION_APP_NAME, LANDSCAPE_CLIENT_APP_NAME],
status="active",
raise_on_blocked=True,
timeout=TIMEOUT,
)

0 comments on commit 2af413a

Please sign in to comment.