Skip to content

E2E test: emit events from a utility pod #686

@grantr

Description

@grantr

Currently the E2E tests use (roughly) this procedure:

  1. Create a KubernetesEventSource
  2. Wait for it to become ready
  3. Create a Pod
  4. Wait for it to start
  5. Wait for a Created container string in the message-dumper logs
  6. 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions