Documentation ¶
Index ¶
- Constants
- Variables
- func AddBigQuerySourceToHasura(t TestingT, globalSelectLimit int, ...)
- func AddCitusSourceToHasura(t TestingT, hasuraEndpoint, connectionString, sourceName string)
- func AddCockroachSourceToHasura(t TestingT, hasuraEndpoint, connectionString, sourceName string)
- func AddDatabaseToHasura(t TestingT, hgeEndpoint, sourceName, databaseKind string) (string, func())
- func AddMSSQLSourceToHasura(t TestingT, hasuraEndpoint, connectionString, sourceName string)
- func AddPGSourceToHasura(t TestingT, hasuraEndpoint, connectionString, sourceName string)
- func CloseWithLogOnErr(closer io.Closer)
- func Command(cmdPath string, opts CmdOpts) *Session
- func Hasura(opts CmdOpts) *Session
- func NewHttpcClient(t *testing.T, port string, headers map[string]string) *httpc.Client
- func NewRequest(t *testing.T, method, urlStr string, body interface{}) *http.Request
- func RandDirName() string
- func RemoveDir(dirName string)
- func RemoveHasuraConfigHomeDirectory()
- func RunCommandAndSucceed(opts CmdOpts) *Session
- func SendHTTPRequestWithFileAsBody(t *testing.T, filepath, url string) *http.Response
- func StartCitusContainer(t TestingT) (string, func())
- func StartCockroachContainer(t TestingT) (connectionString string, teardown func())
- func StartHasura(t TestingT, image string) (port string, teardown func())
- func StartHasuraCLIMigrations(t TestingT, image string, pgConnectionUrl string, ...) (port string, teardown func())
- func StartHasuraWithBigQuerySource(t TestingT, image string) (hasuraPort, sourceName, projectId, dataset string, teardown func())
- func StartHasuraWithCitusSource(t TestingT, image string) (string, string, func())
- func StartHasuraWithCockroachSource(t TestingT, image string) (hasuraPort, sourceName string, teardown func())
- func StartHasuraWithMSSQLSource(t *testing.T, version string) (string, string, func())
- func StartHasuraWithMetadataDatabase(t TestingT, image string) (port string, teardown func())
- func StartHasuraWithPG(t TestingT, image string, pgConnectionUrl string, ...) (port string, teardown func())
- func StartMSSQLContainer(t TestingT) (string, func())
- func StartPGContainer(t TestingT) (connectionString string, teardown func())
- type CmdOpts
- type TestingT
Constants ¶
View Source
const ( DebugCommandPrefix = "\nCMD>" DebugCommandPrefixWithDir = "\nCMD %s>" DebugOutPrefix = "OUT: " DebugErrPrefix = "ERR: " DefaultE2ETestTimeout = 60 // in seconds )
Variables ¶
View Source
var ( HasuraDockerImage = func() string { graphqlEngineDockerImage := os.Getenv("HASURA_TEST_CLI_HGE_DOCKER_IMAGE") if graphqlEngineDockerImage != "" { return graphqlEngineDockerImage } return "" }() TestAdminSecret = os.Getenv("HASURA_GRAPHQL_TEST_ADMIN_SECRET") DockerSwitchIP = func() string { switch runtime.GOOS { case "darwin", "windows": return "host.docker.internal" } return "172.17.0.1" }() Hostname = "localhost" BaseURL = fmt.Sprintf("http://%s", Hostname) MSSQLPassword = "MSSQLp@ssw0rd" CLIBinaryPath = func() string { if os.Getenv("CI") == "true" { return "/build/_cli_output/binaries/cli-hasura-linux-amd64" } hasuraCliPathEnv := os.Getenv("HASURA_TEST_CLI_PATH") if hasuraCliPathEnv != "" { return hasuraCliPathEnv } return "hasura" }() )
this can be overridden by ldflags
Functions ¶
func AddBigQuerySourceToHasura ¶ added in v2.20.0
func AddCitusSourceToHasura ¶
func AddCockroachSourceToHasura ¶ added in v2.18.0
func AddDatabaseToHasura ¶ added in v2.14.0
func AddMSSQLSourceToHasura ¶
func AddPGSourceToHasura ¶
func CloseWithLogOnErr ¶
func NewHttpcClient ¶
func NewRequest ¶
func RandDirName ¶
func RandDirName() string
func RemoveHasuraConfigHomeDirectory ¶
func RemoveHasuraConfigHomeDirectory()
func RunCommandAndSucceed ¶
func RunCommandAndSucceed(opts CmdOpts) *Session
func StartCitusContainer ¶
StartCitusContainer and creates a database and returns the port number
func StartCockroachContainer ¶ added in v2.18.0
func StartHasura ¶
func StartHasuraWithBigQuerySource ¶ added in v2.20.0
func StartHasuraWithCockroachSource ¶ added in v2.18.0
func StartHasuraWithMSSQLSource ¶
starts a hasura instance with a metadata database and a msssql source returns the mssql port, source name and teardown function
func StartHasuraWithPG ¶
func StartMSSQLContainer ¶
startsMSSQLContainer and creates a database and returns the port number
func StartPGContainer ¶
Types ¶
type TestingT ¶
type TestingT interface { Skip(args ...interface{}) Fatal(args ...interface{}) Fatalf(format string, args ...interface{}) }
TestingT is a workaround for using test helpers on Ginkgo tests and normal go tests this interfaces is introduced ginkgo specs do not have a handle of *testing.T and therefore cannot be used directly in test helpers
Click to show internal directories.
Click to hide internal directories.