Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var TerraformPluginCacheDir = "/tmp/tftest/plugin_cache"
TerraformPluginCacheDir is where the plugins we download are kept. See InitCache() (called on boot) and CleanCache(). You can also override it before calling anything to move it if it's a problem.
Functions ¶
func CleanCache ¶
func CleanCache()
CleanCache cleans our plugin cache by removing it. Put this in TestMain in your tests.
Types ¶
type Harness ¶
type Harness struct {
// contains filtered or unexported fields
}
Harness is the entrypoint into the tftest system
func (*Harness) Apply ¶
Apply the harness and resources with terraform. Apply additionally sets up a Cleanup hook to teardown the environment when the test tears down, and parses the state (see State()).
The cleanup hook is not installed when NO_CLEANUP=1 is set in the environment.
func (*Harness) Destroy ¶
func (h *Harness) Destroy()
Destroy the harness and resources with terraform. Discard this struct after calling this method.
func (*Harness) HandleSignals ¶
HandleSignals handles SIGINT and SIGTERM to ensure that containers get cleaned up. It is expected that no other signal handler will be installed afterwards. If the forward argument is true, it will forward the signal back to its own process after deregistering itself as the signal handler, allowing your test suite to exit gracefully. Set it to false to stay out of your way.
taken from https://github.com/erikh/duct
func (*Harness) PlanDir ¶
PlanDir returns the path to the plan and state, which may be useful in certain failure situations.