Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 24, 2025

Description

The charm-e2e-tests.yaml workflow contains numerous bash steps that are difficult to reproduce locally and maintain.

Solution

Introduced k8s-ci charm integration-test command that encapsulates workflow logic:

New CLI command (ci/cmds/charm.py):

  • Configures LXD, creates snap tarball, installs tooling (charmcraft/juju)
  • Downloads charms, bootstraps Juju controller, clones k8s-operator
  • Executes integration tests with tox
  • Collects debug artifacts on failure
  • Adds timeout protection (600s default, configurable/unlimited for tests)

Workflow simplification (.github/workflows/charm-e2e-tests.yaml):

  • Reduced from 160 to 101 lines by replacing 6+ bash steps with single CLI invocation
  • Updated Python 3.10 → 3.12

Usage:

tox -e k8s-ci -- charm integration-test \
  --k8s-snap-path "/path/to/k8s.snap" \
  --charm-channel "latest/edge" \
  --arch "amd64" \
  --k8s-operator-ref "main" \
  --workspace "$PWD"

Issue

N/A

Backport

No backport needed - CI tooling change only.

Checklist

  • PR title formatted as type: title
  • Covered by unit tests - Not applicable, CLI integration command
  • Covered by integration tests - Command runs existing integration tests
  • Documentation updated - CLI self-documenting via --help
  • CLA signed
  • Backport label added if necessary - N/A
Original prompt

We have an existing workflow "charm-e2e-tests.yaml". That executes the k8s-snap in the k8s-operator context.

This contains a lot of bash steps and is hard to reproduce/run locally.

Refactor this workflow to use the k8s-ci charm CLI. It should create a new k8s-ci charm integration-test with the necessary flags (k8s-snap-path etc)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Refactor charm-e2e-tests workflow to use k8s-ci charm CLI ci: refactor charm-e2e-tests workflow to use k8s-ci CLI Nov 24, 2025
Copilot AI requested a review from bschimke95 November 24, 2025 14:04
Copilot finished work on behalf of bschimke95 November 24, 2025 14:04
@ethandcosta
Copy link
Contributor

nice refactor, LGTM

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.

3 participants