Skip to content

Conversation

@wangke19
Copy link
Contributor

@wangke19 wangke19 commented Dec 23, 2025

Summary

Migrate the tokenreviews e2e test to OpenShift Tests Extension (OTE) framework while keeping the original test unchanged.

⚠️ IMPORTANT: This PR depends on #162 and should be merged after it.

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 tokenreviews

Changes:

  • Add test/e2e/e2e.go with Ginkgo test wrapper
  • Add cmd/oauth-apiserver-tests-ext/dependencymagnet.go to register test imports
  • Update cmd/oauth-apiserver-tests-ext/main.go with OTE registry configuration
    • Add prepareOperatorTestsRegistry() with detailed documentation
    • Configure test suite with extension.AddSuite() for component/serial tests
    • Call oteginkgo.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite() to build test specs
    • Use extension.AddSpecs(specs) to register test specs

Files changed: 3 files

  • cmd/oauth-apiserver-tests-ext/main.go (modified)
  • cmd/oauth-apiserver-tests-ext/dependencymagnet.go (new)
  • test/e2e/e2e.go (new)

Commit 2: Dependency updates

Commit: go.mod, vendor: add Ginkgo and OTE dependencies

Changes:

  • Add github.com/onsi/ginkgo/v2 v2.24.0 to go.mod (with replace directive to OpenShift fork)
  • Update go.sum with checksums
  • Vendor all dependencies (257 new files)

Files changed: 259 files

  • go.mod (modified)
  • go.sum (modified)
  • vendor/ (257 new files)

Test Structure

var _ = g.Describe("[sig-auth] OAuth", func() {
    g.It("should successfully review valid and invalid tokens [apigroup:oauth.openshift.io]", func(ctx context.Context) {
        testTokenReviewsGinkgo(g.GinkgoTB())
    })
})

Implementation Details

dependencymagnet.go

  • Imports test packages to register Ginkgo tests
  • Ensures tests are included in the build
  • Follows the pattern from other OpenShift operators

e2e.go

  • Ginkgo wrapper that calls testTokenReviewsGinkgo()
  • Uses testing.TB interface for dual compatibility
  • Type asserts to *testing.T when calling existing helper functions
  • Reuses all existing test logic from tokenreviews.go

main.go updates

  • Added AddSuite configuration for component/serial test suite
  • Suite name: openshift/oauth-apiserver/component/serial
  • Qualifiers: [Component] and [Serial] tags
  • Parallelism: 1 (serial execution)

Unchanged Files

  • test/e2e/tokenreviews.go - Original test remains completely unchanged

OTE Discovery

After merging, the OTE binary will discover this test as:

[sig-auth] OAuth should successfully review valid and invalid tokens [apigroup:oauth.openshift.io]

Verification Commands

# Build OTE binary
make build

# Verify dependencies
make verify-deps

# List discovered tests
./oauth-apiserver-tests-ext list

# Run the test
./oauth-apiserver-tests-ext run-suite <suite-path> -c 1

Pattern Reference

  • Follows OpenShift OTE migration best practices
  • Two-commit structure: infrastructure first, dependencies second
  • No modifications to original test files
  • Uses testing.TB interface for compatibility
  • Separates test imports into dependencymagnet.go file

Dependencies

Related

@openshift-ci
Copy link

openshift-ci bot commented Dec 23, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wangke19
Once this PR has been reviewed and has the lgtm label, please assign p0lyn0mial for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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.
@wangke19 wangke19 force-pushed the ote-migrate-tokenreviews-test branch from 807dc5a to 0a198b1 Compare December 23, 2025 13:16
@wangke19 wangke19 changed the title test/e2e: migrate tokenreviews test to OTE framework [WIP]test/e2e: migrate tokenreviews test to OTE framework Dec 23, 2025
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 23, 2025
@wangke19 wangke19 changed the title [WIP]test/e2e: migrate tokenreviews test to OTE framework [WIP]CNTRLPLANE-2260:test/e2e: migrate tokenreviews test to OTE framework Dec 23, 2025
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Dec 23, 2025

@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.

Details

In response to this:

Summary

Migrate the tokenreviews e2e test to OpenShift Tests Extension (OTE) framework while keeping the original test unchanged.

⚠️ IMPORTANT: This PR depends on #162 and should be merged after it.

Changes

