Skip to content

Commit 29f4f63

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 a3394d2 commit 29f4f63

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
@@ -485,21 +485,4 @@ func TestMaaSAuthPolicyReconciler_SubscriptionCacheKey(t *testing.T) {
485485
}
486486
})
487487
}
488-
489-
// Verify the cache key selector is a syntactically valid CEL expression.
490-
// Authorino evaluates this string as CEL at runtime, so a syntax error here
491-
// would cause all subscription-info cache lookups to fail silently.
492-
t.Run("is valid CEL expression", func(t *testing.T) {
493-
env, err := cel.NewEnv()
494-
if err != nil {
495-
t.Fatalf("failed to create CEL environment: %v", err)
496-
}
497-
ast, issues := env.Parse(cacheKeySelector)
498-
if issues != nil && issues.Err() != nil {
499-
t.Errorf("cache key selector is not a valid CEL expression:\n selector: %s\n parse error: %v", cacheKeySelector, issues.Err())
500-
}
501-
if ast == nil {
502-
t.Errorf("CEL parse returned nil AST for selector: %s", cacheKeySelector)
503-
}
504-
})
505488
}

0 commit comments

Comments
 (0)