tools: Index | Files

package eventtest

import ""

Package eventtest supports logging events to a test. You can use NewContext to create a context that knows how to deliver telemetry events back to the test. You must use this context or a derived one anywhere you want telemetry to be correctly routed back to the test it was constructed with. Any events delivered to a background context will be dropped.

Importing this package will cause it to register a new global telemetry exporter that understands the special contexts returned by NewContext. This means you should not import this package if you are not going to call NewContext.


Package Files


func NewContext Uses

func NewContext(ctx context.Context, t testing.TB) context.Context

NewContext returns a context you should use for the active test.

Package eventtest imports 8 packages (graph). Updated 2021-01-23. Refresh now. Tools for package owners.