Skip to content

feat: run integration tests in CI#93

Open
jansdhillon wants to merge 17 commits intocanonical:mainfrom
jansdhillon:integration-ci
Open

feat: run integration tests in CI#93
jansdhillon wants to merge 17 commits intocanonical:mainfrom
jansdhillon:integration-ci

Conversation

@jansdhillon
Copy link
Copy Markdown
Contributor

jansdhillon and others added 17 commits March 25, 2026 12:32
…flow

The canonical/operator-workflows integration test calls tox -e integration,
but this repo uses uv run pytest directly (no tox config). It also includes
k8s/kubectl cleanup steps not needed for the lxd provider.

Replace with a standalone workflow that:
- Uses charmed-kubernetes/actions-operator for LXD + Juju setup
- Builds the charm with charmcraft
- Runs tests with uv run pytest directly

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
charmcraft pack --platform requires a matching LXD build environment and
the right tooling (charmcraftlocal, etc.) — that's all handled by build.yaml
already. Call build.yaml as a dependency and download the packed artifact.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
No --model flag, no manual juju add-model. The conftest uses
jubilant.temp_model() which handles model lifecycle automatically.
Command matches exactly what CONTRIBUTING.md documents.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When juju deploys a bundle, it copies the bundle file into its own snap
temp directory. Relative paths in the bundle are then resolved from there
instead of the original bundle location, causing lookups to fail.

Rewrite local charm paths to absolute before handing the bundle to
jubilant so they remain valid regardless of where juju copies the file.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The name_in_artifact field from data-platform-workflows only replaces ':'
with '-', preserving '@'. So the artifact is named
packed-charm-.--platform-ubuntu@24.04-amd64, not ubuntu-24.04-amd64.

Also use needs.build.outputs.artifact-prefix for correctness.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…osted

Self-hosted runner was arm64, causing haproxy constraint failures.
This is a public repo so ubuntu-latest is fine.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove the temp-file/absolute-path rewriting hack — unnecessary now that
the charm artifact lands at the workspace root and the bundle's relative
path resolves correctly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Juju copies the bundle YAML into its snap temp directory before parsing.
Relative charm paths are then resolved from that temp location rather than
the bundle's original directory, causing deploy failures. Writing a temp
bundle with absolute paths avoids this.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…atform name

The artifact is named with ubuntu@24.04 (@ not -), so the pattern must match
that exactly. Using the build job's artifact-prefix output ensures the prefix
also matches correctly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ate lbaas model

Previously the lbaas fixture ran before bundle was deployed (no dependency
chain), found landscape-server absent in the empty temp model, and skipped
all lbaas-dependent tests immediately.

- Add bundle as a fixture dependency so the bundle is deployed first
- Yield None when no separate LBaaS model is configured; tests that
  genuinely need cross-model haproxy skip themselves via their existing
  'lbaas is None' guards
- Tests that only need the co-deployed haproxy use _haproxy_ip() which
  already checks the local model first
- Remove unused auto-create-lbaas-model code path (only triggered via
  'make lbaas' with explicit env vars anyway)
- Remove unused has_haproxy_route_provider import and uuid import

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…idation failure

redirect_https=none generates a HAProxy rule that exceeds the 64-word line
limit, causing HAProxy to stay in 'waiting' state and the all_active wait
to time out. Use 'default' instead, which is the sane baseline for CI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Enable IPv4 forwarding and NAT masquerade so LXD containers can reach
the Ubuntu archive and Launchpad PPAs during charm install hooks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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