Files
Bobby Ho eb87132790 test: stop Terraform tests from downloading providers that should be cached (#32146)
fix(test): avoid unnecessary Terraform provider downloads in CI

Fix Terraform provider download flakes caused by GitHub 500/504 errors by improving provider cache reuse and CI cache uploads.

- **Fix provider cache misses:** Use a stable providers-only configuration in `TestWorkspaceTemplateParamsChange` instead of a template containing a temporary path.
- **Update CI cache keys:** Include a hash of cache entry names so new providers are cached immediately after a successful `main` run, rather than waiting for the next day.
- **Reduce cache growth:** Avoid approximately 13 MB of redundant cache data per job per day.
- **Preserve existing behavior:** Failed jobs do not save caches, and cache restore and retry behavior remain unchanged.

**Validation:**
- Confirmed repeated test runs reuse cached providers without creating new cache directories.
- Verified Terraform tests pass with network access blocked after the cache is populated.
- Confirmed cache keys remain stable when entries are unchanged and update when entries change.
- All affected tests and `make lint/actions/actionlint` pass.

**Note:** The CI upload action runs only on `main` and requires post-merge verification.

Refs: https://linear.app/codercom/issue/CORE-40/flake-gen-terraform-provider-download-failure-context-deadline
2026-11-13 11:40:07 -07:00
..