MCPcopy
hub / github.com/Azure/aztfexport / EnsureTF

Function EnsureTF

internal/test/utils.go:106–118  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

104}
105
106func EnsureTF(t *testing.T) string {
107 i := install.NewInstaller()
108 execPath, err := i.Ensure(context.Background(), []src.Source{
109 &fs.Version{
110 Product: product.Terraform,
111 Constraints: version.MustConstraints(version.NewConstraint(">=0.12")),
112 },
113 })
114 if err != nil {
115 t.Fatalf("failed to find a Terraform executable: %v", err)
116 }
117 return execPath
118}
119
120func Verify(t *testing.T, ctx context.Context, aztfexportDir, tfexecPath string, expectResCnt int) {
121 tf, err := tfexec.NewTerraform(aztfexportDir, tfexecPath)

Callers 7

runCaseFunction · 0.92
runCaseFunction · 0.92
TestQueryModeFunction · 0.92
runCaseFunction · 0.92
TestAppendModeFunction · 0.92
TestAppendToModuleFunction · 0.92
runHCLOnlyFunction · 0.92

Calls

no outgoing calls

Tested by 7

runCaseFunction · 0.74
runCaseFunction · 0.74
TestQueryModeFunction · 0.74
runCaseFunction · 0.74
TestAppendModeFunction · 0.74
TestAppendToModuleFunction · 0.74
runHCLOnlyFunction · 0.74