Skip to content

Commit

Permalink
chore: e2e test for configuring pingsource with seconds field in sche…
Browse files Browse the repository at this point in the history
…dule
  • Loading branch information
SiBell committed Oct 25, 2023
1 parent 48cd2dd commit e792f5e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/rekt/features/pingsource/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,26 @@ func SendsEventsWithCloudEventData() *feature.Feature {
return f
}

func SendsEventsWithSecondsInSchedule() *feature.Feature {
source := feature.MakeRandomK8sName("pingsource")
sink := feature.MakeRandomK8sName("sink")
f := feature.NewFeature()

f.Setup("install sink", eventshub.Install(sink, eventshub.StartReceiver))

f.Requirement("install pingsource", pingsource.Install(source,
pingsource.WithSchedule("10 0/1 * * * ?"),
pingsource.WithSink(service.AsDestinationRef(sink)),
))
f.Requirement("pingsource goes ready", pingsource.IsReady(source))

f.Stable("pingsource as event source").
Must("delivers events",
assert.OnStore(sink).MatchEvent(test.HasType("dev.knative.sources.ping")).AtLeast(1))

return f
}

// SendsEventsWithEventTypes tests pingsource to a ready broker.
func SendsEventsWithEventTypes() *feature.Feature {
source := feature.MakeRandomK8sName("source")
Expand Down
14 changes: 14 additions & 0 deletions test/rekt/pingsource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,17 @@ func TestPingSourceWithCloudEventData(t *testing.T) {

env.Test(ctx, t, pingsource.SendsEventsWithCloudEventData())
}

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

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

env.Test(ctx, t, pingsource.SendsEventsWithSecondsInSchedule())
}

0 comments on commit e792f5e

Please sign in to comment.