diff --git a/enterprise/coderd/workspaces_test.go b/enterprise/coderd/workspaces_test.go index 44244f238f..9d1377610c 100644 --- a/enterprise/coderd/workspaces_test.go +++ b/enterprise/coderd/workspaces_test.go @@ -3393,6 +3393,7 @@ func workspaceTagsTerraform(t *testing.T, tc testWorkspaceTagsTerraformCase, dyn // This uses the shared testutil caching infrastructure to avoid re-downloading // providers on every test run. It is the responsibility of the caller to set // TF_CLI_CONFIG_FILE. +// On Windows, provider caching is not supported and an empty string is returned. func downloadProviders(t *testing.T, providersTf string) string { t.Helper() @@ -3401,7 +3402,9 @@ func downloadProviders(t *testing.T, providersTf string) string { testName := "TestWorkspaceTagsTerraform" cliConfigPath := testutil.CacheTFProviders(t, cacheRootDir, testName, templateFiles) - t.Logf("Set TF_CLI_CONFIG_FILE=%s", cliConfigPath) + if cliConfigPath != "" { + t.Logf("Set TF_CLI_CONFIG_FILE=%s", cliConfigPath) + } return cliConfigPath } diff --git a/testutil/terraform_cache_windows.go b/testutil/terraform_cache_windows.go new file mode 100644 index 0000000000..8c7b4bae29 --- /dev/null +++ b/testutil/terraform_cache_windows.go @@ -0,0 +1,17 @@ +//go:build windows + +package testutil + +import ( + "testing" +) + +// CacheTFProviders is a no-op on Windows. +// Terraform provider caching is only supported on Linux and macOS due to +// platform-specific filesystem operations and Terraform's provider mirror behavior. +// On Windows, tests will download providers normally during terraform init. +func CacheTFProviders(t *testing.T, rootDir string, testName string, templateFiles map[string]string) string { + t.Helper() + t.Log("Terraform provider caching is not supported on Windows; providers will be downloaded normally") + return "" +}