Skip to content

Commit e8dd416

Browse files
test(auth): remove duplicate CEL parse check in subscription cache key test
The CEL validity check was performed twice: once as a top-level t.Fatalf guard before the substring subtests, and again as a redundant subtest. Keep only the top-level guard which fails fast before running pointless substring assertions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Mynhardt Burger <mynhardt@gmail.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
1 parent 3ed697a commit e8dd416

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

maas-controller/pkg/controller/maas/maasauthpolicy_controller_test.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -486,21 +486,4 @@ func TestMaaSAuthPolicyReconciler_SubscriptionCacheKey(t *testing.T) {
486486
}
487487
})
488488
}
489-
490-
// Verify the cache key selector is a syntactically valid CEL expression.
491-
// Authorino evaluates this string as CEL at runtime, so a syntax error here
492-
// would cause all subscription-info cache lookups to fail silently.
493-
t.Run("is valid CEL expression", func(t *testing.T) {
494-
env, err := cel.NewEnv()
495-
if err != nil {
496-
t.Fatalf("failed to create CEL environment: %v", err)
497-
}
498-
ast, issues := env.Parse(cacheKeySelector)
499-
if issues != nil && issues.Err() != nil {
500-
t.Errorf("cache key selector is not a valid CEL expression:\n selector: %s\n parse error: %v", cacheKeySelector, issues.Err())
501-
}
502-
if ast == nil {
503-
t.Errorf("CEL parse returned nil AST for selector: %s", cacheKeySelector)
504-
}
505-
})
506489
}

0 commit comments

Comments
 (0)