Skip to content

Commit 4063781

Browse files
[release-1.13] Move OIDC tests to test/rekt (#7705)
* Prepare infra * Move apiserversource oidc tests * Move containersource oidc tests * Move channel oidc tests * Move pingsource oidc tests * Move parallel oidc tests * Move sequence oidc tests * Move broker oidc tests * Cleanup infra * Split parallel tests in 2 * Fix some prerequisites * Move oidc tests into oidc_feature.go files * Add boilerplate header * Run goimports * Fix more boilerplate headers * Cleanup features configmap file * Fix some import aliases --------- Co-authored-by: Christoph Stäbler <[email protected]>
1 parent c818a3a commit 4063781

File tree

21 files changed

+315
-365
lines changed

21 files changed

+315
-365
lines changed

.github/workflows/kind-e2e.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ jobs:
2525
- ./test/e2e
2626
- ./test/conformance
2727
- ./test/experimental
28-
- ./test/auth
2928

3029
# Map between K8s and KinD versions.
3130
# This is attempting to make it a bit clearer what's being tested.
@@ -111,11 +110,6 @@ jobs:
111110
run: |
112111
kubectl apply -f ./test/experimental/config
113112
114-
- name: Apply auth features config
115-
if: matrix.test-suite == './test/auth'
116-
run: |
117-
kubectl apply -f ./test/auth/config
118-
119113
- name: Wait for things to be up
120114
run: |
121115
set -e

test/auth/main_test.go

Lines changed: 0 additions & 46 deletions
This file was deleted.

test/auth/oidc_test.go

Lines changed: 0 additions & 225 deletions
This file was deleted.

test/auth/config/features.yaml renamed to test/config-authentication-oidc/features.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 The Knative Authors
1+
# Copyright 2024 The Knative Authors
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -20,4 +20,3 @@ metadata:
2020
data:
2121
authentication-oidc: "enabled"
2222
transport-encryption: "strict"
23-

test/e2e-rekt-tests.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,10 @@ kubectl apply -Rf "$(dirname "$0")/config-transport-encryption"
4444

4545
go_test_e2e -timeout=1h ./test/rekt -run TLS || fail_test
4646

47+
echo "Running E2E OIDC Reconciler Tests"
48+
49+
kubectl apply -Rf "$(dirname "$0")/config-authentication-oidc"
50+
51+
go_test_e2e -timeout=1h ./test/rekt -run OIDC || fail_test
52+
4753
success

test/rekt/apiserversource_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,18 @@ func TestApiServerSourceDataPlane_MultipleNamespacesEmptySelector(t *testing.T)
182182

183183
env.Test(ctx, t, apiserversourcefeatures.SendsEventsForAllResourcesWithEmptyNamespaceSelector())
184184
}
185+
186+
func TestApiserversourceSendEventWithJWTOIDC(t *testing.T) {
187+
t.Parallel()
188+
189+
ctx, env := global.Environment(
190+
knative.WithKnativeNamespace(system.Namespace()),
191+
knative.WithLoggingConfig,
192+
knative.WithTracingConfig,
193+
k8s.WithEventListener,
194+
environment.Managed(t),
195+
eventshub.WithTLS(t),
196+
)
197+
198+
env.Test(ctx, t, apiserversourcefeatures.ApiserversourceSendEventWithJWT())
199+
}

0 commit comments

Comments
 (0)