MCPcopy Index your code
hub / github.com/coder/coder / CacheTFProviders

Function CacheTFProviders

testutil/terraform_cache.go:179–185  ·  view source on GitHub ↗

CacheTFProviders caches providers locally and generates a Terraform CLI config to use *only* that cache. This setup prevents network access for providers during `terraform init`, improving reliability in subsequent test runs. Returns the path to the generated CLI config file.

(t *testing.T, rootDir string, testName string, templateFiles map[string]string)

Source from the content-addressed store, hash-verified

177// in subsequent test runs.
178// Returns the path to the generated CLI config file.
179func CacheTFProviders(t *testing.T, rootDir string, testName string, templateFiles map[string]string) string {
180 t.Helper()
181
182 providersParentDir := DownloadTFProviders(t, rootDir, testName, templateFiles)
183 cliConfigPath := WriteTFCliConfig(t, providersParentDir)
184 return cliConfigPath
185}

Callers

nothing calls this directly

Calls 3

DownloadTFProvidersFunction · 0.85
WriteTFCliConfigFunction · 0.85
HelperMethod · 0.65

Tested by

no test coverage detected