-
Notifications
You must be signed in to change notification settings - Fork 125
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
passed reruns do not cache correctly? #351
Comments
Ya, that is not surprising to me given the description of the test cache (https://pkg.go.dev/cmd/go/internal/test, specifically the paragraph that descries "list mode", and the following one that explains "go test caches successful package test I'm assuming you're working on this for Consul. From my experience Consul would benefit significantly from splitting its two largest packages ( |
This bit is interesting as well
In CI it's unlikely the test cache will be useful by default, because the environment variables set by the CI system will be different on each run (ex: build number). Presumably most large projects read environment variables in one place or another. You would have to run |
I do agree it is looking to be a pragmatic idea. I'm struggling to get all the unit tests to pass in the same run at the moment. 😅 |
Yeah, then I'd have to run them in parallel, all the runner flags, etc. Honestly I'm almost at the point of cloning the caching logic and hacking it into |
I could be wrong but I believe it hooks |
Cool, maybe it is smart enough to only consider the env vars that are accessed as long as Since each package is run as a separate binary, maybe there are enough packages that don't access environment variables that it works more often then I expected. |
This is kind of surprising behavior, unless you know details about how Go does test caching.
When using
gotestsum --rerun-fails
, if the first run fails but the package ultimately passes, that result doesn't really get cached.This is because
go test
doesn't treat-run
specially. It doesn't cache the result at a function level at all. I did more investigation and a repro here: https://github.com/nfi-hashicorp/gotestsum-rerun-cachingI'm not sure there's anything to be done about this?
The text was updated successfully, but these errors were encountered: