protocoltest

package
v0.0.0-...-b5d9cbe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package protocoltest provides utilities for unit tests involving Tast gRPC protocol.

Index

Constants

This section is empty.

Variables

EventCmpOpts is a list of options to be passed to cmp.Diff to compare protocol.Event slices ignoring non-deterministic fields.

Functions

func ExtractEvent

func ExtractEvent(res *protocol.RunTestsResponse) (protocol.Event, bool)

ExtractEvent extracts Event from RunTestsResponse. It is useful in unit tests to compare received events against expectation.

func RunTestsForEvents

func RunTestsForEvents(ctx context.Context, cl protocol.TestServiceClient, rcfg *protocol.RunConfig, opts ...Option) ([]protocol.Event, error)

RunTestsForEvents calls RunTests on cl with cfg and returns a slice of events. wantLogs specifies whether RunLogEvent and EntityLogEvent should be included in the result.

func RunTestsRecursiveForEvents

func RunTestsRecursiveForEvents(ctx context.Context, cl protocol.TestServiceClient, rcfg *protocol.RunConfig, opts ...Option) ([]protocol.Event, error)

RunTestsRecursiveForEvents is similar to RunTestsForEvents, but calls RunTests with a recursive flag.

Types

type Option

type Option func(*config)

Option represents an option to RunTestsForEvents.

func WithEntityLogs

func WithEntityLogs() Option

WithEntityLogs instructs to include EntityLogEvents to the result.

func WithRunLogs

func WithRunLogs() Option

WithRunLogs instructs to include RunLogEvents to the result.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL