MCPcopy Create free account
hub / github.com/clouditor/clouditor / RunCLITest

Function RunCLITest

internal/testutil/clitest/cli.go:77–84  ·  view source on GitHub ↗

RunCLITest can be used in a TestMain function for CLI tests. It takes care of launching an authorization server as well as a gRPC server with the selected services supplied as options. It also automatically issues a login command to the auth service. Since this function is primarily used in a TestM

(m *testing.M, opts ...server.StartGRPCServerOption)

Source from the content-addressed store, hash-verified

75// Since this function is primarily used in a TestMain and no testing.T object is available at this
76// point, this function WILL panic on errors.
77func RunCLITest(m *testing.M, opts ...server.StartGRPCServerOption) (code int) {
78 ret, err := RunCLITestFunc(m.Run, opts...)
79 if err != nil {
80 panic(err)
81 }
82
83 return *ret
84}
85
86// RunCLITestFunc can be used to launch individual test functions with a gRPC server. It takes care of launching an
87// authorization server as well as a gRPC server with the selected services supplied as options. It also automatically

Callers 10

TestMainFunction · 0.92
TestMainFunction · 0.92
TestMainFunction · 0.92
TestMainFunction · 0.92
TestMainFunction · 0.92
TestMainFunction · 0.92
TestMainFunction · 0.92
TestMainFunction · 0.92
TestMainFunction · 0.92
TestMainFunction · 0.92

Calls 1

RunCLITestFuncFunction · 0.85

Tested by 10

TestMainFunction · 0.74
TestMainFunction · 0.74
TestMainFunction · 0.74
TestMainFunction · 0.74
TestMainFunction · 0.74
TestMainFunction · 0.74
TestMainFunction · 0.74
TestMainFunction · 0.74
TestMainFunction · 0.74
TestMainFunction · 0.74