e2e

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunShortRunCmd

func RunShortRunCmd(args []string, dir string, envs []string) (string, error)

RunShortRunCmd defines a cmd which run and exits immediately

args 命令列表

dir 命令运行所在的目录

envs 额外的环境变量

func SearchSymbolInBinary

func SearchSymbolInBinary(dir string, binary string, symbol string) (bool, error)

SearchSymbolInBinary searches if the specified symbol is compiled into the bianry

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) Run

func (l *LongRunCmd) Run()

Run in backend

func (*LongRunCmd) Stop

func (l *LongRunCmd) Stop()

type Sample

type Sample struct {
	Dir         string `yaml:"dir"`
	Description string `yaml:"description"`
}

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

Jump to

Keyboard shortcuts

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