Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Merge Redundant TLS & OIDC e2e Tests #8017

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
51 changes: 22 additions & 29 deletions test/rekt/parallel_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build e2e

Check failure on line 1 in test/rekt/parallel_test.go

View workflow job for this annotation

GitHub Actions / style / Golang / Auto-format and Check

Please run goimports. diff --git a/test/rekt/parallel_test.go b/test/rekt/parallel_test.go index 67cea85..2a41c64 100644 --- a/test/rekt/parallel_test.go +++ b/test/rekt/parallel_test.go @@ -73,25 +73,25 @@ func TestParallelSupportsOIDC(t *testing.T) { } func TestParallelTLSAndOIDC(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), - ) - t.Cleanup(env.Finish) - - t.Run("TestParallelTLS", func(t *testing.T) { - t.Parallel() - env.Test(ctx, t, parallel.ParallelWithTwoBranchesTLS(channel_template.ImmemoryChannelTemplate())) - }) - - t.Run("TestParallelOIDC", func(t *testing.T) { - t.Parallel() - env.Test(ctx, t, parallel.ParallelWithTwoBranchesOIDC(channel_template.ImmemoryChannelTemplate())) - }) + t.Parallel() + + ctx, env := global.Environment( + knative.WithKnativeNamespace(system.Namespace()), + knative.WithLoggingConfig, + knative.WithTracingConfig, + k8s.WithEventListener, + environment.Managed(t), + eventshub.WithTLS(t), + ) + t.Cleanup(env.Finish) + + t.Run("TestParallelTLS", func(t *testing.T) { + t.Parallel() + env.Test(ctx, t, parallel.ParallelWithTwoBranchesTLS(channel_template.ImmemoryChannelTemplate())) + }) + + t.Run("TestParallelOIDC", func(t *testing.T) { + t.Parallel() + env.Test(ctx, t, parallel.ParallelWithTwoBranchesOIDC(channel_template.ImmemoryChannelTemplate())) + }) }
// +build e2e

/*
Expand Down Expand Up @@ -51,22 +51,6 @@
env.Test(ctx, t, parallel.ParallelWithTwoBranches(channel_template.ImmemoryChannelTemplate()))
}

func TestParallelTLS(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),
)
t.Cleanup(env.Finish)

env.Test(ctx, t, parallel.ParallelWithTwoBranchesTLS(channel_template.ImmemoryChannelTemplate()))
}

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

Expand All @@ -88,17 +72,26 @@
env.Test(ctx, t, parallel.ParallelHasAudienceOfInputChannel(name, env.Namespace(), channel_impl.GVR(), channel_impl.GVK().Kind))
}

func TestParallelTwoBranchesWithOIDC(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, parallel.ParallelWithTwoBranchesOIDC(channel_template.ImmemoryChannelTemplate()))
func TestParallelTLSAndOIDC(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),
)
t.Cleanup(env.Finish)

t.Run("TestParallelTLS", func(t *testing.T) {
t.Parallel()
env.Test(ctx, t, parallel.ParallelWithTwoBranchesTLS(channel_template.ImmemoryChannelTemplate()))
})

t.Run("TestParallelOIDC", func(t *testing.T) {
t.Parallel()
env.Test(ctx, t, parallel.ParallelWithTwoBranchesOIDC(channel_template.ImmemoryChannelTemplate()))
})
}
55 changes: 24 additions & 31 deletions test/rekt/pingsource_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build e2e

Check failure on line 1 in test/rekt/pingsource_test.go

View workflow job for this annotation

GitHub Actions / style / Golang / Auto-format and Check

Please run goimports. diff --git a/test/rekt/pingsource_test.go b/test/rekt/pingsource_test.go index 0c3831e..737ee99 100644 --- a/test/rekt/pingsource_test.go +++ b/test/rekt/pingsource_test.go @@ -104,26 +104,26 @@ func TestPingSourceDataPlane_BrokerAsSinkTLS(t *testing.T) { } func TestPingSourceTLSAndOIDC(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), - ) - t.Cleanup(env.Finish) - - t.Run("SendsEventsTLS", func(t *testing.T) { - t.Parallel() - env.ParallelTest(ctx, t, pingsource.SendsEventsTLS()) - env.ParallelTest(ctx, t, pingsource.SendsEventsTLSTrustBundle()) - }) - - t.Run("SendsEventsOIDC", func(t *testing.T) { - t.Parallel() - env.Test(ctx, t, pingsource.PingSourceSendEventOIDC()) - }) -} \ No newline at end of file + t.Parallel() + + ctx, env := global.Environment( + knative.WithKnativeNamespace(system.Namespace()), + knative.WithLoggingConfig, + knative.WithTracingConfig, + k8s.WithEventListener, + environment.Managed(t), + eventshub.WithTLS(t), + ) + t.Cleanup(env.Finish) + + t.Run("SendsEventsTLS", func(t *testing.T) { + t.Parallel() + env.ParallelTest(ctx, t, pingsource.SendsEventsTLS()) + env.ParallelTest(ctx, t, pingsource.SendsEventsTLSTrustBundle()) + }) + + t.Run("SendsEventsOIDC", func(t *testing.T) { + t.Parallel() + env.Test(ctx, t, pingsource.PingSourceSendEventOIDC()) + }) +}
// +build e2e

/*
Expand Down Expand Up @@ -46,23 +46,6 @@
env.Test(ctx, t, pingsource.SendsEventsWithSinkRef())
}

func TestPingSourceTLS(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),
)
t.Cleanup(env.Finish)

env.ParallelTest(ctx, t, pingsource.SendsEventsTLS())
env.ParallelTest(ctx, t, pingsource.SendsEventsTLSTrustBundle())
}

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

Expand Down Expand Up @@ -120,17 +103,27 @@
env.Test(ctx, t, pingsource.SendsEventsWithBrokerAsSinkTLS())
}

func TestPingSourceSendsEventsOIDC(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, pingsource.PingSourceSendEventOIDC())
}
func TestPingSourceTLSAndOIDC(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),
)
t.Cleanup(env.Finish)

t.Run("SendsEventsTLS", func(t *testing.T) {
t.Parallel()
env.ParallelTest(ctx, t, pingsource.SendsEventsTLS())
env.ParallelTest(ctx, t, pingsource.SendsEventsTLSTrustBundle())
})

t.Run("SendsEventsOIDC", func(t *testing.T) {
t.Parallel()
env.Test(ctx, t, pingsource.PingSourceSendEventOIDC())
})
}

Check failure on line 129 in test/rekt/pingsource_test.go

View workflow job for this annotation

GitHub Actions / style / Golang / Lint

[EOF Newline] reported by reviewdog 🐶 Missing newline Raw Output: test/rekt/pingsource_test.go:129: Missing newline
Loading