New Files

  • test/e2e/oauth_token.go: Ginkgo wrapper for OTE framework
  • Contains testTokenReviewsGinkgo() function that delegates to original test helpers
  • Uses testing.TB interface for compatibility
  • Type asserts to *testing.T when calling existing helper functions
  • Properly structured with var _ = g.Describe() pattern for OTE discovery

Modified Files

  • cmd/oauth-apiserver-tests-ext/main.go:

  • Import test package: _ "github.com/openshift/oauth-apiserver/test/e2e"

  • Import OTE ginkgo: oteginkgo "github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo"

  • Call oteginkgo.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite() to register tests

  • Use extension.AddSpecs(testSpecs) to add test specs to extension

  • go.mod:

  • Add github.com/onsi/ginkgo/v2 v2.24.0 (with replace directive to OpenShift fork)

  • Dependencies vendored

Unchanged Files

  • test/e2e/tokenreviews.go: ✅ Original test remains completely unchanged

Test Structure

var _ = g.Describe("[sig-auth] OAuth", func() {
   g.It("should successfully review valid and invalid tokens [apigroup:oauth.openshift.io]", func(ctx context.Context) {
       testTokenReviewsGinkgo(g.GinkgoTB())
   })
})

OTE Discovery

After merging, the OTE binary will discover this test as:

[sig-auth] OAuth should successfully review valid and invalid tokens [apigroup:oauth.openshift.io]

Verification Commands

# Build OTE binary
make build

# List discovered tests
./oauth-apiserver-tests-ext list

# Run the test
./oauth-apiserver-tests-ext run-suite <suite-path> -c 1

Migration Pattern

  • Follows OpenShift OTE migration best practices
  • Uses testing.TB interface for dual compatibility
  • No modifications to original test files
  • Type assertion used for compatibility with existing *testing.T helpers

Files Changed

  • test/e2e/oauth_token.go (new, 87 lines)
  • cmd/oauth-apiserver-tests-ext/main.go (modified)
  • go.mod (modified)
  • vendor/ (259 new files for Ginkgo and dependencies)

Commits

Single commit on top of PR #162:

  • test/e2e: migrate tokenreviews test to OTE framework

Dependencies

Related

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.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Dec 23, 2025
@wangke19 wangke19 force-pushed the ote-migrate-tokenreviews-test branch from 0a198b1 to 044a5c7 Compare December 23, 2025 13:45
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Dec 23, 2025

@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.

Details

In response to this:

Summary

Migrate the tokenreviews e2e test to OpenShift Tests Extension (OTE) framework while keeping the original test unchanged.

⚠️ IMPORTANT: This PR depends on #162 and should be merged after it.

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 tokenreviews

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: _ "github.com/openshift/oauth-apiserver/test/e2e"
  • Import OTE ginkgo: oteginkgo "github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo"
  • Call oteginkgo.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite()
  • Use extension.AddSpecs(testSpecs) to add test specs

Files 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 dependencies

Changes:

  • Add github.com/onsi/ginkgo/v2 v2.24.0 to go.mod (with replace directive to OpenShift fork)
  • Update go.sum with checksums
  • Vendor all dependencies (257 new files)

Files changed: 259 files

  • go.mod (modified)
  • go.sum (modified)
  • vendor/ (257 new files)

Test Structure

var _ = g.Describe("[sig-auth] OAuth", func() {
   g.It("should successfully review valid and invalid tokens [apigroup:oauth.openshift.io]", func(ctx context.Context) {
       testTokenReviewsGinkgo(g.GinkgoTB())
   })
})

Implementation Details

oauth_token.go

  • Ginkgo wrapper that calls testTokenReviewsGinkgo()
  • Uses testing.TB interface for dual compatibility
  • Type asserts to *testing.T when calling existing helper functions
  • Reuses all existing test logic from tokenreviews.go

main.go updates

  • Imports test package to trigger Ginkgo test registration
  • Calls oteginkgo.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite() to build test specs
  • Adds specs to extension using extension.AddSpecs(testSpecs)

Unchanged Files

  • test/e2e/tokenreviews.go - Original test remains completely unchanged

OTE Discovery

After merging, the OTE binary will discover this test as:

[sig-auth] OAuth should successfully review valid and invalid tokens [apigroup:oauth.openshift.io]

Verification Commands

# Build OTE binary
make build

# Verify dependencies
make verify-deps

# List discovered tests
./oauth-apiserver-tests-ext list

# Run the test
./oauth-apiserver-tests-ext run-suite <suite-path> -c 1

