Repository navigation
Conversation
The existing suites, and the upgrade scenarios built on them, test a clean
installation. This adds a small Ginkgo suite, test/openshift/e2e/ginkgo/upgrade,
that upgrades an installation which is in use:
1. install the operator from PREVIOUS_CHANNEL
2. apply config/*.yaml, which turns on as many features as it can
3. check every feature works
4. upgrade to NEW_CHANNEL
5. run the same checks again, and check that no configured value was
removed or changed and that workload pods were not restarted
The suite installs the operator itself, so it needs a cluster without it.
PREVIOUS_VERSION and NEW_VERSION optionally pin exact versions; the
Subscription uses manual approval and the test approves each InstallPlan.
Run with:
PREVIOUS_CHANNEL=gitops-1.21 NEW_CHANNEL=gitops-1.22 make e2e-tests-upgrade-ginkgo
This is a proof of concept: simple on purpose, with little reuse.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With PREVIOUS_VERSION=1.21.4 the suite approved the plan for 1.21.4 and then, before that CSV had finished installing, the plan OLM offered next for 1.21.5. The operator went past the pin and the install step timed out waiting for 1.21.4. Stop approving once the plan that installs the target is approved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In CI mode the e2e fixture finds the operator Subscription by the prefix gitops-operator-. Under the suite's own name, openshift-gitops-operator, every suite run on the cluster after the upgrade found nothing: on the 1.20.9 upgrade run, 17 sequential and 2 parallel specs failed at fixture.go:456 with a nil Subscription. SUBSCRIPTION_NAME lets the harness pick a name its other suites find; the default is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
redhat-developer#1334 renamed github.com/argoproj-labs/gitops-operator/argocd-operator to github.com/redhat-developer/gitops-operator/argocd-operator; the upgrade suite was written before it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
What does this PR do?
Adds an e2e suite that upgrades a configured installation of the operator, not a clean one.
Our e2e suites, and the upgrade tests built on them, all start from a clean installation: install, upgrade to another clean installation, run the tests. Customers don't upgrade clean installations, and upgrades are where we keep getting hit.
The new Ginkgo suite,
test/openshift/e2e/ginkgo/upgrade, runs one ordered scenario:PREVIOUS_CHANNEL.config/*.yaml, which turns on as many features as it can.NEW_CHANNEL..specof any object inconfig/was removed or changed;It needs a cluster-admin login to an OpenShift cluster with three nodes, a CatalogSource that contains both channels, and no GitOps Operator installed, because the suite installs it itself.
CATALOG_SOURCEredhat-operators)PREVIOUS_VERSION,NEW_VERSIONSUBSCRIPTION_NAMEWhere to look
upgrade_test.goconfig/*.yamlfeatures_test.goverifyFeatures: one check per feature, run before and after the upgradeolm_test.goREADME.mdFeatures covered today:
ARGOCD_CLUSTER_CONFIG_NAMESPACES, and managed namespaces.openshift-gitops.Adding a feature takes one YAML change and one check.
PR acceptance criteria:
make serve-docs: not applicable. The suite's README lives next to it, like the other e2e suites.What type of PR is this?
/kind enhancement
Special notes to the reviewer:
These are the design choices most worth arguing about:
InstallPlans are always approved manually. The suite approves each plan itself. That's the only way to stop at a pinned version, and doing it every time keeps a single code path. It stops approving once the plan that installs the target has been approved.
The upgrade target comes from the catalog. The suite reads the channel head from the PackageManifest and approves plans until that CSV is installed. Following the Subscription's state stopped one hop early (1.21.5 → 1.22.0, when the head was 1.22.1).
"Configuration unchanged" allows additions. 1.22 adds empty
commitServerandsourceHydratorfields to the default instance's spec, and a strict comparison fails on those. So the check fails only on a removed or changed value, and prints any additions."Rolled out" means running the operator's own image. After the CSV succeeds, the suite waits until both instances run the image named in the operator Deployment's
ARGOCD_IMAGE.The suite never cleans up. A cluster where the suite failed stays as it is, for inspection. The README has the commands to reset one, in an order that matters.
A harness that runs other suites afterwards on the same cluster has to remove the fixture itself. Our downstream release testing does this. Without that step, the cluster-scoped RolloutManager the suite leaves behind made 1-100, 1-101 and 1-121 fail.
The suite stops at the first failure, so a failed step skips the steps after it.
How it has been run, always on OpenShift 4.22 on GCP:
redhat-operatorsredhat-operatorsmaster. The last commit only follows the inner module rename from fix: Rename inner module from argoproj-labs to redhat-developer #1334.go vetandgofmtare clean on the rebased branch. The suite has not been run again since the rebase.🤖 Generated with Claude Code