MCPcopy Create free account
hub / github.com/coder/coder / downloadProviders

Function downloadProviders

enterprise/coderd/workspaces_test.go:3596–3608  ·  view source on GitHub ↗

downloadProviders is a test helper that caches Terraform providers and returns the path to a Terraform CLI config file that uses the cached providers. This uses the shared testutil caching infrastructure to avoid re-downloading providers on every test run. It is the responsibility of the caller to s

(t *testing.T, providersTf string)

Source from the content-addressed store, hash-verified

3594// TF_CLI_CONFIG_FILE.
3595// On Windows, provider caching is not supported and an empty string is returned.
3596func downloadProviders(t *testing.T, providersTf string) string {
3597 t.Helper()
3598
3599 cacheRootDir := filepath.Join(testutil.PersistentCacheDir(t), "terraform_workspace_tags_test")
3600 templateFiles := map[string]string{"providers.tf": providersTf}
3601 testName := "TestWorkspaceTagsTerraform"
3602
3603 cliConfigPath := testutil.CacheTFProviders(t, cacheRootDir, testName, templateFiles)
3604 if cliConfigPath != "" {
3605 t.Logf("Set TF_CLI_CONFIG_FILE=%s", cliConfigPath)
3606 }
3607 return cliConfigPath
3608}
3609
3610// Blocked by autostart requirements
3611func TestExecutorAutostartBlocked(t *testing.T) {

Callers 2

Calls 4

PersistentCacheDirFunction · 0.92
CacheTFProvidersFunction · 0.92
HelperMethod · 0.65
LogfMethod · 0.65

Tested by

no test coverage detected