Skip to content

Commit

Permalink
EventType tests verify the type under spec.reference (knative#7888) (#…
Browse files Browse the repository at this point in the history
…775)

* test ref

* test for reference

* format

* Update test/rekt/features/apiserversource/data_plane.go



* fix syntax

---------

Co-authored-by: Phuong Cao <88098962+ctmphuongg@users.noreply.github.com>
Co-authored-by: Calum Murray <cmurray@redhat.com>
  • Loading branch information
3 people authored Aug 27, 2024
1 parent 79b4ea3 commit 2f467a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions test/experimental/features/eventtype_autocreate/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ func AutoCreateEventTypesOnBroker(brokerName string) *feature.Feature {
Must("deliver events to subscriber", assert.OnStore(sink).MatchEvent(cetest.HasId(event.ID())).AtLeast(1)).
Must("create event type", eventtype.WaitForEventType(
eventtype.AssertReady(expectedTypes),
eventtype.AssertExactPresent(expectedTypes)))
eventtype.AssertExactPresent(expectedTypes),
eventtype.AssertReferencePresent(broker.AsKReference(brokerName))),
)

return f
}
Expand Down Expand Up @@ -215,7 +217,8 @@ func AutoCreateEventTypeEventsFromPingSource() *feature.Feature {
cetest.HasType(sourcesv1.PingSourceEventType)).AtLeast(1)).
Must("PingSource test eventtypes match", eventtype.WaitForEventType(
eventtype.AssertReady(expectedCeTypes),
eventtype.AssertPresent(expectedCeTypes)))
eventtype.AssertPresent(expectedCeTypes),
eventtype.AssertReferencePresent(broker.AsKReference(brokerName))))

return f
}
Expand Down
3 changes: 2 additions & 1 deletion test/rekt/features/pingsource/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ func SendsEventsWithEventTypes() *feature.Feature {
test.HasType("dev.knative.sources.ping")).AtLeast(1)).
Must("PingSource test eventtypes match", eventtype.WaitForEventType(
eventtype.AssertReady(expectedCeTypes),
eventtype.AssertPresent(expectedCeTypes)))
eventtype.AssertPresent(expectedCeTypes),
eventtype.AssertReferencePresent(broker.AsKReference(brokerName))))

return f
}
Expand Down

0 comments on commit 2f467a6

Please sign in to comment.