- Notifications
You must be signed in to change notification settings - Fork1.1k
fix: add cache for terraform installer files#20776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
pawbana commentedNov 14, 2025
I think69021e7 works although it is quite ugly:https://github.com/coder/coder/actions/runs/19376939370/job/55446613426 (some other test fails) |
mtojek left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think you skipped some of comments from past iterations.
| varerrbuf strings.Builder | ||
| if_,err:=os.Stat(filepath.Join(tmpDir,"go.mod"));errors.Is(err,os.ErrNotExist) { | ||
| cmd:=exec.Command("go","mod","init","fake-terraform") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thinking loud -
Since you have logic to dynamically create a fake terraform binary, can we use it for all cases, I mean mac/linux/windows?
Also, if the binary runs on the same platform as testing code, can it dynamically figure out the os and arch?
I'm curious if we can get rid of those if-windows clauses in favor of generic code for all platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
We could do that, although I'd rather avoid compiling if possible. I'd like to check if there is no other way for windows.
If compilation was windows is required then still I think it may be better to avoid it for linux/mac.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Talked with@hugodutka a bit and decided to go with cached proxy approach. Installers are cached in test cache and only downloaded on cache miss.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
mtojek commentedNov 15, 2025
@pawbana Hmm.. I admit I can't figure out the fix from the commit history. What was the root cause? |
pawbana commentedNov 17, 2025
Root cause is my first attempt to mock terraform installation files and not being aware I should also prepare mac/windows versions:edf056b (I've asked if I should revert it but was told it is fine to leave it failing for short time). |
pawbana commentedNov 17, 2025
nightly-gauntlet fails due to unrelated reason but test passes:https://github.com/coder/coder/actions/runs/19435271482/job/55604365354#step:11:325 |
hugodutka left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM
| tmpDir:=createFakeTerraformInstallationFiles(t) | ||
| addr:=startFakeTerraformServer(t,tmpDir) | ||
| proxy:=persistentlyCachedProxy(t) |
hugodutkaNov 17, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
| proxy:=persistentlyCachedProxy(t) | |
| // lets us cache terraform binaries between test runs to improve CI flakiness | |
| proxy:=persistentlyCachedProxy(t) |
Uh oh!
There was an error while loading.Please reload this page.
158243d intomainUh oh!
There was an error while loading.Please reload this page.
mtojek commentedNov 18, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I see you have already merged the PR. Next time please give reviewers more time to gain more 👍, unless it is emergency. I can’t review it the regular way as Github fails with “Issue is locked”, so here is my review:
BTW, these can be improved in follow-ups. |
Uh oh!
There was an error while loading.Please reload this page.
Replaces mocks by simple proxy that caches terraform files using test cache
coder/testutil/cache.go
Line 13 in16b8e60
Fixes:coder/internal#1126