Shape

Avoid test caching

Testing-best-practices Cache

Since Go 1.10, test results are automatically cached. This can lead to Go not running your tests again if you haven’t changed any of the Go code. Since you’re probably mainly manipulating Terraform files, you should consider turning the caching of test results off. This ensures that the tests are run every time you run go test and the result is not just read from the cache.

To turn caching off, you can set the -count flag to 1 force the tests to run:

$ go test -count=1 -timeout 30m -p 1 ./...

Built by Gruntwork

Your entire infrastructure. Defined as code. In about a day.

Explore Gruntwork.io