MCO1908: MCO-2387: Migrate MCO Upgrade TestCase#6211
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@ptalgulk01: This pull request references MCO-2387 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughAdds a new extended-privilege Ginkgo suite for MCO upgrade validation, covering node log checks, SSH key migration, controller-version annotations, CIS and Azure assertions, and managed boot image behavior. Adds an ARO cluster detection helper. ChangesMCO Upgrade Extended-Priv Test Suite
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 13 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (13 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)Command failed Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ptalgulk01 The full list of commands accepted by this bot can be found here. The pull request process is described 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.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/extended-priv/mco_upgrade.go`:
- Around line 339-340: In the logger.Warnf call, replace the
tmpConfigMap.PrettyString() parameter with a safer alternative that only
includes the ConfigMap's namespace and name along with the missing key
identifier, rather than exposing the full ConfigMap payload. This prevents
sensitive cluster metadata like machine set identifiers and boot-image details
from being exposed in CI logs while maintaining sufficient debugging context.
- Around line 33-34: The os.RemoveAll call on line 33 (and similar calls at
lines 108-109 and 139-140) return errors that are being ignored, which violates
the coding guideline to never ignore error returns. Capture the error returned
by os.RemoveAll(tmpdir) and handle it by checking if it is non-nil before
logging the success message, then either log the error or return it as
appropriate for cleanup failures. Apply the same error handling pattern to the
other two locations identified (around lines 108 and 139) to ensure all error
returns from cleanup and debug command invocations are properly handled.
- Around line 373-375: The defer statement for clonedMS.Delete() is registered
before the error validation from machineSet.Duplicate(), which means if the
duplication fails and clonedMS is invalid, the deferred cleanup will still
execute and potentially obscure the actual error. Move the defer
clonedMS.Delete() statement to appear after the
o.Expect(err).NotTo(o.HaveOccurred()) error check so that cleanup is only
registered after confirming the duplication was successful and clonedMS is a
valid object.
- Around line 46-48: The assertion on the getLogErr variable returned from the
GetMCDaemonLogs call has incorrect polarity and will incorrectly mask real
log-collection failures. The current
o.Expect(getLogErr).Should(o.HaveOccurred()) expects an error to occur, but this
should be checking that no error occurred during log retrieval. Change the
assertion to o.Expect(getLogErr).ShouldNot(o.HaveOccurred()) so that actual
log-collection failures are properly detected, while the subsequent errLog
assertion continues to validate that the specific transaction error is not
present in the logs.
- Around line 195-199: The jsonpath query in the test checking the MCO pod's
serviceAccountName only validates items[0], which fails to detect two issues: an
empty pod list would incorrectly pass the test, and multiple pods are not all
validated for the default serviceAccountName. Modify the jsonpath expression to
verify all pods returned do not use 'default', and add an assertion to ensure
the query result is not empty before checking the serviceAccountName values.
This ensures the test actually finds MCO pods and validates that none of them
are using the 'default' serviceAccountName.
In `@test/extended-priv/util.go`:
- Around line 542-545: The IsAROCluster function currently collapses all errors
from Exists() into a boolean false result, which silently treats transient API
failures as "not ARO" and can misroute the assertion logic. Modify IsAROCluster
to return both a boolean and an error instead of just a boolean, so that the
error from calling Exists() on the NewResource is explicitly surfaced to the
caller rather than being collapsed into the return value. This allows the call
site to explicitly check for and handle errors before making assertions based on
the cluster type.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: e5f271f1-8fd2-4e41-995a-fa23fc69c527
📒 Files selected for processing (2)
test/extended-priv/mco_upgrade.gotest/extended-priv/util.go
|
4.23 https://prow.ci.openshift.org/view/gs/test-platform-results/logs/periodic-ci-openshift-release-main-nightly-4.23-upgrade-from-stable-4.22-e2e-aws-upgrade-ovn-single-node/2069001257581809664 5.0 Result |
897d7f0 to
519809b
Compare
519809b to
5bb79d7
Compare
|
@ptalgulk01: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Migrate MCO upgrade tests from openshift-tests-private
Migrate 7 upgrade test IDs (9 test cases) from openshift-tests-private.
Tests validate MCO behavior during and after cluster upgrades.
Migrated test cases:
Added upgrade markers:
Tests run automatically in existing MCO upgrade CI jobs (e2e-aws-ovn-upgrade,
e2e-azure-ovn-upgrade, e2e-gcp-upgrade, etc.)
Summary by CodeRabbit