🌱 Add e2e regression test for cross-CE collision protection#2783
🌱 Add e2e regression test for cross-CE collision protection#2783perdasilva wants to merge 1 commit into
Conversation
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[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 |
There was a problem hiding this comment.
Pull request overview
Adds an end-to-end regression scenario to ensure cross-ClusterExtension “collision protection” works (a second ClusterExtension targeting an already-installed bundle cannot take over resources), and extends the godog step library to make multi-CE assertions readable and robust.
Changes:
- Adds a new e2e scenario covering duplicate ClusterExtension installs and verifies original ownership is retained.
- Extends step definitions with named ClusterExtension condition assertions, a ClusterObjectSet ownership-count assertion, and a
${PREV_NAME}template variable to reference a previously-applied CE. - Refactors message-fragment matching into a shared helper and changes template expansion to preserve unknown
${KEY}variables literally.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/e2e/steps/steps.go | Adds named CE steps, COS ownership-count step, ${PREV_NAME} support, message-fragment helper, and preserves unresolved template variables. |
| test/e2e/steps/hooks.go | Extends scenario context to track previousClusterExtensionName. |
| test/e2e/features/update.feature | Adds a new regression scenario validating cross-CE collision protection behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Verify that a second ClusterExtension targeting an already-installed
bundle cannot take over resources from the original owner, even with a
higher-revision ClusterObjectSet.
Changes:
- Add ${PREV_NAME} template variable, populated by
TrackCurrentClusterExtensionForCleanup, to reference the original CE
after ResourceIsApplied overwrites ${NAME}.
- Add named CE condition steps (NamedClusterExtensionReportsCondition,
NamedClusterExtensionReportsConditionWithMessageFragment) so step
descriptions explicitly identify which CE is being asserted.
- Add ClusterExtensionOwnsClusterObjectSets step to verify the number
of ClusterObjectSets owned by a named CE.
- Extract messageFragmentComparison helper to deduplicate the
fragment-matching closure across three callers.
- Guard TrackCurrentClusterExtensionForCleanup against double-calls.
- Preserve unresolved template variables as literal ${KEY} instead of
silently substituting empty string.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
943273a to
a29cdef
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2783 +/- ##
==========================================
+ Coverage 70.40% 70.46% +0.05%
==========================================
Files 143 143
Lines 10617 10617
==========================================
+ Hits 7475 7481 +6
+ Misses 2580 2577 -3
+ Partials 562 559 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
${PREV_NAME}template variable to reference the original CE afterResourceIsAppliedoverwrites${NAME}, avoiding leaking the internalce-${SCENARIO_ID}naming convention into feature files.NamedClusterExtensionReportsCondition,NamedClusterExtensionReportsConditionWithMessageFragment) so step descriptions explicitly identify which CE is being asserted.ClusterExtensionOwnsClusterObjectSetsstep to verify the number of ClusterObjectSets owned by a named CE.messageFragmentComparisonhelper to deduplicate the fragment-matching closure acrossClusterExtensionReportsConditionWithMessageFragment,ClusterObjectSetReportsConditionWithMessageFragment, and the new named variant.TrackCurrentClusterExtensionForCleanupagainst accidental double-calls.${KEY}instead of silently substituting empty string.Test plan
go vetpasses🤖 Generated with Claude Code