Documentation
¶
Overview ¶
Package utils contains e2e tests utils for cli tools e2e tests
Index ¶
- func CLITestSuite(ctx context.Context, tswg *sync.WaitGroup, testSuites chan *junitxml.TestSuite, ...)
- func ContainsSubString(strs []string, s string) bool
- func Failure(testCase *junitxml.TestCase, logger *log.Logger, msg string)
- func GcloudAuth(logger *log.Logger, testCase *junitxml.TestCase) bool
- func GcloudUpdate(logger *log.Logger, testCase *junitxml.TestCase, latest bool) bool
- func RunCliTool(logger *log.Logger, testCase *junitxml.TestCase, cmdString string, ...) error
- func RunTestCommand(cmd string, args []string, logger *log.Logger, testCase *junitxml.TestCase) bool
- func RunTestCommandAsync(cmd string, args []string, logger *log.Logger, testCase *junitxml.TestCase) *exec.Cmd
- func RunTestCommandIgnoringError(cmd string, args []string, logger *log.Logger, testCase *junitxml.TestCase) bool
- func RunTestForTestType(cmd string, args []string, testType CLITestType, logger *log.Logger, ...) bool
- type CLITestType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CLITestSuite ¶
func CLITestSuite(ctx context.Context, tswg *sync.WaitGroup, testSuites chan *junitxml.TestSuite, logger *log.Logger, testSuiteRegex, testCaseRegex *regexp.Regexp, testProjectConfig *testconfig.Project, testSuiteName string, testsMap map[CLITestType]map[*junitxml.TestCase]func( context.Context, *junitxml.TestCase, *log.Logger, *testconfig.Project, CLITestType))
CLITestSuite executes given test suite.
func ContainsSubString ¶
ContainsSubString checks whether the string slice contains a substring anywhere.
func GcloudAuth ¶
GcloudAuth runs "gcloud auth"
func GcloudUpdate ¶
GcloudUpdate runs "gcloud update" to pull either latest or prod version
func RunCliTool ¶
func RunCliTool(logger *log.Logger, testCase *junitxml.TestCase, cmdString string, args []string) error
RunCliTool runs a cli tool with given args
func RunTestCommand ¶
func RunTestCommand(cmd string, args []string, logger *log.Logger, testCase *junitxml.TestCase) bool
RunTestCommand runs given test command
func RunTestCommandAsync ¶
func RunTestCommandAsync(cmd string, args []string, logger *log.Logger, testCase *junitxml.TestCase) *exec.Cmd
RunTestCommandAsync runs given test command asynchronously
func RunTestCommandIgnoringError ¶
func RunTestCommandIgnoringError(cmd string, args []string, logger *log.Logger, testCase *junitxml.TestCase) bool
RunTestCommandIgnoringError runs given test command. The test case won't be marked as fail even error happens.
func RunTestForTestType ¶
func RunTestForTestType(cmd string, args []string, testType CLITestType, logger *log.Logger, testCase *junitxml.TestCase) bool
RunTestForTestType runs test for given test type
Types ¶
type CLITestType ¶
type CLITestType string
CLITestType defines which type of test is going to be executed
const ( Wrapper CLITestType = "1 wrapper" GcloudBetaProdWrapperLatest CLITestType = "2 gcloud(beta)-prod wrapper-latest" GcloudBetaLatestWrapperLatest CLITestType = "3 gcloud(beta)-latest wrapper-latest" GcloudGaLatestWrapperRelease CLITestType = "4 gcloud(ga)-latest wrapper-release" )
List all test types here