cmdtest

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2019 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdTimeout = time.Minute

CmdTimeout defines timeout for a command

View Source
var GrepTimeout = 30 * time.Second

GrepTimeout defines timeout grep is waiting for substring

Functions

This section is empty.

Types

type IntegrationSuite added in v0.1.3

type IntegrationSuite struct {
	suite.Suite
	Ctx  context.Context
	Stop func()
	// contains filtered or unexported fields
}

func (*IntegrationSuite) Egrep added in v0.8.0

func (s *IntegrationSuite) Egrep(r io.Reader, expr string) (bool, *bytes.Buffer)

Egrep reads from reader until finds matching regex expression with timeout return result and content that was read

func (*IntegrationSuite) EgrepFromString added in v0.8.0

func (s *IntegrationSuite) EgrepFromString(str string, expr string) bool

EgrepFromString reads the lines in str until finds matching regex expression return result

func (*IntegrationSuite) EgrepWhole added in v0.8.0

func (s *IntegrationSuite) EgrepWhole(r io.Reader, expr string) (bool, *bytes.Buffer)

EgrepWhole reads from reader until finds matching regex expression over whole content with timeout return result and content that was read

func (*IntegrationSuite) EgrepWholeFromString added in v0.8.0

func (s *IntegrationSuite) EgrepWholeFromString(str string, expr string) bool

EgrepWholeFromString reads the lines in str until finds matching regex expression over whole content return result

func (*IntegrationSuite) Grep added in v0.1.4

func (s *IntegrationSuite) Grep(r io.Reader, substr string) (bool, *bytes.Buffer)

Grep reads from reader until finds substring with timeout return result and content that was read

func (*IntegrationSuite) GrepAll added in v0.4.0

func (s *IntegrationSuite) GrepAll(r io.Reader, strs []string) string

GrepAll is like GrepTrue but for an array of strings. It waits util the last line is found, then looks for all the lines in the read text

func (*IntegrationSuite) GrepAndNot added in v0.1.4

func (s *IntegrationSuite) GrepAndNot(r io.Reader, substr, noSubstr string) string

GrepAndNot reads from reader until finds substring with timeout and checks noSubstr was read or fails printing read lines

func (*IntegrationSuite) GrepAndNotAll added in v0.4.0

func (s *IntegrationSuite) GrepAndNotAll(r io.Reader, strs []string, noStrs []string) string

GrepAndNotAll is like GrepAndNot but for arrays of strings. It waits util the last line is found, then looks for all the lines in the read text

func (*IntegrationSuite) GrepFromString added in v0.8.0

func (s *IntegrationSuite) GrepFromString(str string, substr string) bool

GrepFromString reads the lines in str until finds substring return result

func (*IntegrationSuite) GrepTrue added in v0.1.4

func (s *IntegrationSuite) GrepTrue(r io.Reader, substr string) string

GrepTrue reads from reader until finds substring with timeout or fails, printing read lines

func (*IntegrationSuite) IsQueueTested added in v0.3.0

func (suite *IntegrationSuite) IsQueueTested() bool

IsQueueTested returns true if LOOKOUT_TEST_QUEUE env var is set to true

func (*IntegrationSuite) Output added in v0.7.0

func (suite *IntegrationSuite) Output() string

Output returns the output read so far from the reader returned in StartLookoutd

func (*IntegrationSuite) ResetDB added in v0.1.3

func (suite *IntegrationSuite) ResetDB()

ResetDB recreates database for the test

func (*IntegrationSuite) RunCli added in v0.1.3

func (suite *IntegrationSuite) RunCli(cmd string, args ...string) io.Reader

RunCli runs lookout subcommand (not a server)

func (*IntegrationSuite) RunCliErr added in v0.7.0

func (suite *IntegrationSuite) RunCliErr(cmd string, args ...string) io.Reader

RunCliErr runs lookout subcommand that should fail

func (*IntegrationSuite) StartDummy added in v0.1.3

func (suite *IntegrationSuite) StartDummy(args ...string) io.Reader

StartDummy starts dummy analyzer with context and optional arguments

func (*IntegrationSuite) StartLookoutd added in v0.3.0

func (suite *IntegrationSuite) StartLookoutd(configFile string) (io.Reader, io.WriteCloser)

StartLookoutd starts lookoutd serve, or watch and work if the queue testing is enabled

func (*IntegrationSuite) StartServe added in v0.1.3

func (suite *IntegrationSuite) StartServe(args ...string) (io.Reader, io.WriteCloser)

StartServe starts lookout server with context and optional arguments

func (*IntegrationSuite) StartWatcher added in v0.3.0

func (suite *IntegrationSuite) StartWatcher(args ...string) (io.Reader, io.WriteCloser)

StartWatcher starts lookoutd watch with context and optional arguments

func (*IntegrationSuite) StartWorker added in v0.3.0

func (suite *IntegrationSuite) StartWorker(args ...string) (io.Reader, io.WriteCloser)

StartWorker starts lookoutd work with context and optional arguments

func (*IntegrationSuite) StoppableCtx added in v0.1.3

func (suite *IntegrationSuite) StoppableCtx()

StoppableCtx return ctx and stop function

Jump to

Keyboard shortcuts

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