Skip to content

Commit

Permalink
Extended tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjohansen authored and knative-prow-robot committed Jul 31, 2023
1 parent 03fbc5c commit df7e11c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/reconciler/broker/resources/dispatcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func TestMakeDispatcherDeployment(t *testing.T) {
BackoffDelay: ptr.String("PT20S"),
BackoffPolicy: &linear,
},
DLX: true,
}

got := MakeDispatcherDeployment(args)
Expand Down Expand Up @@ -190,6 +191,9 @@ func TestMakeDispatcherDeployment(t *testing.T) {
}, {
Name: "SUBSCRIBER_CACERTS",
Value: "test.cacert",
}, {
Name: "DLX",
Value: "true",
}},
Ports: []corev1.ContainerPort{{
Name: "http-metrics",
Expand Down
16 changes: 16 additions & 0 deletions pkg/reconciler/trigger/resources/dispatcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ func TestMakeDispatcherDeployment(t *testing.T) {
withEnv(corev1.EnvVar{Name: "POD_NAME", Value: "testtrigger-dlx-dispatcher"}),
withDefaultResourceRequirements(),
),
}, {
name: "with dlx name",
args: dispatcherArgs(withDLXName("dlx-name")),
want: deployment(
deploymentNamed("testtrigger-dispatcher"),
withEnv(corev1.EnvVar{Name: "PARALLELISM", Value: "1"}),
withEnv(corev1.EnvVar{Name: "DLX_NAME", Value: "dlx-name"}),
withEnv(corev1.EnvVar{Name: "POD_NAME", Value: "testtrigger-dispatcher"}),
withDefaultResourceRequirements(),
),
},
{
name: "with parallelism",
Expand Down Expand Up @@ -311,6 +321,12 @@ func withDLX(args *DispatcherArgs) {
args.DLX = true
}

func withDLXName(name string) func(*DispatcherArgs) {
return func(args *DispatcherArgs) {
args.DLXName = name
}
}

func withParallelism(c string) func(*DispatcherArgs) {
return func(args *DispatcherArgs) {
if args.Trigger.ObjectMeta.Annotations == nil {
Expand Down

0 comments on commit df7e11c

Please sign in to comment.