Skip to content

Commit ec9fccf

Browse files
Rohit Patilclaude
andcommitted
Migrate test/e2e-oidc to OpenShift Tests Extension framework
Complete migration of OIDC authentication tests to OTE framework with comprehensive test coverage including all 6 sub-tests from master branch. Changes: * cmd/cluster-authentication-operator-tests-ext/main.go: - Add e2e-oidc import for OTE registration - Fix serial suite qualifier to exclude [Disruptive] tests * test/e2e-oidc/external_oidc.go: NEW - Complete test implementation - Ginkgo v2 registration with OTE tags: [OIDC][Serial][Disruptive][Timeout:3h] - All 6 sub-tests migrated from master branch: 1. auth-config cm deletion when type not OIDC 2. invalid CEL expression rejects admission (2 variants) 3. invalid OIDC config degrades operator (2 variants) 4. OIDC rollout successful (4 username/prefix variants) 5. auth-config cm overwrite when type OIDC 6. unknown username claim breaks authentication - All 4 types migrated: oidcAuthResponse, expectedClaims, jwks, testClient - All 22 helper and validation functions migrated - Dual-mode pattern: testing.TB interface for Go test + Ginkgo compatibility * test/e2e-oidc/external_oidc_test.go: - Simplified to Go test wrapper for backward compatibility - Calls shared testExternalOIDCWithKeycloak function * test/library/waits.go: - Update function signatures to accept testing.TB for dual-mode support Migration details: - Convert from t.Run() nested structure to flat sequential Ginkgo tests - Update all function signatures from *testing.T to testing.TB - Maintain 100% parity with master branch functionality - Package name: e2e -> e2e_oidc Test coverage: 100% - 6/6 sub-tests migrated - 4/4 types migrated - 22/22 functions migrated Verification: ✅ All unit tests pass (21 packages) ✅ Test binary compiles successfully (98MB) ✅ Code formatted with gofmt ✅ Dependencies vendored and tidied Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent e35c554 commit ec9fccf

5 files changed

Lines changed: 1282 additions & 1141 deletions

File tree

cmd/cluster-authentication-operator-tests-ext/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
_ "github.com/openshift/cluster-authentication-operator/test/e2e"
1616
_ "github.com/openshift/cluster-authentication-operator/test/e2e-encryption-kms"
1717
_ "github.com/openshift/cluster-authentication-operator/test/e2e-encryption-perf"
18+
_ "github.com/openshift/cluster-authentication-operator/test/e2e-oidc"
1819

1920
"k8s.io/klog/v2"
2021
)
@@ -75,11 +76,12 @@ func prepareOperatorTestsRegistry() (*oteextension.Registry, error) {
7576
// The following suite runs tests that must execute serially (one at a time)
7677
// because they modify cluster-wide resources like OAuth configuration.
7778
// Tests tagged with [Serial] and any of [Operator], [OIDC], [Templates], [Tokens] are included in this suite.
79+
// Excludes [Disruptive] tests which run in the disruptive suite instead.
7880
extension.AddSuite(oteextension.Suite{
7981
Name: "openshift/cluster-authentication-operator/operator/serial",
8082
Parallelism: 1,
8183
Qualifiers: []string{
82-
`name.contains("[Serial]") && (name.contains("[Operator]") || name.contains("[OIDC]") || name.contains("[Templates]") || name.contains("[Tokens]"))`,
84+
`name.contains("[Serial]") && !name.contains("[Disruptive]") && (name.contains("[Operator]") || name.contains("[OIDC]") || name.contains("[Templates]") || name.contains("[Tokens]"))`,
8385
},
8486
})
8587

0 commit comments

Comments
 (0)