Pattern Reference

  • Follows OpenShift OTE migration best practices
  • Two-commit structure: infrastructure first, dependencies second
  • No modifications to original test files
  • Uses testing.TB interface for compatibility

Dependencies

Related

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.

This commit adds the OpenShift Tests Extension (OTE) Ginkgo test wrapper
for the tokenreviews test, including:

- test/e2e/e2e.go: Ginkgo wrapper for the token review test
- cmd/oauth-apiserver-tests-ext/main.go: Updated OTE registry configuration
  with AddSuite for component/serial tests
- cmd/oauth-apiserver-tests-ext/dependencymagnet.go: Import registration
  for Ginkgo tests

The test is tagged with [sig-auth] and [apigroup:oauth.openshift.io] to
ensure proper test organization and execution within the OTE framework.
This commit adds the required dependencies for the OTE test framework:

- Ginkgo v2.24.0 (via OpenShift fork)
- Gomega v1.36.2
- OpenShift Tests Extension packages

All dependencies are vendored to ensure reproducible builds.
@wangke19 wangke19 force-pushed the ote-migrate-tokenreviews-test branch from 044a5c7 to 8c4d1ed Compare December 26, 2025 03:32
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Dec 26, 2025

@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.

Details

In response to this:

Summary

Migrate the `tokenreviews` e2e test to OpenShift Tests Extension (OTE) framework while keeping the original test unchanged.

⚠️ IMPORTANT: This PR depends on #162 and should be merged after it.

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 tokenreviews`

Changes:

  • Add `test/e2e/e2e.go` with Ginkgo test wrapper
  • Add `cmd/oauth-apiserver-tests-ext/dependencymagnet.go` to register test imports
  • Update `cmd/oauth-apiserver-tests-ext/main.go` with OTE registry configuration
  • Add `prepareOperatorTestsRegistry()` with detailed documentation
  • Configure test suite with `extension.AddSuite()` for component/serial tests
  • Call `oteginkgo.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite()` to build test specs
  • Use `extension.AddSpecs(specs)` to register test specs

Files changed: 3 files

  • `cmd/oauth-apiserver-tests-ext/main.go` (modified)
  • `cmd/oauth-apiserver-tests-ext/dependencymagnet.go` (new)
  • `test/e2e/e2e.go` (new)

Commit 2: Dependency updates

Commit: `go.mod, vendor: add Ginkgo and OTE dependencies`

Changes:

  • Add `github.com/onsi/ginkgo/v2 v2.24.0` to go.mod (with replace directive to OpenShift fork)
  • Update `go.sum` with checksums
  • Vendor all dependencies (257 new files)

Files changed: 259 files

  • `go.mod` (modified)
  • `go.sum` (modified)
  • `vendor/` (257 new files)

Test Structure

```go
var _ = g.Describe("[sig-auth] OAuth", func() {
g.It("should successfully review valid and invalid tokens [apigroup:oauth.openshift.io]", func(ctx context.Context) {
testTokenReviewsGinkgo(g.GinkgoTB())
})
})
```

Implementation Details

dependencymagnet.go

  • Imports test packages to register Ginkgo tests
  • Ensures tests are included in the build
  • Follows the pattern from other OpenShift operators

e2e.go

  • Ginkgo wrapper that calls `testTokenReviewsGinkgo()`
  • Uses `testing.TB` interface for dual compatibility
  • Type asserts to `*testing.T` when calling existing helper functions
  • Reuses all existing test logic from `tokenreviews.go`

main.go updates

  • Added `AddSuite` configuration for component/serial test suite
  • Suite name: `openshift/oauth-apiserver/component/serial`
  • Qualifiers: `[Component]` and `[Serial]` tags
  • Parallelism: 1 (serial execution)

Unchanged Files

  • ✅ `test/e2e/tokenreviews.go` - Original test remains completely unchanged

OTE Discovery

After merging, the OTE binary will discover this test as:
```
[sig-auth] OAuth should successfully review valid and invalid tokens [apigroup:oauth.openshift.io]
```

Verification Commands

```bash

Build OTE binary

make build

Verify dependencies

make verify-deps

List discovered tests

./oauth-apiserver-tests-ext list

Run the test

