OK, I guess that Go has no solution for this. On Friday, March 29, 2019 at 2:20:53 AM UTC+1, twp...@gmail.com wrote: > > I have a bunch of integration tests which depend on external services. > I've added the build tag "integration" for each source file containing such > tests so they are only run when I do: > $ go test -tags=integration ./... > > Go 1.12, by default, caches the tests results, which is exactly what I > don't want because these "external services" are usually different backends > running on my local machine. When I'm developing code, I want to test my > code against the current backend running on my local machine, and not have > "go test" return the result from running the tests against the previous > backend. > > I can disable caching by passing the "-count=1" argument to "go test" but > this is a pretty blunt instrument: I need to remember when I'm running an > integration test and when I'm not, and it applies to the whole set of tests > that I'm running. > > Ideally I'd like to specify within each test whether the result can be > cached or not. I looked at the documentation for testing > <https://godoc.org/testing>, but the word "cache" is not present, > > Is there any way for Go test code to control whether its results should be > cached? > > Cheers, > Tom >
-- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.