test

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestLogLevelEnvVar = "TEST_LOG_LEVEL" // export this env var before running tests if DEBUG level is needed
	SethConfigPath     = "seth.toml"
	SettingsTarget     = "staging-settings"
)

Variables

View Source
var CLIPath = os.TempDir() + string(os.PathSeparator) + "cre" + func() string {
	if os.PathSeparator == '\\' {
		return ".exe"
	}
	return ""
}()

CLI path for testing (also defined in multi_command_flows for their use)

Functions

func ConvertSimulateBeforeAfter added in v1.1.0

func ConvertSimulateBeforeAfter(t *testing.T, projectRoot, workflowDir, workflowName, expectedSubstring string)

ConvertSimulateBeforeAfter runs simulate (capture output), convert, then simulate again and verifies output contains the same expectedSubstring. Simulate runs make build internally when needed.

func InitLogging

func InitLogging()

func LookupAndUnsetEnvVar

func LookupAndUnsetEnvVar(envVar string) string

func NewGraphQLMockServerGetOrganization added in v1.1.0

func NewGraphQLMockServerGetOrganization(t *testing.T) *httptest.Server

NewGraphQLMockServerGetOrganization starts a mock GraphQL server that responds to getOrganization and sets EnvVarGraphQLURL. Caller must defer srv.Close().

func RestoreEnvVar

func RestoreEnvVar(envVar string, value string)

func StartAnvil

func StartAnvil(initState AnvilInitState, stateFileName string) (*os.Process, int, error)

Boot Anvil by either loading Anvil state or running a fresh instance that will dump its state on exit Input parameter can be LOAD_ANVIL_STATE=true or DUMP_ANVIL_STATE=false (look at the defined constants)

func StopAnvil

func StopAnvil(anvilProc *os.Process)

Types

type AnvilInitState

type AnvilInitState int

needed for StartAnvil() function, describes how to boot Anvil

const (
	LOAD_ANVIL_STATE AnvilInitState = iota
	DUMP_ANVIL_STATE AnvilInitState = iota
)

type TestConfig

type TestConfig struct {
	EnvFile              string
	WorkflowSettingsFile string
	ProjectDirectory     string
	// contains filtered or unexported fields
}

func NewTestConfig

func NewTestConfig(t *testing.T) *TestConfig

func (*TestConfig) Cleanup

func (tc *TestConfig) Cleanup(t *testing.T) func()

func (*TestConfig) GetCliEnvFlag

func (tc *TestConfig) GetCliEnvFlag() string

func (*TestConfig) GetProjectRootFlag

func (tc *TestConfig) GetProjectRootFlag() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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