betterer
betterer copied to clipboard
Empty cache created in CI mode
Describe the bug
When running betterer ci command with --cache option it creates empty cache file if it there wasn't cache file before.
To Reproduce
- run
betterer ci --cachecommand without.betterer.cachefile created - check that
.betterer.cachefile doesn't have list of the files although it was created
Content of the cache file after running betterer ci --cache command:
{
"version": 2,
"testCache": {}
}
Expected behavior
A .betterer.cache file created with list of files
Versions (please complete the following information):
- OS: Windows, Linux
- Betterer Version: 5.4.0
- Node Version: 18.16.0
Additional context In our project we don't want to keep cache file in our git repo. Instead we want to generate it on CI, upload it on server and reuse it. But with this issue it's impossible to implement.
The initial design was that the cache would always be disabled in ci (based on the infra I was working with!) but I can see how this would be wanted. If I make this change, any existing config with ci --cache would start having caching which would probably be unexpected (or they just didn't know it wasn't working), so this will have to be a breaking change.