feat: Add integration tests - #143
Draft
alithethird wants to merge 11 commits into
Draft
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 fmtRun lint checks
From repo root:
tox -e lintRun unit tests
From repo root:
tox -e unitNote: 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:
Build charm:
Push image to local registry for Juju deployment
Example:
Run integration tests
From repo root:
tox -e integration -- --charm-file=charm/dashboard_ubuntu-22.04-amd64.charm --dashboard-image=localhost:32000/dashboard:0.51Optional: 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.51OAuth flow only:
tox -e integration -- test_oauth.py --charm-file=charm/dashboard_ubuntu-22.04-amd64.charm --dashboard-image=localhost:32000/dashboard:0.51Model 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
rockcraft.yaml? Remember to use the same version number inREADME.md.