Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions cmd/cluster-authentication-operator-tests-ext/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ func prepareOperatorTestsRegistry() (*oteextension.Registry, error) {
},
})

// The following suite runs tests that verify the operator's behaviour.
// This suite is executed only on pull requests targeting this repository.
// Tests tagged with [Parallel] and any of [Operator], [OIDC], [Templates], [Tokens] are included in this suite.
extension.AddSuite(oteextension.Suite{
Name: "openshift/cluster-authentication-operator/operator/parallel",
Parallelism: 1,
Qualifiers: []string{
`!name.contains("[Serial]") && (name.contains("[Operator]") || name.contains("[OIDC]") || name.contains("[Templates]") || name.contains("[Tokens]"))`,
},
})
Comment on lines 72 to 81
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Duplicate suite name will cause registration conflicts.

Both suites at lines 64-70 and lines 75-81 share the same name "openshift/cluster-authentication-operator/operator/serial". This will likely cause one suite to overwrite the other in the registry.

Additionally, the comment mentions [Parallel] but the qualifier !name.contains("[Serial]") filters for tests without [Serial], which is not the same as tests explicitly tagged with [Parallel].

Proposed fix
 	// The following suite runs tests that verify the operator's behaviour.
 	// This suite is executed only on pull requests targeting this repository.
-	// Tests tagged with [Parallel] and any of [Operator], [OIDC], [Templates], [Tokens] are included in this suite.
+	// Tests NOT tagged with [Serial] but tagged with any of [Operator], [OIDC], [Templates], [Tokens] are included in this suite.
 	extension.AddSuite(oteextension.Suite{
-		Name:        "openshift/cluster-authentication-operator/operator/serial",
+		Name:        "openshift/cluster-authentication-operator/operator/parallel",
 		Parallelism: 1,
 		Qualifiers: []string{
 			`!name.contains("[Serial]") && (name.contains("[Operator]") || name.contains("[OIDC]") || name.contains("[Templates]") || name.contains("[Tokens]"))`,
 		},
 	})
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// The following suite runs tests that verify the operator's behaviour.
// This suite is executed only on pull requests targeting this repository.
// Tests tagged with [Parallel] and any of [Operator], [OIDC], [Templates], [Tokens] are included in this suite.
extension.AddSuite(oteextension.Suite{
Name: "openshift/cluster-authentication-operator/operator/serial",
Parallelism: 1,
Qualifiers: []string{
`!name.contains("[Serial]") && (name.contains("[Operator]") || name.contains("[OIDC]") || name.contains("[Templates]") || name.contains("[Tokens]"))`,
},
})
// The following suite runs tests that verify the operator's behaviour.
// This suite is executed only on pull requests targeting this repository.
// Tests NOT tagged with [Serial] but tagged with any of [Operator], [OIDC], [Templates], [Tokens] are included in this suite.
extension.AddSuite(oteextension.Suite{
Name: "openshift/cluster-authentication-operator/operator/parallel",
Parallelism: 1,
Qualifiers: []string{
`!name.contains("[Serial]") && (name.contains("[Operator]") || name.contains("[OIDC]") || name.contains("[Templates]") || name.contains("[Tokens]"))`,
},
})
🤖 Prompt for AI Agents
In `@cmd/cluster-authentication-operator-tests-ext/main.go` around lines 72 - 81,
The test suite registration duplicates the Name
"openshift/cluster-authentication-operator/operator/serial" and uses a qualifier
that excludes "[Serial]" instead of selecting "[Parallel]"; update the second
extension.AddSuite call (oteextension.Suite) to use a distinct Name (e.g.,
".../operator/parallel") and change its Qualifiers expression to explicitly
include tests tagged with "[Parallel]" (for example by replacing
`!name.contains("[Serial]") && (...)` with `name.contains("[Parallel]") &&
(...)` or an equivalent that matches [Parallel] tests); ensure Parallelism
remains appropriate for the new suite.


specs, err := oteginkgo.BuildExtensionTestSpecsFromOpenShiftGinkgoSuite()
if err != nil {
return nil, fmt.Errorf("couldn't build extension test specs from ginkgo: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require (
github.com/golang-jwt/jwt/v5 v5.2.2
github.com/google/go-cmp v0.7.0
github.com/onsi/ginkgo/v2 v2.21.0
github.com/onsi/gomega v1.35.1
github.com/openshift-eng/openshift-tests-extension v0.0.0-20251205182537-ff5553e56f33
github.com/openshift/api v0.0.0-20260126183958-606bd613f9f7
github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee
Expand Down Expand Up @@ -76,7 +77,6 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/onsi/gomega v1.35.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/profile v1.7.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
Expand Down
Loading