Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
0d44757
Define the dependencies more exactly to get the integration tests run…
mz2 Jun 7, 2023
97e8d4c
juju 3.1/stable -> 3.0/stable
mz2 Jun 7, 2023
a055701
Install strictly confined versions of juju and microk8s.
mz2 Jun 7, 2023
672ea62
Use microk8s 1.27-strict/stable
mz2 Jun 7, 2023
6c11eb5
Adds package repo access to the integration test job
mz2 Jun 7, 2023
5c149e2
Add the containerd template modification
mz2 Jun 7, 2023
11cf30b
Adds some missing sudoing
mz2 Jun 7, 2023
6e8375a
From >> to tee -a
mz2 Jun 7, 2023
97f1531
Drop the docker login
mz2 Jun 7, 2023
1478f45
Oops, escaping quotes did not work quite right there.
mz2 Jun 7, 2023
b03e015
Adjust the integration test scenario, expecting rather than raising o…
mz2 Jun 7, 2023
55b9436
Drops the debugging intended branch from the list of branches to trig…
mz2 Jun 7, 2023
cde6b80
Change to maintenance status instead for clarity, since configuration…
mz2 Jun 7, 2023
1ed9d5f
Adds the "integration-test-fix" branch into the rule still
mz2 Jun 7, 2023
0a30cee
Adds a 503 response / maintenance status to the frontend application …
mz2 Jun 7, 2023
bf2859c
Removs the redundant import StoredState
mz2 Jun 7, 2023
2fc065f
Add a `microk8s status --wait-ready`
mz2 Jun 7, 2023
06a258e
Adds missing sudo
mz2 Jun 7, 2023
4af3b2a
Merge branch 'main' into integration-test-fix
nadzyah Jun 20, 2023
0db5736
Merge branch 'main' into integration-test-fix
nadzyah Jun 22, 2023
8417af7
Merge branch 'main' into integration-test-fix
nadzyah Jun 27, 2023
a3a5404
Let's try with the microk8s version + libpyjuju < 3.1
mz2 Jul 2, 2023
e90849c
Merge branch 'integration-test-fix' of github.com:canonical/test_obse…
mz2 Jul 2, 2023
234b1aa
Back to 5.13/stable for lxd
mz2 Jul 2, 2023
fd3ed35
2.9/stable -> 3.0/stable
mz2 Jul 2, 2023
63f4d6f
Trying with the non-strictly confined microk8s
mz2 Jul 2, 2023
acf47ce
Adds "publish-charm" job
mz2 Jul 2, 2023
b03dddb
Adds promotion action
mz2 Jul 2, 2023
7348559
Swap to self-hosted runners
mz2 Oct 26, 2023
9521314
LXD 5.13 => 5.19
mz2 Oct 26, 2023
6a53221
Run also the integration tests
mz2 Oct 26, 2023
bcd4cf5
Move publishing charm to a separate workflow
mz2 Oct 26, 2023
08d8c5c
juju 3.0 => juju 3.2
mz2 Oct 26, 2023
977550e
juju 3.0 -> 3.2
mz2 Oct 26, 2023
9f8ccec
Adds a now required trailing comma
mz2 Oct 26, 2023
422ee3b
microk8s 1.27 => 1.28
mz2 Oct 26, 2023
4068f04
Use mz2 fork of the action operator
mz2 Oct 26, 2023
1b1e212
Juju classic confinement = off too
mz2 Oct 26, 2023
b0b420d
Pulls in origin/main
mz2 Oct 26, 2023
fb4817a
Introduces a working integration testing workflow for the frontend charm
mz2 Dec 9, 2023
5a75762
Update .github/workflows/publish_charms.yml
mz2 Dec 9, 2023
4f5cc55
Merges in origin/main
mz2 Dec 9, 2023
188f2ba
Merge branch 'integration-test-fix-with-hosted-runners' of github.com…
mz2 Dec 9, 2023
418cdbd
Remove publish_charms.yml that has been long since been separately added
mz2 Dec 9, 2023
ff57b22
Removes release-charms.yml that has long been superseded
mz2 Dec 9, 2023
61e6d4f
Removes also frontend_charm_promote.yml that is not really in scope o…
mz2 Dec 9, 2023
9e0ff27
From 3.2 requirement => 2.9 requirement
mz2 Dec 9, 2023
943e0e6
Removes the stray reformatting of frontend charm.py
mz2 Dec 9, 2023
acb0dd8
Remove another example of accidental reformatting
mz2 Dec 9, 2023
f9528e3
Run the integration test workflow manually, on main branch and when P…
mz2 Dec 9, 2023
3ded998
Run frontend integration tests also on branches where there are chang…
mz2 Dec 9, 2023
5bcbd1c
Removes a stray change to frontend_charm_analysis.yml
mz2 Dec 9, 2023
ad2ae8b
An explanatory comment re: pinning macaroonbakery to 1.3.2
mz2 Dec 11, 2023
09e1425
Adds docker.io mirroring
mz2 Dec 11, 2023
e465185
Fix the trigger so the workflow triggers on approved PRs
mz2 Dec 11, 2023
4814f96
Reference the setup steps from main
mz2 Dec 11, 2023
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
54 changes: 23 additions & 31 deletions .github/workflows/frontend_charm_integration_tests.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,37 @@
name: Run charm tests
name: Run charm integration tests
on:
pull_request_review:
on:
pull_request_review:
types: [submitted]
pull_request:
branches:
- '**'
paths:
- 'frontend/charm/**'
push:
branches: ["main"]
tags: ["v*.*.*"]
workflow_dispatch:

jobs:
integration-test:
permissions:
contents: read
packages: read

