-
Notifications
You must be signed in to change notification settings - Fork 41
[WIP]CNTRLPLANE-2260:test/e2e: migrate tokenreviews test to OTE framework #163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: wangke19 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 |
This commit introduces the OpenShift Tests Extension (OTE) framework infrastructure for the OAuth API Server tests. Changes: - Refactor cmd/oauth-apiserver-tests-ext/main.go to use proper error handling pattern with error returns instead of direct exits - Add prepareOperatorTestsRegistry with OTE extension configuration The error handling pattern now follows Go best practices by returning errors from functions and handling them in the caller, making the code more testable and maintainable. Note: Test package imports and oteginkgo.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite() will be added in subsequent PRs when actual tests are migrated to the OTE framework.
807dc5a to
0a198b1
Compare
|
@wangke19: This pull request references CNTRLPLANE-2260 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 task to target the "4.22.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. |
Add Ginkgo wrapper for the tokenreviews test to enable execution through the OpenShift Tests Extension (OTE) framework. Changes: - Add test/e2e/oauth_token.go with Ginkgo test wrapper - Update cmd/oauth-apiserver-tests-ext/main.go to register Ginkgo tests - Import test package and OTE ginkgo utilities - Call oteginkgo.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite() - Add test specs to extension with extension.AddSpecs() The original TestTokenReviews function in tokenreviews.go remains unchanged and can still be run with standard go test.
Add dependencies required for OTE test execution: - github.com/onsi/ginkgo/v2 v2.24.0 (with replace to OpenShift fork) - github.com/onsi/gomega v1.38.0 - Additional transitive dependencies for Ginkgo and OTE support Updates: - go.mod: Add Ginkgo dependency - go.sum: Update checksums - vendor/: Vendor all dependencies (257 new files)
0a198b1 to
044a5c7
Compare
|
@wangke19: This pull request references CNTRLPLANE-2260 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 task to target the "4.22.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. |
|
@wangke19: 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. |
Summary
Migrate the
tokenreviewse2e test to OpenShift Tests Extension (OTE) framework while keeping the original test unchanged.This PR contains exactly 2 commits following the required structure:
Commit Structure
Commit 1: Infrastructure code changes only
Commit:
test/e2e: add OTE test wrapper for tokenreviewsChanges:
test/e2e/oauth_token.gowith Ginkgo test wrappercmd/oauth-apiserver-tests-ext/main.goto register Ginkgo tests_ "github.com/openshift/oauth-apiserver/test/e2e"oteginkgo "github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo"oteginkgo.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite()extension.AddSpecs(testSpecs)to add test specsFiles changed: 2 files
cmd/oauth-apiserver-tests-ext/main.go(modified)test/e2e/oauth_token.go(new)Commit 2: Dependency updates
Commit:
go.mod, vendor: add Ginkgo and OTE dependenciesChanges:
github.com/onsi/ginkgo/v2 v2.24.0to go.mod (with replace directive to OpenShift fork)go.sumwith checksumsFiles changed: 259 files
go.mod(modified)go.sum(modified)vendor/(257 new files)Test Structure
Implementation Details
oauth_token.go
testTokenReviewsGinkgo()testing.TBinterface for dual compatibility*testing.Twhen calling existing helper functionstokenreviews.gomain.go updates
oteginkgo.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite()to build test specsextension.AddSpecs(testSpecs)Unchanged Files
test/e2e/tokenreviews.go- Original test remains completely unchangedOTE Discovery
After merging, the OTE binary will discover this test as:
Verification Commands
Pattern Reference
testing.TBinterface for compatibilityDependencies
Related
~/foothold-ai/OTE_GO_TEST_MIGRATION_GUIDE.md