[WIP] CNTRLPLANE-2589: Migrate test/e2e-encryption-rotation to OpenShift Tests Extension framework#943
[WIP] CNTRLPLANE-2589: Migrate test/e2e-encryption-rotation to OpenShift Tests Extension framework#943ropatil010 wants to merge 2 commits into
Conversation
…mework
Migrate encryption rotation tests to support both standard Go tests
and Ginkgo/OTE framework.
Changes:
1. Add Ginkgo test wrapper for OTE compatibility (encryption_rotation.go)
2. Simplify e2e-encryption-rotation_test.go to call shared test function
3. Register new test suite in main.go
4. Use library.AuthTargetGRs and library.AssertTokens from vendor
The test now works in both modes:
- Standard Go: TestEncryptionRotation(t *testing.T)
- Ginkgo/OTE: g.It(..., func(ctx) { testEncryptionRotation(ctx, g.GinkgoTB()) })
Co-Authored-By: Rohit Patil <ropatil@redhat.com>
|
@ropatil010: This pull request references CNTRLPLANE-2589 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 epic 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 (1)
WalkthroughThe encryption-rotation E2E test now uses a shared library-based scenario, and the operator test binary registers that scenario as a new serial suite filtered for encryption-rotation tests. ChangesEncryption rotation E2E wiring
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant GinkgoTest as Ginkgo test
participant Library as library.TestEncryptionRotation
participant Operator as cluster-authentication-operator
participant OAuthAPIServer as oauth apiserver
GinkgoTest->>Library: run RotationScenario
Library->>OAuthAPIServer: create and read token resources
Library->>Operator: update unsupportedConfigOverrides
Operator->>OAuthAPIServer: apply new encryption config
Library->>OAuthAPIServer: wait for next key rotation
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 13 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (13 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[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.
🧹 Nitpick comments (1)
test/e2e-encryption-rotation/encryption_rotation.go (1)
34-34: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueDrop unnecessary
fmt.Sprintf.
fmt.Sprintf("encryption-config-openshift-oauth-apiserver")has no format directives — use the string literal directly.♻️ Proposed fix
- EncryptionConfigSecretName: fmt.Sprintf("encryption-config-openshift-oauth-apiserver"), + EncryptionConfigSecretName: "encryption-config-openshift-oauth-apiserver",🤖 Prompt for 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. In `@test/e2e-encryption-rotation/encryption_rotation.go` at line 34, The EncryptionConfigSecretName assignment in encryption_rotation.go uses fmt.Sprintf with a ثابت string and no format directives, so remove the unnecessary formatting call and set the value directly as a string literal in the encryption rotation test setup.
🤖 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.
Nitpick comments:
In `@test/e2e-encryption-rotation/encryption_rotation.go`:
- Line 34: The EncryptionConfigSecretName assignment in encryption_rotation.go
uses fmt.Sprintf with a ثابت string and no format directives, so remove the
unnecessary formatting call and set the value directly as a string literal in
the encryption rotation test setup.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 710b9106-e365-4389-abee-d1015241063d
📒 Files selected for processing (3)
cmd/cluster-authentication-operator-tests-ext/main.gotest/e2e-encryption-rotation/e2e-encryption-rotation_test.gotest/e2e-encryption-rotation/encryption_rotation.go
|
@ropatil010: The following tests failed, say
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. |
Hi Team,
Migrate encryption rotation tests to support both standard Go tests and Ginkgo/OTE framework.
Changes:
The test now works in both modes:
Summary by CodeRabbit
New Features
Tests