./oauth-apiserver-tests-ext run-suite -c 1
```

Pattern Reference

  • Follows OpenShift OTE migration best practices
  • Two-commit structure: infrastructure first, dependencies second
  • No modifications to original test files
  • Uses `testing.TB` interface for compatibility
  • Separates test imports into `dependencymagnet.go` file

Dependencies

Related

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.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Dec 26, 2025

@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.

Details

In response to this:

Summary

Migrate the `tokenreviews` e2e test to OpenShift Tests Extension (OTE) framework while keeping the original test unchanged.

⚠️ IMPORTANT: This PR depends on #162 and should be merged after it.

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 tokenreviews`

Changes:

  • Add `test/e2e/e2e.go` with Ginkgo test wrapper
  • Add `cmd/oauth-apiserver-tests-ext/dependencymagnet.go` to register test imports
  • Update `cmd/oauth-apiserver-tests-ext/main.go` with OTE registry configuration
  • Add `prepareOperatorTestsRegistry()` with detailed documentation
  • Configure test suite with `extension.AddSuite()` for component/serial tests
  • Call `oteginkgo.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite()` to build test specs
  • Use `extension.AddSpecs(specs)` to register test specs

Files changed: 3 files

  • `cmd/oauth-apiserver-tests-ext/main.go` (modified)
  • `cmd/oauth-apiserver-tests-ext/dependencymagnet.go` (new)
  • `test/e2e/e2e.go` (new)

Commit 2: Dependency updates

Commit: `go.mod, vendor: add Ginkgo and OTE dependencies`

Changes:

  • Add `github.com/onsi/ginkgo/v2 v2.24.0` to go.mod (with replace directive to OpenShift fork)
  • Update `go.sum` with checksums
  • Vendor all dependencies (257 new files)

Files changed: 259 files

  • `go.mod` (modified)
  • `go.sum` (modified)
  • `vendor/` (257 new files)

Test Structure

var _ = g.Describe("[sig-auth] OAuth", func() {
   g.It("should successfully review valid and invalid tokens [apigroup:oauth.openshift.io]", func(ctx context.Context) {
       testTokenReviewsGinkgo(g.GinkgoTB())
   })
})

Implementation Details

dependencymagnet.go

  • Imports test packages to register Ginkgo tests
  • Ensures tests are included in the build
  • Follows the pattern from other OpenShift operators

e2e.go

  • Ginkgo wrapper that calls `testTokenReviewsGinkgo()`
  • Uses `testing.TB` interface for dual compatibility
  • Type asserts to `*testing.T` when calling existing helper functions
  • Reuses all existing test logic from `tokenreviews.go`

main.go updates

  • Added `AddSuite` configuration for component/serial test suite
  • Suite name: `openshift/oauth-apiserver/component/serial`
  • Qualifiers: `[Component]` and `[Serial]` tags
  • Parallelism: 1 (serial execution)

Unchanged Files

  • ✅ `test/e2e/tokenreviews.go` - Original test remains completely unchanged

OTE Discovery

After merging, the OTE binary will discover this test as:
```
[sig-auth] OAuth should successfully review valid and invalid tokens [apigroup:oauth.openshift.io]
```

Verification Commands

```bash

Build OTE binary

make build

Verify dependencies

make verify-deps

List discovered tests

./oauth-apiserver-tests-ext list

Run the test

./oauth-apiserver-tests-ext run-suite -c 1
```

Pattern Reference

  • Follows OpenShift OTE migration best practices
  • Two-commit structure: infrastructure first, dependencies second
  • No modifications to original test files
  • Uses `testing.TB` interface for compatibility
  • Separates test imports into `dependencymagnet.go` file

Dependencies

Related

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.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Dec 26, 2025

@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.

Details

In response to this:

Summary

Migrate the `tokenreviews` e2e test to OpenShift Tests Extension (OTE) framework while keeping the original test unchanged.

