`cabal test` slow because of lack of caching
Open
type: user-question
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
**Describe the bug**
`cabal test` is slower than running `cabal run tests` when nothing has changed. This issue is exacerbated when using the new [code generators](https://github.com/haskell/cabal/pull/7688) feature, which makes cabal recompile the test suite on every invocation.
**To Reproduce**
Clone https://github.com/gbaz/cabal-doctest-demo.
```bash
$ cabal v2-test
```
Running the second time still recompiles the test suite.
```bash
$ cabal v2-test
```
**Expected behavior**
Cabal should not recompile the entire test suite when nothing has changed.
**System information**
- NixOS 22.05
- Cabal 3.8.1.0
- GHC 9.2.4
Contributor guide
Assessment
This issue has not been assessed yet.