Package runner provides helpers for compiling and running the Terramate binary with the intent of doing e2e tests. Additionally, it also provides functions for building and installing dependency binaries.
This section is empty.
HelperPath is the path to the test binary we compiled for test purposes
HelperPathAsHCL is the path to the test binary but as a safe HCL expression that's valid in all supported OSs.
TerraformTestPath is the path to the installed terraform binary.
TerraformVersion is the detected or installed Terraform version.
AssertRun asserts that the provided run result is successfully and with no output.
AssertRunResult asserts that the result matches the expected.
BuildTerramate build the Terramate binary from the current filesystem tree provided in the projectRoot directory. The binary is built into the provided binDir directory. The projectRoot is also used to compute the Terramate main package.
BuildTestHelper builds the helper tool from the provided projectRoot directory into the binDir directory. The projectRoot is also used to compute the helper main package.
InstallTerraform installs Terraform (if needed). The preferredVersion is used if terraform is not yet installed.
PollBufferForMsgs will check if each message is present on the buffer on signal handling sometimes we get extraneous signals on the test process like "urgent I/O condition". This function will ignore any unknown messages in between but check that at least all msgs where received in the provided order (but ignoring unknown messages in between).
RemoveEnv removes an environment variable from the set.
SendUntilMsgIsReceived send a signal until the provided messages are read in the output.
Setup the e2e test runner.
Teardown cleanup the runner files.
CLI is a Terramate CLI runner.
NewCLI creates a new runner for the CLI.
NewInteropCLI creates a new runner CLI suited for interop tests.
ListChangedStacks is a helper for executing `terramate list --changed`.
ListStacks is a helper for executinh `terramate list`.
NewCmd creates a new terramate command prepared to executed.
NewRunFixture returns a new runFixture ready to be executed which supports 3 execution modes:
In the case of HangRun mode, the steps below will happen:
In the case of SleepRun mode, the steps below will happen:
Usage:
cli := NewCli(t, chdir) fixture := NewRunFixture(hangRun, s.RootDir(), "--sync-deployment") result = fixture.Run() AssertRunResult(t, result, expected)
PrependToPath prepend the provided directory to the OS's PATH environment variable in a portable way.
RunScript is a helper for executing `terramate run-script`.
RunWithStdin runs the CLI but uses the provided string as stdin.
SetWorkingDir sets the process working directory. Not to be confused with tm.Chdir which controls the `--chdir` flag.
StacksRunGraph is a helper for executing `terramate experimental run-graph`.
Trigger is a helper for executing `terramate experimental trigger ...`.
TriggerRecursively is a helper for executing `terramate experimental trigger --recursively`.
TriggerStack is a helper for executing `terramate experimental trigger`.
type Cmd struct { Stdin *buffer Stdout *buffer Stderr *buffer }
Cmd is a generic runner that can be used to run any command.
ExitCode returns the exit code for a finished command.
Setpgid sets the pgid process attribute. When set, the command will execute in a new process group id.
SignalGroup sends the signal to all processes part of the cmd group.
Wait for the command completion.
RunExpected specifies the expected result for the CLI execution.
type RunFixture struct { Command []string }
RunFixture defines a runner fixture for specialized modes of run.
RunMode is a run mode for the command.
RunResult specify the result of executing the cli.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4