Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunShortRunCmd ¶
RunShortRunCmd defines a cmd which run and exits immediately
args 命令列表
dir 命令运行所在的目录
envs 额外的环境变量
Types ¶
type LongRunCmd ¶
type LongRunCmd struct {
// contains filtered or unexported fields
}
LongRunCmd defines a cmd which run for a long time
func NewLongRunCmd ¶
func NewLongRunCmd(args []string, dir string, envs []string) *LongRunCmd
NewLongRunCmd defines a command which will be run forever
You can specify the whole command arg list, the directory where the command will be run in, and the env list.
args 命令列表
dir 命令运行所在的目录
envs 额外的环境变量
func (*LongRunCmd) CheckExitStatus ¶
func (l *LongRunCmd) CheckExitStatus() error
func (*LongRunCmd) GetStdoutStdErr ¶
func (l *LongRunCmd) GetStdoutStdErr() (string, string)
func (*LongRunCmd) Stop ¶
func (l *LongRunCmd) Stop()
type SamplesMgr ¶
type SamplesMgr struct { Samples map[string]Sample `yaml:"samples"` // contains filtered or unexported fields }
SamplesMgr create and return sample for test case
ginkgo 的并发执行时的运行模型是多进程模型,会有多个独立的 go test 进程。 Ginkgo has support for running specs in parallel. It does this by spawning separate go test processes and serving specs to each process off of a shared queue.
所以这里设计成每个 test case 在各自的临时目录中生成 sample,以便将来测试用例可以并发执行。
func NewSamplesMgr ¶
func NewSamplesMgr() *SamplesMgr
func (*SamplesMgr) GetAvailablePort ¶
func (m *SamplesMgr) GetAvailablePort() (string, error)
GetAvailablePort get next available host port among multiprocess ginkgo test cases
利用文件锁和端口探活,获取下一个可用的 port
func (*SamplesMgr) GetSampleByKey ¶
func (m *SamplesMgr) GetSampleByKey(key string) (string, error)
GetSampleByKey return the sample folder location for test use