name: Integration tests
runs-on: [self-hosted, linux, large]
runs-on: [self-hosted, jammy, xlarge]
if: github.event.review.state == 'APPROVED'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup LXD
uses: canonical/setup-lxd@main
with:
channel: 5.13/stable
- name: Setup operator environment
uses: charmed-kubernetes/actions-operator@main
with:
provider: microk8s
uses: actions/checkout@v4
- name: Set up microk8s
uses: canonical/certification-github-workflows/.github/actions/microk8s-setup@main
- name: Run integration tests
run: tox -e integration
- name: Archive Tested Charm
uses: actions/upload-artifact@v3
if: ${{ github.ref_name == 'main' }}
with:
name: tested-charm
path: .tox/**/test-observer-frontend_ubuntu-22.04-amd64.charm
retention-days: 5
- name: Archive charmcraft logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: charmcraft-logs
path: /home/runner/.local/state/charmcraft/log/*.log
- name: Archive juju crashdump
if: failure()
uses: actions/upload-artifact@v3
with:
name: juju-crashdump
path: juju-crashdump-*.tar.xz
- name: Archive charm testing outputs
uses: canonical/certification-github-workflows/.github/actions/archive-charm-testing-artifacts@main
defaults:
run:
working-directory: ./frontend/charm
working-directory: ./frontend/charm
8 changes: 6 additions & 2 deletions .github/workflows/publish_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:

jobs:
build-and-push-image:
runs-on: ubuntu-latest
runs-on: [self-hosted, linux]
permissions:
contents: read
packages: write
Expand All @@ -19,6 +19,10 @@ jobs:
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
config-inline: |
[registry."docker.io"]
mirrors = ["https://github-runner-dockerhub-cache.canonical.com:5000"]

- name: Checkout repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -46,8 +50,8 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}

build-and-push-charm:
runs-on: [self-hosted, linux, xlarge]
needs: build-and-push-image
runs-on: ubuntu-latest

steps:
- name: Checkout
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/publish_frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:

jobs:
build-and-push-frontend-image:
runs-on: ubuntu-latest
runs-on: [self-hosted, linux]
permissions:
contents: read
packages: write
Expand All @@ -19,6 +19,10 @@ jobs:
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
config-inline: |
[registry."docker.io"]
mirrors = ["https://github-runner-dockerhub-cache.canonical.com:5000"]

- name: Checkout repository
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Observe the status and state of certification tests for various artefacts
- `juju` 3.1 or later (`sudo snap install juju --channel=3.1/stable`)
- `microk8s` 1.27 or later (`sudo snap install microk8s --channel=1.27-strict/stable`) + [permission setup steps after install](https://juju.is/docs/sdk/set-up-your-development-environment#heading--install-microk8s)
- `terraform` 1.4.6 or later (`sudo snap install terraform --classic`)
- `lxd` 5.13 or later (`sudo snap install lxd --channel=5.13/stable` or `sudo snap refresh lxd --channel=5.13/stable` if already installed) + `lxd init --auto` after install.
- `lxd` 5.19 or later (`sudo snap install lxd --channel=5.19/stable` or `sudo snap refresh lxd --channel=5.19/stable` if already installed) + `lxd init --auto` after install.
- `charmcraft` 2.3.0 or later (`sudo snap install charmcraft --channel=2.x/stable --classic`)
- optional: `jhack` for all kinds of handy Juju and charm SDK development and debugging operations (`sudo snap install jhack`)

Expand Down
2 changes: 1 addition & 1 deletion backend/charm/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ops >= 1.5.0
ops >= 2.8.0
requests==2.31.0
3 changes: 2 additions & 1 deletion frontend/charm/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ops >= 2.2.0
ops >= 2.8.0
macaroonbakery==1.3.2 # workaround to failures such as https://github.com/canonical/test_observer/actions/runs/7142353669/job/19451476954
9 changes: 4 additions & 5 deletions frontend/charm/tests/integration/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@


@pytest.mark.abort_on_fail
async def test_build_and_deploy(ops_test: OpsTest):
"""Build the charm-under-test and deploy it together with related charms.
async def test_build_and_deploy_without_backend(ops_test: OpsTest):
"""Build the charm-under-test and deploy it together without related charms.

Assert on the unit status before any relations/configurations take place.
"""
Expand All @@ -29,8 +29,7 @@ async def test_build_and_deploy(ops_test: OpsTest):
ops_test.model.deploy(charm, resources=resources, application_name=APP_NAME),
ops_test.model.wait_for_idle(
apps=[APP_NAME],
status="active",
raise_on_blocked=True,
timeout=1000,
status="maintenance",
timeout=2000,
),
)
2 changes: 1 addition & 1 deletion frontend/charm/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ commands =
description = Run integration tests
deps =
pytest
juju
juju<=3.2
pytest-operator
-r {tox_root}/requirements.txt
commands =
Expand Down
5 changes: 1 addition & 4 deletions terraform/test-observer.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
juju = {
version = "~> 0.7.0"
version = "~> 0.10.0"
source = "juju/juju"
}
}
Expand Down Expand Up @@ -67,7 +67,6 @@ resource "juju_application" "pg" {
charm {
name = "postgresql-k8s"
channel = "14/stable"
series = "jammy"
}
}

Expand All @@ -78,7 +77,6 @@ resource "juju_application" "test-observer-api" {
charm {
name = "test-observer-api"
channel = "latest/edge"
series = "jammy"
}

config = {
Expand All @@ -97,7 +95,6 @@ resource "juju_application" "test-observer-frontend" {
charm {
name = "test-observer-frontend"
channel = "latest/edge"
series = "jammy"
}

config = {
Expand Down