The new test caching stuff is neat, except when a test has an external dependency (e.g. it is testing code that hits a web service), and we don't want the test's result to be cached (so that we're always exercising the code against the real world).
There are ways to disable the test caching from the user's perspective (e.g. passing -count=1), but not from the test itself from what I can tell. It'd be nice if tests in this position could do something to indicate to the go tool that its result and output should not be cached.
Some ideas:
- Have a method on
*testing.T that can be invoked to signal this.
- Have a specified file to touch (e.g.
$GOCACHE/something).
- Have a naming convention for such tests (e.g. must have an
External substring).
The new test caching stuff is neat, except when a test has an external dependency (e.g. it is testing code that hits a web service), and we don't want the test's result to be cached (so that we're always exercising the code against the real world).
There are ways to disable the test caching from the user's perspective (e.g. passing
-count=1), but not from the test itself from what I can tell. It'd be nice if tests in this position could do something to indicate to thegotool that its result and output should not be cached.Some ideas:
*testing.Tthat can be invoked to signal this.$GOCACHE/something).Externalsubstring).