Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
29be59e
wip
Gu1nness Apr 9, 2026
20af225
Merge remote-tracking branch 'origin/8/edge' into DPE-9691-release-te…
Gu1nness Apr 13, 2026
d9e7806
fix: release testing basics
Gu1nness Apr 13, 2026
ec640db
chore: bump runners
Gu1nness Apr 13, 2026
2bce7df
fix: release-testing
Gu1nness Apr 13, 2026
7e66076
fix: release-testing
Gu1nness Apr 13, 2026
cd0963d
fix: release-testing
Gu1nness Apr 13, 2026
9371558
fix: fixture
Gu1nness Apr 13, 2026
d11c839
fix: fixture
Gu1nness Apr 13, 2026
ef93bf3
fix: testing
Gu1nness Apr 13, 2026
22e9f8b
fix: spread config
Gu1nness Apr 13, 2026
d8c93c5
fix: split deployment
Gu1nness Apr 13, 2026
070ab98
fix: syntax on f-string
Gu1nness Apr 13, 2026
fa7e9ba
fix: remove offers
Gu1nness Apr 13, 2026
18ec4ac
fix: teardown workflow
Gu1nness Apr 13, 2026
59fa69c
fix: release test
Gu1nness Apr 13, 2026
dd401f9
fix: permissions
Gu1nness Apr 15, 2026
35036c1
feat: Use microceph
Gu1nness Apr 15, 2026
b5ec632
feat: imports
Gu1nness Apr 15, 2026
083b0bb
fix: tests
Gu1nness Apr 16, 2026
a03914b
fix: smaller issues
Gu1nness Apr 17, 2026
635ccc0
fix: async
Gu1nness Apr 20, 2026
0a9b43c
fix: correct testing
Gu1nness Apr 20, 2026
5d5ff56
Merge branch '8/edge' into DPE-9691-release-testing
Gu1nness Apr 21, 2026
2a8f575
fix: remove unsued code
Gu1nness Apr 21, 2026
615526c
fix: don't asyncio all
Gu1nness Apr 22, 2026
ab9608c
fix: integrations
Gu1nness Apr 22, 2026
8bd1b67
Merge branch '8/edge' into DPE-9691-release-testing
Gu1nness Apr 22, 2026
3cf853c
fix: xlarge runners
Gu1nness Apr 22, 2026
844c396
fix: Valid integrations
Gu1nness Apr 23, 2026
58b5f6e
fix: valid integrations
Gu1nness Apr 23, 2026
ec178d5
fix: valid integrations
Gu1nness Apr 23, 2026
763db59
fix: take your time
Gu1nness Apr 23, 2026
e235779
fix: integrate correct app
Gu1nness Apr 23, 2026
0881b09
Merge remote-tracking branch 'origin/8/edge' into DPE-9691-release-te…
Gu1nness Apr 23, 2026
2778f8d
fix: final fixes
Gu1nness Apr 24, 2026
410b190
fix: final fixes
Gu1nness Apr 24, 2026
cd0d381
fix: teardown
Gu1nness Apr 24, 2026
2878cfa
fix: remove both relations
Gu1nness Apr 24, 2026
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
197 changes: 197 additions & 0 deletions .github/workflows/release_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
on:
workflow_call:
inputs:
mongodb-revisions:
description: |
MongoDB revisions to target (ex: '{"amd64": "161", "arm64": "162"}'
required: true
type: string
mongos-revisions:
description: |
Mongos revisions to target (ex: '{"amd64": "161", "arm64": "162"}'
required: true
type: string
backend:
description: |
Backend to target.

Either lxd or microk8s.
required: true
type: string
workflow_dispatch:
inputs:
mongodb-revisions:
description: |
MongoDB revisions to target (ex: '{"amd64": "161", "arm64": "162"}'
required: true
type: number
mongos-revisions:
description: |
Mongos revisions to target (ex: '{"amd64": "161", "arm64": "162"}'
required: true
type: number
backend:
description: |
Backend to target.

Either lxd or microk8s
required: true
type: string

name: Release testing
jobs:
collect-release-tests:
name: Collect release test spread jobs
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up environment
run: |
sudo snap install go --classic
go install github.com/canonical/spread/cmd/spread@latest
pipx install tox poetry
- name: Install deps
run: |
sudo apt update
sudo apt install -y build-essential python3-dev libldap-dev libsasl2-dev
- name: Collect spread jobs
id: collect-jobs
shell: python
run: |
import json
import pathlib
import os
import subprocess
backend = "${{ inputs.backend }}"
pattern = f"github-ci:...:tests/spread/release/{backend}/"
mongodb_revisions = json.loads("${{ inputs.mongodb-revisions }}")
spread_jobs = (
subprocess.run(
[pathlib.Path.home() / "go/bin/spread", "-list", pattern],
capture_output=True,
check=True,
text=True,
)
.stdout.strip()
.split("\n")
)
jobs = []
for job in spread_jobs:
# Example `job`: "github-ci:ubuntu-24.04:tests/spread/release/microk8s/test_release.py"
_, runner, task = job.split(":")
# Remove arm jobs in regular testing.
# Example: "test_charm.py"
task = task.removeprefix("tests/spread/")
if "arm64" in runner:
architecture = "arm64"
else:
architecture = "amd64"
# Example: "test_charm.py | amd64"
name = f"{task} | {architecture}"

mongodb_revision = mongodb_revisions[architecture]
mongos_revision = mongos_revisions[architecture]
# ":" character not valid in GitHub Actions artifact
name_in_artifact = f"{task.replace('/', '-')}-{architecture}-mongodb-{mongodb_revision}-mongos-{mongos_revision}"
jobs.append({
"spread_job": job,
"name": name,
"name_in_artifact": name_in_artifact,
"runner": runner,
"mongodb_revision": mongodb_revision,
"mongos_revision": mongos_revision,
})
output = f"jobs={json.dumps(jobs)}"
print(output)
with open(os.environ["GITHUB_OUTPUT"], "a") as file:
file.write(output)
outputs:
jobs: ${{ steps.collect-jobs.outputs.jobs }}

release-test:
strategy:
fail-fast: false
matrix:
job: ${{ fromJSON(needs.collect-release-tests.outputs.jobs) }}
name: ${{ matrix.job.name }}
needs:
- collect-release-tests
runs-on: ${{ matrix.job.runner }}
timeout-minutes: 230 # Sum of steps `timeout-minutes` + 5
steps:
- name: (IS hosted) Disk usage
timeout-minutes: 1
if: ${{ contains(matrix.job.runner, 'self-hosted') }}
run: df --human-readable
- name: Checkout
timeout-minutes: 3
uses: actions/checkout@v6
- name: Setup python 3.12
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Set up environment
timeout-minutes: 5
run: sudo snap install charmcraft --classic
# TODO: remove when https://github.com/canonical/charmcraft/issues/2105 and
# https://github.com/canonical/charmcraft/issues/2130 fixed
- run: |
sudo snap install go --classic
go install github.com/canonical/spread/cmd/spread@latest
- name: Run spread job
timeout-minutes: 180
id: spread
# TODO: replace with `charmcraft test` when
# https://github.com/canonical/charmcraft/issues/2105 and
# https://github.com/canonical/charmcraft/issues/2130 fixed
run: ~/go/bin/spread -vv -artifacts=artifacts '${{ matrix.job.spread_job }}'
env:
MONGODB_REVISION: ${{ matrix.job.mongodb_revision }}
MONGOS_REVISION: ${{ matrix.job.mongos_revision }}
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
GCP_ACCESS_KEY: ${{ secrets.GCP_ACCESS_KEY }}
GCP_SECRET_KEY: ${{ secrets.GCP_SECRET_KEY }}
GCS_SERVICE_ACCOUNT: ${{ secrets.GCS_SERVICE_ACCOUNT }}
- timeout-minutes: 1
if: ${{ success() || (failure() && steps.spread.outcome == 'failure') }}
run: snap list
- name: Select model
timeout-minutes: 1
if: ${{ (success() || (failure() && steps.spread.outcome == 'failure')) }}
id: juju-switch
run: |
# sudo needed since spread runs scripts as root
# "testing" is default model created by concierge
sudo juju switch testing
mkdir ~/logs/
- name: juju status
timeout-minutes: 1
if: ${{ success() || (failure() && steps.spread.outcome == 'failure') }}
run: sudo juju status --color --relations | tee ~/logs/juju-status.txt
- name: juju status (YAML)
timeout-minutes: 1
if: ${{ success() || (failure() && steps.spread.outcome == 'failure') }}
run: sudo juju status --format yaml --color --relations --storage | tee ~/logs/juju-status-yaml.txt
- name: juju debug-log
timeout-minutes: 3
if: ${{ success() || (failure() && steps.spread.outcome == 'failure') }}
run: sudo juju debug-log --color --replay --no-tail | tee ~/logs/juju-debug-log.txt
- name: jhack tail
timeout-minutes: 3
if: ${{ success() || (failure() && steps.spread.outcome == 'failure') }}
run: sudo jhack tail --printer raw --replay --no-watch | tee ~/logs/jhack-tail.txt
- name: Upload logs
timeout-minutes: 5
if: ${{ success() || (failure() && steps.spread.outcome == 'failure') }}
uses: actions/upload-artifact@v4
with:
name: logs-release-test-${{ matrix.job.name_in_artifact }}
path: ~/logs/
if-no-files-found: error
- name: Disk usage
timeout-minutes: 1
if: ${{ success() || (failure() && steps.spread.outcome == 'failure') }}
run: df --human-readable
16 changes: 14 additions & 2 deletions spread.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ backends:
username: ubuntu
- self-hosted-linux-arm64-noble-medium:
username: ubuntu
- self-hosted-linux-amd64-noble-large:
- self-hosted-linux-amd64-noble-xlarge:
username: ubuntu
- self-hosted-linux-arm64-noble-large:
- self-hosted-linux-arm64-noble-xlarge:
username: ubuntu

suites:
Expand All @@ -138,6 +138,18 @@ suites:
summary: Spread tests for Mongos VM
tests/spread/mongos/microk8s/:
summary: Spread tests for Mongos Kubernetes
tests/spread/release/lxd/:
summary: Spread mongodb release tests for VM
manual: True
environment:
MONGODB_REVISION: "$(HOST: echo $MONGODB_REVISION)"
MONGOS_REVISION: "$(HOST: echo $MONGOS_REVISION)"
tests/spread/release/microk8s/:
summary: Spread mongodb release tests for Kubernetes
manual: True
environment:
MONGODB_REVISION: "$(HOST: echo $MONGODB_REVISION)"
MONGOS_REVISION: "$(HOST: echo $MONGOS_REVISION)"

path: /root/spread_project

Expand Down
14 changes: 14 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ def pytest_addoption(parser: Parser):
choices=("lxd", "microk8s"),
default="lxd",
)
parser.addoption(
"--mongodb-revision",
action="store",
help="MongoDB revision",
default=1,
type=int,
)
parser.addoption(
"--mongos-revision",
action="store",
help="MongoDB revision",
default=1,
type=int,
)


def pytest_configure(config):
Expand Down
24 changes: 24 additions & 0 deletions tests/integration/applications/continuous_write_charm/actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,27 @@ stop-continuous-writes:
type: string
description: name of the collection to write to
default: continuous_writes_collection

start-continuous-reads:
description: Start continuous reads.
params:
db-name:
type: string
description: name of the database to read from
default: continuous_writes_database
collection-name:
type: string
description: name of the collection to read from
default: continuous_writes_collection

stop-continuous-reads:
description: Stop continuous reads.
params:
db-name:
type: string
description: name of the database to read from
default: continuous_writes_database
collection-name:
type: string
description: name of the collection to read from
default: continuous_writes_collection
Loading
Loading