Skip to content

Commit

Permalink
Move OIDC tests to test/rekt (knative#7622) (#535)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
creydr authored Feb 20, 2024
1 parent 026d280 commit 893e61c
Show file tree
Hide file tree
Showing 20 changed files with 315 additions and 359 deletions.
46 changes: 0 additions & 46 deletions test/auth/main_test.go

This file was deleted.

225 changes: 0 additions & 225 deletions test/auth/oidc_test.go

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 The Knative Authors
# Copyright 2024 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -20,4 +20,3 @@ metadata:
data:
authentication-oidc: "enabled"
transport-encryption: "strict"

6 changes: 6 additions & 0 deletions test/e2e-rekt-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,10 @@ kubectl apply -Rf "$(dirname "$0")/config-transport-encryption"

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

echo "Running E2E OIDC Reconciler Tests"

kubectl apply -Rf "$(dirname "$0")/config-authentication-oidc"

go_test_e2e -timeout=1h ./test/rekt -run OIDC || fail_test

success
15 changes: 15 additions & 0 deletions test/rekt/apiserversource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,18 @@ func TestApiServerSourceDataPlane_MultipleNamespacesEmptySelector(t *testing.T)

env.Test(ctx, t, apiserversourcefeatures.SendsEventsForAllResourcesWithEmptyNamespaceSelector())
}

func TestApiserversourceSendEventWithJWTOIDC(t *testing.T) {
t.Parallel()

ctx, env := global.Environment(
knative.WithKnativeNamespace(system.Namespace()),
knative.WithLoggingConfig,
knative.WithTracingConfig,
k8s.WithEventListener,
environment.Managed(t),
eventshub.WithTLS(t),
)

env.Test(ctx, t, apiserversourcefeatures.ApiserversourceSendEventWithJWT())
}
Loading

0 comments on commit 893e61c

Please sign in to comment.