Add unit test coverage for incremental build invalidation. #3985
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For #3811.
Add a new type of unit test covering invalidation logic: build, modify inputs, build again, verify what gets written and/or deleted.
There is a lot to cover here:
The test cases added in this PR only have generated assets with inputs that are also primary inputs. Already we encounter one existing issue #3875 to do with not deleting assets that have become stale. For now I will preserve rather than fix this, aiming for a release that matches current behaviour before fixing :)
Follow-up PRs will build on this to add test coverage for more complex cases: 1) when generators have more single-asset inputs than just the primary input; and 2) when generators have inputs from resolving source, i.e. full transitive deps inputs.
Mostly this coverage is already present in existing unit tests and e2e tests, but I wanted to add smaller+faster+clearer coverage before the next PRs changing the invalidation logic.