github.com/quay/claircore@v1.5.28/docs/contributor/tests.md (about) 1 # Tests 2 3 Tests in the claircore module may use various helpers underneath the `test` directory. 4 Using these packages outside of testing code is disallowed. 5 Assert packages are disallowed; 6 the `go-cmp` package is the only external package helper allowed. 7 8 Tests that use external resources or generate test fixtures should be annotated according to the [`integration`] package. 9 10 [`integration`]: https://pkg.go.dev/github.com/quay/claircore/test/integration 11 12 ## Caching 13 14 Tests using the `integration` package cache generated and downloaded assets into a directory named `clair-testing` inside the directory reported by [`os.UserCacheDir`]. 15 For example, on a Linux system, the cache directory will be (in `sh` notation) `${XDG_CACHE_HOME-$HOME/.cache}/clair-testing`. 16 17 [`os.UserCacheDir`]: https://pkg.go.dev/os#UserCacheDir