server

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Notifiers map[string]gojson.RawMessage
	Suites    []*SuiteConfig
	// contains filtered or unexported fields
}

func NewConfigFromFile

func NewConfigFromFile(path string) (*Config, error)

func NewConfigFromReader

func NewConfigFromReader(r io.Reader) (*Config, error)

func (*Config) GenNotifier

func (cfg *Config) GenNotifier() notifier.Notifier

func (*Config) GenSuites

func (cfg *Config) GenSuites(options ...SuiteOption) ([]*Suite, error)

type Server

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

func New

func New(n notifier.Notifier) *Server

func (*Server) AddSuite

func (s *Server) AddSuite(suite *Suite) error

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

type Suite

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

func NewSuite

func NewSuite(path, typ string, tests []testsuite.Test, cfg *SuiteConfig) (*Suite, error)

func NewSuiteFromFile

func NewSuiteFromFile(path string, options ...SuiteOption) (*Suite, error)

func NewSuiteFromReader

func NewSuiteFromReader(r io.Reader, options ...SuiteOption) (*Suite, error)

func (*Suite) FailFast

func (s *Suite) FailFast() bool

func (*Suite) Name

func (s *Suite) Name() string

func (*Suite) Path

func (s *Suite) Path() string

func (*Suite) Run

func (s *Suite) Run(ctx context.Context) *notifier.Report

func (*Suite) Tests

func (s *Suite) Tests() []testsuite.Test

func (*Suite) Type

func (s *Suite) Type() string

type SuiteConfig

type SuiteConfig struct {
	Path string `json:"path,omitempty"` // only used in base config.

	Name       string        `json:"name,omitempty"`     // identifier for this test suite
	RunEvery   json.Duration `json:"runEvery,omitempty"` // scheduling every duration.
	RunCron    string        `json:"runCron,omitempty"`  // cron string.
	RetryCount int           `json:"retryCount,omitempty"`
	RetryWait  json.Duration `json:"retryWait,omitempty"`
	Timeout    json.Duration `json:"timeout,omitempty"`
	FailFast   bool          `json:"failFast,omitempty"` // stop after first test failure.

	Type  string            `json:"type,omitempty"`  // type of the test suite, can be HTTP, GRPC...
	Suite gojson.RawMessage `json:"suite,omitempty"` // description of the test suite, depends on Type.
	// contains filtered or unexported fields
}

type SuiteOption

type SuiteOption func(c *SuiteConfig)

SuiteOption is a function that sets some option on the suite.

func FailFast

func FailFast(ff bool) SuiteOption

func Filter

func Filter(filter string) SuiteOption

func Timeout

func Timeout(timeout time.Duration) SuiteOption

Jump to

Keyboard shortcuts

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