Skip to content

Expand e2e tests to cover specific upgrade bugs - #1013

Open
mallardduck wants to merge 4 commits into
rancher:mainfrom
mallardduck:e2e-regression-expansion
Open

Expand e2e tests to cover specific upgrade bugs#1013
mallardduck wants to merge 4 commits into
rancher:mainfrom
mallardduck:e2e-regression-expansion

Conversation

@mallardduck

Copy link
Copy Markdown
Member

No description provided.

@mallardduck
mallardduck requested a review from a team as a code owner July 7, 2026 18:49
@mallardduck
mallardduck requested a review from Copilot July 7, 2026 19:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the end-to-end testing setup by adding a new isolated “upgrade/regression” e2e suite (starting with upgrade-metrics) to reproduce specific upgrade bugs against an older release and validate the fix with the current in-process operator.

Changes:

  • Add e2e/upgrade-metrics Ginkgo suite that spins up its own k3d cluster and includes a regression test for a nil Restore.Spec.Prune metrics crash scenario.
  • Restructure shared e2e fixtures into e2e/fixtures/testdata and update backup e2e tests to consume them.
  • Adjust local vs CI command execution (Makefile) and update e2e runner and Helm packaging tag handling.

Reviewed changes

Copilot reviewed 14 out of 28 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
scripts/package-helm Updates build-chart tag substitution to replace tag: v0.0.0-dev instead of %TAG%.
scripts/e2e Runs all e2e packages with exported env vars and go test -p 2 parallelism.
Makefile Runs via Docker locally only for specific targets (instead of all targets).
e2e/upgrade-metrics/testdata/metrics/restore-nil-prune.yaml Adds test Restore fixture with omitted prune field.
e2e/upgrade-metrics/suite_test.go Adds isolated k3d cluster lifecycle + client/chart setup for upgrade-metrics suite.
e2e/upgrade-metrics/README.md Documents upgrade/regression suite conventions and usage.
e2e/upgrade-metrics/metrics_test.go Adds regression test covering nil prune metrics crash in older version and verifies current behavior.
e2e/upgrade-metrics/helpers_test.go Adds Helm install/uninstall helpers + cleanup utilities for upgrade suite.
e2e/README.md Documents mixed isolation strategies (shared backup vs isolated upgrade suites) and parallel execution.
e2e/fixtures/testdata/restore/preserve-unknown-fields/customresourcedefinitions.apiextensions.k8s.io#v1/clusteralerts.management.cattle.io.json Adds restore fixture content for preserve-unknown-fields scenario.
e2e/fixtures/testdata/restore/preserve-unknown-fields.tar.gz Adds preserve-unknown-fields backup tar fixture.
e2e/fixtures/testdata/restore/encrypted-resources/secrets.#v1/application/application.json Adds encrypted-resources fixture content.
e2e/fixtures/testdata/restore/encrypted-resources/namespaces.#v1/application.json Adds encrypted-resources fixture content.
e2e/fixtures/testdata/restore/encrypted-resources.tar.gz Adds encrypted-resources backup tar fixture.
e2e/fixtures/testdata/restore/deletion-grace-period-seconds/secrets.#v1/cattle-delete/secret-delete.json Adds deletion-grace-period-seconds fixture content.
e2e/fixtures/testdata/restore/deletion-grace-period-seconds/namespaces.#v1/cattle-delete.json Adds deletion-grace-period-seconds fixture content.
e2e/fixtures/testdata/restore/deletion-grace-period-seconds.tar.gz Adds deletion-grace-period-seconds backup tar fixture.
e2e/fixtures/testdata/rancher-resource-set-full.yaml Adds full ResourceSet YAML fixture.
e2e/fixtures/testdata/rancher-resource-set-basic.yaml Adds basic ResourceSet YAML fixture.
e2e/fixtures/testdata/public.crt Adds a certificate fixture file.
e2e/fixtures/testdata/private.key Adds a private key fixture file.
e2e/fixtures/testdata/encryption.yaml Adds apiserver encryption config fixture.
e2e/fixtures/test.go Renames package to fixtures and switches embed root to testdata/.
e2e/backup/setup_test.go Switches from e2e/test to e2e/fixtures helper import and usage.
e2e/backup/restore_test.go Switches from e2e/test to e2e/fixtures helper import and usage.
e2e/backup/backup_test.go Switches from e2e/test to e2e/fixtures helper import and usage.
charts/rancher-backup/values.yaml Sets a valid default image tag (v0.0.0-dev) instead of %TAG%.
.gitignore Ignores downloaded rancher-backup-*.tgz artifacts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread e2e/upgrade-metrics/suite_test.go
Comment thread e2e/upgrade-metrics/helpers_test.go
Comment thread e2e/upgrade-metrics/helpers_test.go
Comment thread Makefile
Comment thread e2e/upgrade-metrics/README.md
Comment thread e2e/upgrade-metrics/README.md
- Introduced a reusable `scripts/e2e` script for running e2e tests locally and in CI.
- Added restore tests to verify CRD default behavior for the Prune field and backward compatibility.
- Included a unit test for `FmtVersionInfo` in the version package.

Signed-off-by: Dan Pock <self@danpock.me>
@mallardduck
mallardduck force-pushed the e2e-regression-expansion branch from e1d22cd to 0229d34 Compare July 8, 2026 16:50
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.

2 participants