output

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: 8 Imported by: 0

Documentation

Overview

Package output defines output stream from entities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EntityStream

type EntityStream struct {
	// contains filtered or unexported fields
}

EntityStream wraps planner.OutputStream for a single entity.

EntityStream implements testing.OutputStream. EntityStream is goroutine-safe; it is safe to call its methods concurrently from multiple goroutines.

func NewEntityStream

func NewEntityStream(out Stream, ei *protocol.Entity) *EntityStream

NewEntityStream creates entityOutputStream for out and ei.

func (*EntityStream) End

func (w *EntityStream) End(skipReasons []string, timingLog *timing.Log) error

End reports that the entity has ended. After End is called, all methods will fail with an error.

func (*EntityStream) Error

func (w *EntityStream) Error(e *protocol.Error) error

Log reports an error from the entity.

func (*EntityStream) Errors

func (w *EntityStream) Errors() []*protocol.Error

Errors returns errors reported so far.

func (*EntityStream) Log

func (w *EntityStream) Log(level logging.Level, ts time.Time, msg string) error

Log reports an informational log from the entity.

func (*EntityStream) Start

func (w *EntityStream) Start(outDir string) error

Start reports that the test has started. It should be called exactly once.

type Stream

type Stream interface {
	// EntityStart reports that an entity has started.
	EntityStart(ei *protocol.Entity, outDir string) error
	// EntityLog reports an informational log message.
	EntityLog(ei *protocol.Entity, level logging.Level, ts time.Time, msg string) error
	// EntityError reports an error from an entity. An entity that reported one or more errors should be considered failure.
	EntityError(ei *protocol.Entity, e *protocol.Error) error
	// EntityEnd reports that an entity has ended. If skipReasons is not empty it is considered skipped.
	EntityEnd(ei *protocol.Entity, skipReasons []string, timingLog *timing.Log) error
	// ExternalEvent reports events happened in external bundles.
	ExternalEvent(res *protocol.RunTestsResponse) error
	// StackOperation reports stack operation request.
	StackOperation(ctx context.Context, req *protocol.StackOperationRequest) (*protocol.StackOperationResponse, error)
}

Stream is an interface to report streamed outputs of multiple entity runs. Note that testing.Stream is for a single entity in contrast.

Directories

Path Synopsis
Package outputtest provides functionalities for unit testing output package.
Package outputtest provides functionalities for unit testing output package.

Jump to

Keyboard shortcuts

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