github.com/darmach/terratest@v0.34.8-0.20210517103231-80931f95e3ff/docs/_docs/02_testing-best-practices/avoid-test-caching.md (about)

     1  ---
     2  layout: collection-browser-doc
     3  title: Avoid test caching
     4  category: testing-best-practices
     5  excerpt: >-
     6    Since Go 1.10, test results are automatically cached. See how to turn off caching test results.
     7  tags: ["testing-best-practices", "cache"]
     8  order: 207
     9  nav_title: Documentation
    10  nav_title_link: /docs/
    11  ---
    12  
    13  Since Go 1.10, test results are automatically [cached](https://golang.org/doc/go1.10#test). This can lead to Go not
    14  running your tests again if you haven't changed any of the Go code. Since you're probably mainly manipulating Terraform
    15  files, you should consider turning the caching of test results off. This ensures that the tests are run every time
    16  you run `go test` and the result is not just read from the cache.
    17  
    18  To turn caching off, you can set the `-count` flag to `1` force the tests to run:
    19  
    20  ```shell
    21  $ go test -count=1 -timeout 30m -p 1 ./...
    22  ```