feat: migrate integration tests to canonical/charm-ci#136
Merged
Conversation
Replace canonical/operator-workflows integration test workflow with canonical/charm-ci (opcli-based) approach. Changes: - Add artifacts.yaml (generated by `opcli artifacts init`) - Add spread.yaml (generated by `opcli spread init`) - Add concierge.yaml for MicroK8s + Juju 3.6/stable provisioning - Update .github/workflows/integration_test.yaml to use canonical/charm-ci reusable workflows (build-artifacts + integration-test) - Add opcli to pyproject.toml integration dep group for pytest plugin - Update uv.lock Also adds .github/copilot-instructions.md with project context for future Copilot sessions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
license-eye has checked 86 files.
| Valid | Invalid | Ignored | Fixed |
|---|---|---|---|
| 21 | 3 | 62 | 0 |
Click to see the invalid file list
- artifacts.yaml
- concierge.yaml
- spread.yaml
Use this command to fix any missing license headers
```bash
docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix
</details>
skywalking-eyes requires license headers on all YAML files. artifacts.yaml, concierge.yaml, and spread.yaml were generated by `opcli artifacts init` and `opcli spread init` without headers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remove --charm-file from tests/conftest.py (opcli plugin registers it, causing argparse.ArgumentError: conflicting option string) - Remove charm_fixture from tests/integration/conftest.py (opcli plugin provides charm_path instead) - Update test_charm.py to use charm_path and resource_images fixtures from the opcli plugin and deploy the charm with its OCI image resource - Add upstream-source to artifacts.yaml so the build workflow pulls kennethreitz/httpbin for the httpbin-image resource - Add pytest-arguments-template to spread.yaml to pass --use-existing so the juju fixture connects to the concierge-provisioned model Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
opcli reads upstream-source from charmcraft.yaml directly. It does not belong in artifacts.yaml (see canonical/traefik-k8s-operator as reference). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The opcli pytest plugin does not provide resource_images for external (non-rock) OCI images. Instead, read upstream-source directly from charmcraft.yaml at module level (same pattern as canonical/traefik-k8s-operator reads from metadata.yaml). - conftest.py: add RESOURCES dict read from charmcraft.yaml resources - test_charm.py: use charm_path (opcli) + RESOURCES (charmcraft.yaml) - spread.yaml: use --model testing (concierge default model name) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace canonical/operator-workflows publish with charm-ci publish-artifacts.yml reusable workflow. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Per-charm channel declared in artifacts.yaml; workflow no longer needs to specify it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Importing from conftest.py is not good practice. Move the CHARMCRAFT and RESOURCES constants into test_charm.py where they are used. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tatus check, remove copilot-instructions - Update copyright year to 2026 in all new files added by this PR - Pin charm-ci to v0.0.1-alpha.5 in integration_test.yaml and publish_charm.yaml - Add required_status_checks job to integration_test.yaml (mirrors haproxy-operator pattern) - Remove .github/copilot-instructions.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
alithethird
approved these changes
Jun 26, 2026
seb4stien
approved these changes
Jun 26, 2026
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.
Summary
Migrates the CI pipeline from
canonical/operator-workflowstocanonical/charm-ci(opcli-based approach), covering both integration tests and charm publishing.Related https://github.com/canonical/canonical-repo-automation/pull/927
Changes
artifacts.yamlopcli artifacts init; declares charm, resources, and publish channelspread.yamlopcli spread init; declares integration test suiteconcierge.yaml.github/workflows/integration_test.yamlcharm-cireusable workflow + required status check job.github/workflows/publish_charm.yamlcharm-cipublish reusable workflowpyproject.toml/uv.lockopcli(pinned tov0.0.1-alpha.5) to integration dep group for pytest plugintests/integration/conftest.pycharm_fixture(replaced by opcli plugin'scharm_path); simplifiedjujufixturetests/integration/test_charm.pycharm_path(opcli) +RESOURCESfromcharmcraft.yamltests/conftest.py--charm-fileoption (now owned by opcli plugin)How it works
The new pipeline uses opcli:
build-artifacts.ymlbuilds the charm and uploads as a GitHub artifactintegration-test.ymlgenerates a spread matrix, provisions MicroK8s via concierge, and runstox -e integration -- --model testinginside spreadpublish-artifacts.ymlpublishes to CharmHub usingCHARMCRAFT_AUTH; channel (latest/edge) is declared inartifacts.yamlThe
charm_pathfixture is injected automatically by the opcli pytest plugin. OCI image resources are read fromupstream-sourceincharmcraft.yamlat test module level (same pattern ascanonical/traefik-k8s-operator).All charm-ci workflows are pinned to
v0.0.1-alpha.5.Local testing done
tox -e lint✅tox -e unit✅ (4/4 tests, 100% coverage)tox -e static✅opcli artifacts build✅ — builtplatform-engineering-charm-template_amd64.charmopcli spread expand✅ — spread config expands without errorsopcli spread jobs✅ — generates correct CI matrixopcli pytest expand✅ — confirmstox -e integration -- --model testingNotes
concierge.yaml(3.6/stable). For multi-version testing, add a second concierge file and override theCONCIERGEenv var inspread.yaml.required_status_checks) mirrors the pattern used incanonical/haproxy-operator.AI usage
This PR was prepared with GitHub Copilot assistance.