⚠️ IMPORTANT: This PR depends on #162 and should be merged after it.

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 tokenreviews`

Changes:

  • Add `test/e2e/e2e.go` with Ginkgo test wrapper
  • Add `cmd/oauth-apiserver-tests-ext/dependencymagnet.go` to register test imports
  • Update `cmd/oauth-apiserver-tests-ext/main.go` with OTE registry configuration
  • Add `prepareOperatorTestsRegistry()` with detailed documentation
  • Configure test suite with `extension.AddSuite()` for component/serial tests
  • Call `oteginkgo.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite()` to build test specs
  • Use `extension.AddSpecs(specs)` to register test specs

Files changed: 3 files

  • `cmd/oauth-apiserver-tests-ext/main.go` (modified)
  • `cmd/oauth-apiserver-tests-ext/dependencymagnet.go` (new)
  • `test/e2e/e2e.go` (new)

Commit 2: Dependency updates

Commit: `go.mod, vendor: add Ginkgo and OTE dependencies`

Changes:

  • Add `github.com/onsi/ginkgo/v2 v2.24.0` to go.mod (with replace directive to OpenShift fork)
  • Update `go.sum` with checksums
  • Vendor all dependencies (257 new files)

Files changed: 259 files

  • `go.mod` (modified)
  • `go.sum` (modified)
  • `vendor/` (257 new files)

Test Structure

var _ = g.Describe("[sig-auth] OAuth", func() {
   g.It("should successfully review valid and invalid tokens [apigroup:oauth.openshift.io]", func(ctx context.Context) {
       testTokenReviewsGinkgo(g.GinkgoTB())
   })
})

Implementation Details

dependencymagnet.go

  • Imports test packages to register Ginkgo tests
  • Ensures tests are included in the build
  • Follows the pattern from other OpenShift operators

e2e.go

  • Ginkgo wrapper that calls `testTokenReviewsGinkgo()`
  • Uses `testing.TB` interface for dual compatibility
  • Type asserts to `*testing.T` when calling existing helper functions
  • Reuses all existing test logic from `tokenreviews.go`

main.go updates

  • Added `AddSuite` configuration for component/serial test suite
  • Suite name: `openshift/oauth-apiserver/component/serial`
  • Qualifiers: `[Component]` and `[Serial]` tags
  • Parallelism: 1 (serial execution)

Unchanged Files

  • ✅ `test/e2e/tokenreviews.go` - Original test remains completely unchanged

OTE Discovery

After merging, the OTE binary will discover this test as:

[sig-auth] OAuth should successfully review valid and invalid tokens [apigroup:oauth.openshift.io]

Verification Commands

# Build OTE binary
make build

# Verify dependencies
make verify-deps

# List discovered tests
./oauth-apiserver-tests-ext list

# Run the test
./oauth-apiserver-tests-ext run-suite <suite-path> -c 1

Pattern Reference

  • Follows OpenShift OTE migration best practices
  • Two-commit structure: infrastructure first, dependencies second
  • No modifications to original test files
  • Uses `testing.TB` interface for compatibility
  • Separates test imports into `dependencymagnet.go` file

Dependencies

Related

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.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Dec 26, 2025

@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.

Details

In response to this:

Summary

Migrate the tokenreviews e2e test to OpenShift Tests Extension (OTE) framework while keeping the original test unchanged.

⚠️ IMPORTANT: This PR depends on #162 and should be merged after it.

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 tokenreviews

Changes:

  • Add test/e2e/e2e.go with Ginkgo test wrapper
  • Add cmd/oauth-apiserver-tests-ext/dependencymagnet.go to register test imports
  • Update cmd/oauth-apiserver-tests-ext/main.go with OTE registry configuration
  • Add prepareOperatorTestsRegistry() with detailed documentation
  • Configure test suite with extension.AddSuite() for component/serial tests
  • Call oteginkgo.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite() to build test specs
  • Use extension.AddSpecs(specs) to register test specs

Files changed: 3 files

  • cmd/oauth-apiserver-tests-ext/main.go (modified)
  • cmd/oauth-apiserver-tests-ext/dependencymagnet.go (new)
  • test/e2e/e2e.go (new)

Commit 2: Dependency updates

Commit: go.mod, vendor: add Ginkgo and OTE dependencies

Changes:

  • Add github.com/onsi/ginkgo/v2 v2.24.0 to go.mod (with replace directive to OpenShift fork)
  • Update go.sum with checksums
  • Vendor all dependencies (257 new files)

Files changed: 259 files

  • go.mod (modified)
  • go.sum (modified)
  • vendor/ (257 new files)

Test Structure

var _ = g.Describe("[sig-auth] OAuth", func() {
   g.It("should successfully review valid and invalid tokens [apigroup:oauth.openshift.io]", func(ctx context.Context) {
       testTokenReviewsGinkgo(g.GinkgoTB())
   })
})

Implementation Details

dependencymagnet.go

  • Imports test packages to register Ginkgo tests
  • Ensures tests are included in the build
  • Follows the pattern from other OpenShift operators

e2e.go

  • Ginkgo wrapper that calls testTokenReviewsGinkgo()
  • Uses testing.TB interface for dual compatibility
  • Type asserts to *testing.T when calling existing helper functions
  • Reuses all existing test logic from tokenreviews.go

main.go updates

  • Added AddSuite configuration for component/serial test suite
  • Suite name: openshift/oauth-apiserver/component/serial
  • Qualifiers: [Component] and [Serial] tags
  • Parallelism: 1 (serial execution)

Unchanged Files

  • test/e2e/tokenreviews.go - Original test remains completely unchanged

OTE Discovery

After merging, the OTE binary will discover this test as:

[sig-auth] OAuth should successfully review valid and invalid tokens [apigroup:oauth.openshift.io]

Verification Commands

# Build OTE binary
make build

# Verify dependencies
make verify-deps

# List discovered tests
./oauth-apiserver-tests-ext list

# Run the test
./oauth-apiserver-tests-ext run-suite <suite-path> -c 1

Pattern Reference

  • Follows OpenShift OTE migration best practices
  • Two-commit structure: infrastructure first, dependencies second
  • No modifications to original test files
  • Uses testing.TB interface for compatibility
  • Separates test imports into dependencymagnet.go file

Dependencies

Related

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.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Dec 26, 2025

@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.

Details

In response to this:

Summary

Migrate the tokenreviews e2e test to OpenShift Tests Extension (OTE) framework while keeping the original test unchanged.

⚠️ IMPORTANT: This PR depends on #162 and should be merged after it.

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 tokenreviews

Changes:

  • Add test/e2e/e2e.go with Ginkgo test wrapper
  • Add cmd/oauth-apiserver-tests-ext/dependencymagnet.go to register test imports
  • Update cmd/oauth-apiserver-tests-ext/main.go with OTE registry configuration
  • Add prepareOperatorTestsRegistry() with detailed documentation
  • Configure test suite with extension.AddSuite() for component/serial tests
  • Call oteginkgo.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite() to build test specs
  • Use extension.AddSpecs(specs) to register test specs

Files changed: 3 files

  • cmd/oauth-apiserver-tests-ext/main.go (modified)
  • cmd/oauth-apiserver-tests-ext/dependencymagnet.go (new)
  • test/e2e/e2e.go (new)

Commit 2: Dependency updates

Commit: go.mod, vendor: add Ginkgo and OTE dependencies

Changes:

  • Add github.com/onsi/ginkgo/v2 v2.24.0 to go.mod (with replace directive to OpenShift fork)
  • Update go.sum with checksums
  • Vendor all dependencies (257 new files)

Files changed: 259 files

  • go.mod (modified)
  • go.sum (modified)
  • vendor/ (257 new files)

Test Structure

var _ = g.Describe("[sig-auth] OAuth", func() {
   g.It("should successfully review valid and invalid tokens [apigroup:oauth.openshift.io]", func(ctx context.Context) {
       testTokenReviewsGinkgo(g.GinkgoTB())
   })
})

Implementation Details

dependencymagnet.go

  • Imports test packages to register Ginkgo tests
  • Ensures tests are included in the build
  • Follows the pattern from other OpenShift operators

e2e.go

  • Ginkgo wrapper that calls testTokenReviewsGinkgo()
  • Uses testing.TB interface for dual compatibility
  • Type asserts to *testing.T when calling existing helper functions
  • Reuses all existing test logic from tokenreviews.go

main.go updates

  • Added AddSuite configuration for component/serial test suite
  • Suite name: openshift/oauth-apiserver/component/serial
  • Qualifiers: [Component] and [Serial] tags
  • Parallelism: 1 (serial execution)

Unchanged Files

  • test/e2e/tokenreviews.go - Original test remains completely unchanged

OTE Discovery

After merging, the OTE binary will discover this test as:

[sig-auth] OAuth should successfully review valid and invalid tokens [apigroup:oauth.openshift.io]

Verification Commands

# Build OTE binary
make build

# Verify dependencies
make verify-deps

# List discovered tests
./oauth-apiserver-tests-ext list

# Run the test
./oauth-apiserver-tests-ext run-suite <suite-path> -c 1

Pattern Reference

  • Follows OpenShift OTE migration best practices
  • Two-commit structure: infrastructure first, dependencies second
  • No modifications to original test files
  • Uses testing.TB interface for compatibility
  • Separates test imports into dependencymagnet.go file

Dependencies

Related

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
Copy link
Contributor Author

/retest

@openshift-ci
Copy link

openshift-ci bot commented Jan 13, 2026

@wangke19: all tests passed!

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants