package remote

import "github.com/onsi/ginkgo/internal/remote"

Aggregator is a reporter used by the Ginkgo CLI to aggregate and present parallel test output coherently as tests complete. You shouldn't need to use this in your code. To run tests in parallel:

ginkgo -nodes=N

where N is the number of nodes you desire.

Index

Types

type Aggregator

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

func NewAggregator

func NewAggregator(nodeCount int, result chan bool, config config.DefaultReporterConfigType, stenographer stenographer.Stenographer) *Aggregator

func (*Aggregator) AfterSuiteDidRun

func (aggregator *Aggregator) AfterSuiteDidRun(setupSummary *types.SetupSummary)

func (*Aggregator) BeforeSuiteDidRun

func (aggregator *Aggregator) BeforeSuiteDidRun(setupSummary *types.SetupSummary)

func (*Aggregator) SpecDidComplete

func (aggregator *Aggregator) SpecDidComplete(specSummary *types.SpecSummary)

func (*Aggregator) SpecSuiteDidEnd

func (aggregator *Aggregator) SpecSuiteDidEnd(summary *types.SuiteSummary)

func (*Aggregator) SpecSuiteWillBegin

func (aggregator *Aggregator) SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary)

func (*Aggregator) SpecWillRun

func (aggregator *Aggregator) SpecWillRun(specSummary *types.SpecSummary)

type ForwardingReporter

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

func NewForwardingReporter

func NewForwardingReporter(config config.DefaultReporterConfigType, serverHost string, poster Poster, outputInterceptor OutputInterceptor, ginkgoWriter *writer.Writer, debugFile string) *ForwardingReporter

func (*ForwardingReporter) AfterSuiteDidRun

func (reporter *ForwardingReporter) AfterSuiteDidRun(setupSummary *types.SetupSummary)

func (*ForwardingReporter) BeforeSuiteDidRun

func (reporter *ForwardingReporter) BeforeSuiteDidRun(setupSummary *types.SetupSummary)

func (*ForwardingReporter) SpecDidComplete

func (reporter *ForwardingReporter) SpecDidComplete(specSummary *types.SpecSummary)

func (*ForwardingReporter) SpecSuiteDidEnd

func (reporter *ForwardingReporter) SpecSuiteDidEnd(summary *types.SuiteSummary)

func (*ForwardingReporter) SpecSuiteWillBegin

func (reporter *ForwardingReporter) SpecSuiteWillBegin(conf config.GinkgoConfigType, summary *types.SuiteSummary)

func (*ForwardingReporter) SpecWillRun

func (reporter *ForwardingReporter) SpecWillRun(specSummary *types.SpecSummary)

type OutputInterceptor

type OutputInterceptor interface {
	StartInterceptingOutput() error
	StopInterceptingAndReturnOutput() (string, error)
	StreamTo(*os.File)
}

The OutputInterceptor is used by the ForwardingReporter to intercept and capture all stdin and stderr output during a test run.

func NewOutputInterceptor

func NewOutputInterceptor() OutputInterceptor

type Poster

type Poster interface {
	Post(url string, bodyType string, body io.Reader) (resp *http.Response, err error)
}

An interface to net/http's client to allow the injection of fakes under test

type Server

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

Server spins up on an automatically selected port and listens for communication from the forwarding reporter. It then forwards that communication to attached reporters.

func NewServer

func NewServer(parallelTotal int) (*Server, error)

Create a new server, automatically selecting a port

func (*Server) Address

func (server *Server) Address() string

The address the server can be reached it. Pass this into the `ForwardingReporter`.

func (*Server) Close

func (server *Server) Close()

Stop the server

func (*Server) RegisterAlive

func (server *Server) RegisterAlive(node int, alive func() bool)

func (*Server) RegisterReporters

func (server *Server) RegisterReporters(reporters ...reporters.Reporter)

func (*Server) Start

func (server *Server) Start()

Start the server. You don't need to `go s.Start()`, just `s.Start()`

Source Files

aggregator.go forwarding_reporter.go output_interceptor.go output_interceptor_unix.go server.go

Version
v1.16.5 (latest)
Published
Oct 11, 2021
Platform
linux/amd64
Imports
19 packages
Last checked
3 weeks ago

Tools for package owners.