Currently the E2E tests use (roughly) this procedure:
- Create a KubernetesEventSource
- Wait for it to become ready
- Create a Pod
- Wait for it to start
- Wait for a
Created container string in the message-dumper logs
- Wait for a `Started containe string in the message-dumper logs
This is a great test of KubernetesEventSource, but IMO not a great test of eventing core. Any failure in the source also fails the test, and source implementations are still young and relatively untested. This has led to hard-to-diagnose failures caused by the dependency on eventing-sources (see #683).
Instead, I suggest using the sendevent helper to publish messages in tests. The E2E tests can run this as a Pod to get a message into the channel under test. In addition to likely being more reliable and predictable than a source, this gives the test control over the content, timing, and number of messages, allowing for more complex tests that exercise message routing across multiple channels and subscriptions.
I also suggest moving or copying the message_dumper utility from https://github.com/knative/eventing-sources/tree/master/cmd to this repo alongside sendevent.
Currently the E2E tests use (roughly) this procedure:
Created containerstring in the message-dumper logsThis is a great test of
KubernetesEventSource, but IMO not a great test of eventing core. Any failure in the source also fails the test, and source implementations are still young and relatively untested. This has led to hard-to-diagnose failures caused by the dependency on eventing-sources (see #683).Instead, I suggest using the
sendeventhelper to publish messages in tests. The E2E tests can run this as a Pod to get a message into the channel under test. In addition to likely being more reliable and predictable than a source, this gives the test control over the content, timing, and number of messages, allowing for more complex tests that exercise message routing across multiple channels and subscriptions.I also suggest moving or copying the message_dumper utility from https://github.com/knative/eventing-sources/tree/master/cmd to this repo alongside
sendevent.