-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
Description
Update:
We have to re-evaluate the issue after #1142 is merged
What happened?
If I change something in a testing lib the packages using them over setupFiles or globalSetup in vitest.config.ts have a false cache hit.
The problem:
Project models als all other projects miss the dependencies to testing files referenced in vitest.config.ts.
What would you expect to happen?
If I change something in a testing lib the packages using them over setupFiles or globalSetup in vitest.config.ts do not have a cache hit.
Possible Solutions:
- add
implicitDependenciesto all relevant testing targets - quick but not fine-grained also the biggest downside is our build and any other target in the project would be affected.⚠️ - add the used files from
vitest.config.tsas targetinputs/namedInputs- fine-grained but only maintainable over custom plugin that adds the inputs. But as the used filse insetupFilesorglobalSetupchange it has to be dynamically detected.
What steps did you take?
- ✅ Test the project
modlesinpackages/modelsand verify cache hit
# [existing outputs match the cache, left as is] <= ✅ this is correct. It should have a cache hit
nx run models:unit-test- ✅ Apply any code change in the project
testing-setupin foldertesting/setupand save the change to your filesystem - ❌ Test the project
modlesinpackages/modelsand verify NO cache hit -nx unit-test models
# [existing outputs match the cache, left as is] <= ❌ this is not correct. It should not have a cache hit
nx run models:unit-testCode PushUp package version
No response
What operation system are you on?
MacOS
Node version
24