Skip to content

feat: Add integration tests - #143

Draft
alithethird wants to merge 11 commits into
canonical:mainfrom
alithethird:main
Draft

feat: Add integration tests#143
alithethird wants to merge 11 commits into
canonical:mainfrom
alithethird:main

Conversation

@alithethird

@alithethird alithethird commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Add integration tests for health check and oauth.

This PR also adds capability to run those integration tests and linting in the CI and in local.

Local validation and integration test guide

Run formatting

From repo root:
tox -e fmt

Run lint checks

From repo root:
tox -e lint

Run unit tests

From repo root:
tox -e unit
Note: in the current tox.ini, the unit env is a placeholder command, so this mainly validates the env wiring.

Build artifacts required for integration tests

Build rock:

```
cd dashboard
rockcraft pack
```

Build charm:

```
cd charm
charmcraft pack
```

Push image to local registry for Juju deployment

Example:

cd dashboard
rockcraft.skopeo --insecure-policy copy --dest-tls-verify=false oci-archive:dashboard_0.51_amd64.rock docker://localhost:32000/dashboard:0.51

Run integration tests

From repo root:
tox -e integration -- --charm-file=charm/dashboard_ubuntu-22.04-amd64.charm --dashboard-image=localhost:32000/dashboard:0.51

Optional: run specific integration suites

Health checks only:

tox -e integration -- test_charm.py --charm-file=charm/dashboard_ubuntu-22.04-amd64.charm --dashboard-image=localhost:32000/dashboard:0.51

OAuth flow only:

tox -e integration -- test_oauth.py --charm-file=charm/dashboard_ubuntu-22.04-amd64.charm --dashboard-image=localhost:32000/dashboard:0.51

Model behavior notes

Integration fixtures in conftest.py support temporary model creation by default.
You can also pass --use-existing or --model if you want to reuse a model.
OAuth flow in test_oauth.py triggers Playwright browser setup via fixtures.


Manual checks

  • If you changed the Dashboard application or the rock, have you increased the version number in rockcraft.yaml? Remember to use the same version number in README.md.

alithethird and others added 11 commits April 9, 2026 21:56
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Moved integration tests from `tests/integration` to `charm/tests/integration`.
- Added new `conftest.py` for test fixtures specific to the Dashboard charm.
- Implemented helper functions for integration tests in `helpers.py`.
- Created new test files for charm health and OAuth integration.
- Updated requirements for integration tests.
- Removed obsolete test files and configurations from the previous structure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant