runner

package
v0.0.0-...-93ea535 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2019 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JUnitFailure

type JUnitFailure struct {
	Message  string `xml:"message,attr"`
	Type     string `xml:"type,attr"`
	Contents string `xml:",chardata"`
}

type JUnitSkipMessage

type JUnitSkipMessage struct {
	Message string `xml:"message,attr"`
}

type JUnitTestCase

type JUnitTestCase struct {
	XMLName     xml.Name          `xml:"testcase"`
	Name        string            `xml:"name,attr"`
	Time        string            `xml:"time,attr"`
	Failure     *JUnitFailure     `xml:"failure,omitempty"`
	SkipMessage *JUnitSkipMessage `xml:"skipped,omitempty"`
}

type JUnitTestSuite

type JUnitTestSuite struct {
	XMLName   xml.Name `xml:"testsuite"`
	Tests     int      `xml:"tests,attr"`
	Failures  int      `xml:"failures,attr"`
	Time      string   `xml:"time,attr"`
	Name      string   `xml:"name,attr"`
	TestCases []JUnitTestCase
}

type JUnitTestSuites

type JUnitTestSuites struct {
	XMLName xml.Name `xml:"testsuites"`
	Suites  []JUnitTestSuite
}

type RequestMatchError

type RequestMatchError struct {
	Type     string
	Expected string
	Actual   string
}

type Runner

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

func NewRunner

func NewRunner(
	config *config.Config,
	runnerConfigs ...RunnerConfigFunc,
) *Runner

func (*Runner) Run

func (r *Runner) Run() error

type RunnerConfigFunc

type RunnerConfigFunc func(*Runner)

func WithEnvironment

func WithEnvironment(env []string) RunnerConfigFunc

func WithJUnitReportPath

func WithJUnitReportPath(path string) RunnerConfigFunc

func WithLogger

func WithLogger(logger logging.Logger) RunnerConfigFunc

func WithScenarioRunnerFactory

func WithScenarioRunnerFactory(factory ScenarioRunnerFactory) RunnerConfigFunc

func WithVerbosityLevel

func WithVerbosityLevel(verbosityLevel logging.VerbosityLevel) RunnerConfigFunc

type ScenarioContext

type ScenarioContext struct {
	Scenario *config.Scenario
	Runner   ScenarioRunner
	Pending  bool
	Skipped  bool
	Context  map[string]interface{}
}

type ScenarioRunner

type ScenarioRunner interface {
	Run(client *http.Client, context map[string]interface{}) map[string]interface{}
	Results() []*TestResult
	Errored() bool
	Failed() bool
	Resolved() bool
	Duration() time.Duration
}

func NewScenarioRunner

func NewScenarioRunner(
	scenario *config.Scenario,
	logger logging.Logger,
	verbosityLevel logging.VerbosityLevel,
	testSemaphore *semaphore.Weighted,
) ScenarioRunner

type ScenarioRunnerFactory

type ScenarioRunnerFactory interface {
	New(
		scenario *config.Scenario,
		logger logging.Logger,
		verbosityLevel logging.VerbosityLevel,
		testSemaphore *semaphore.Weighted) ScenarioRunner
}

type ScenarioRunnerFactoryFunc

type ScenarioRunnerFactoryFunc func(
	scenario *config.Scenario,
	logger logging.Logger,
	verbosityLevel logging.VerbosityLevel,
	testSemaphore *semaphore.Weighted,
) ScenarioRunner

func (ScenarioRunnerFactoryFunc) New

func (f ScenarioRunnerFactoryFunc) New(
	scenario *config.Scenario,
	logger logging.Logger,
	verbosityLevel logging.VerbosityLevel,
	testSemaphore *semaphore.Weighted,
) ScenarioRunner

type TestResult

type TestResult struct {
	Index              int
	Disabled           bool
	Skipped            bool
	Request            *http.Request
	RequestBody        string
	Response           *http.Response
	ResponseBody       string
	RequestMatchErrors []RequestMatchError
	Err                error
	Duration           time.Duration
}

func (*TestResult) Errored

func (r *TestResult) Errored() bool

func (*TestResult) Failed

func (r *TestResult) Failed() bool

Jump to

Keyboard shortcuts

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