Add web coverage support - #3182
Open
Komoszek wants to merge 5 commits into
Open
Conversation
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
🚀 Preview Deployment Ready!Preview URL: https://pr-3182-patrol-docs.vercel.app Latest Deployment
This preview URL is stable and will be updated with each new commit to this PR. |
Komoszek
marked this pull request as ready for review
July 22, 2026 00:04
Komoszek
requested review from
Kendru98,
PiotrRogulski,
jBorkowska,
pdenert,
piotruela and
zoskar
as code owners
July 22, 2026 00:04
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Komoszek
force-pushed
the
feature/implement-coverage-for-web
branch
from
July 28, 2026 12:17
7e66566 to
f01da95
Compare
pdenert
approved these changes
Aug 2, 2026
Collaborator
There was a problem hiding this comment.
Some of the comments are exaggerated descriptive
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.
Closes #3121
What was implemented
patrol test --coveragenow works on the web platform. Coverage was previouslycollected only on Android/iOS from the Dart VM service; the browser has no Dart VM,
so web runs produced no report. This change collects the browser's native JavaScript
coverage during the Playwright run and maps it back to Dart sources, producing the
same
coverage/patrol_lcov.infoLCOV report as the mobile flow.Notable differences, surfaced in
--helpand the docs:--coverage. It previously just silently skipped coverage collectionHow it works
During a web test run the Playwright runner records Chrome's native JavaScript
coverage (with source maps) for each test. Afterwards the CLI reads that data,
maps the covered JS back to the original Dart lines through the source maps, and
writes the same LCOV report as on mobile. The VM and web paths share the report
formatting and package/workspace filtering, so the output is consistent across
platforms.
Results
Ran the existing
text_fields_test.darton both an Android emulator and Chrome with--coverage. Both produce a valid report over the same file set; below is thecoverage of the exercised widget (
text_fields_screen.dart):The two agree on the widget body. The gap is the documented behaviour: web is binary
covered/uncovered (no hit counts) and the toolchains differ slightly on which lines
are "coverable" — web instruments a few more lines (e.g. the field initializer and the
constconstructor, which it marks uncovered) that the VM omits.