Repository navigation
fix(tia): refresh edges within the coverage scope in coverage runs - #1956
Closed
almontasser wants to merge 1 commit into
Closed
almontasser wants to merge 1 commit into
almontasser wants to merge 1 commit into
Conversation
A coverage run replaces a test file's edges to files its coverage data can show and keeps the rest. It keeps every edge of a test file it saw only in part.
Member
|
hi friend, thank you! there is a lot of changes on this pr that are not related to the issue. going with #1955 for the fix, feel free to send the edge-dropping part as a separate pr. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What:
Description:
In
--tia --coveragemode,Graph::replaceEdges()runs withkeepExisting: trueand skips every test that already has edges. When a test starts using a file it didn't touch when the graph was recorded, the coverage run never adds that edge. A later break in that file replays the test as passed.A coverage run now replaces a test file's edges within the scope it can observe: the files its coverage data can show (files with an executable line and no ignored code), plus the Blade views that the link tracker records in both modes. It keeps recorded edges to every other file, such as files outside
<source>, and adds the new edges. If the run saw a test file only in part, because a test was replayed from the cache, skipped, incomplete, risky, or narrowed bycovers()orcoversNothing(), it keeps all of that file's recorded edges and only adds new ones. Workers send their observed files and partly seen test files with their edge partials, so--parallelmakes the same decision.Regression tests:
tests/Unit/Plugins/Tia/Graph.php:replaceEdges()with no observed files (plain runs), an empty list, and a list;bladeFiles().tests/Features/Tia/CoveragePiggyback.php, sequentially and in parallel: a coverage run adds a dependency that a test gained, and drops a dependency or a view that it lost (these fail on5.x). It keeps an edge outside<source>or to code its coverage ignores, and keeps the edges of a test file that it filtered, replayed in part, or whose coverage it didn't record.Related:
Fixes #1953