Skip to content

fix(frontend): report coverage from the browser-mode tests - #7586

Open
aglinxinyuan wants to merge 2 commits into
apache:mainfrom
aglinxinyuan:fix/browser-mode-coverage
Open

fix(frontend): report coverage from the browser-mode tests#7586
aglinxinyuan wants to merge 2 commits into
apache:mainfrom
aglinxinyuan:fix/browser-mode-coverage

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

The browser-mode suite runs in CI and uploads its JUnit results, but never its coverage — so every line those tests exercise is reported as untested. This closes that gap. No test is added or changed.

Measured on code-editor.component.ts by intersecting the two lcov records:

Lines
uncovered by the jsdom run (what Codecov reports today) 115
of those, already hit by the browser spec 67
genuinely untested by either 48
merged coverage 181/229 = 79.0%, up from 49.8%

So roughly three-fifths of that file's advertised gap is already tested. Any PR written off the Codecov ranking would have duplicated seven existing tests to move a number.

Passing --coverage alone does not work. The run fails with:

TypeError: Failed to fetch dynamically imported module:
  http://localhost:PORT/@id/@vitest/coverage-v8/browser?import

The coverage provider is imported dynamically once --coverage is set, so it is not in the import graph Vite's scan crawls — the same reason buffer already needed an explicit hint in this config. Adding @vitest/coverage-v8/browser to optimizeDeps.include fixes it. Note the failure mode: the tests still pass while the coverage step errors, which is why this went unnoticed.

Three changes:

  • vitest.browser.config.ts — add the optimizeDeps include, and write coverage to coverage-browser/ so it cannot overwrite the jsdom run's coverage/gui/lcov.info (that upload happens earlier in the job).
  • build.yml — pass --coverage --coverage-reporters=lcovonly to the browser step and upload the result under the existing frontend flag, which Codecov merges with the jsdom upload.
  • frontend/.gitignore — ignore the new output directory.

How was this PR tested?

Reproduced the failure on main first: ng run gui:test-browser --coverage exits 1 with three errors (Prepare / Run / Coverage) and produces no lcov, while the 7 tests pass.

With the fix, the full browser suite:

yarn --cwd frontend ng run gui:test-browser --coverage --coverage-reporters=lcovonly
 Test Files  3 passed (3)
      Tests  18 passed (18)

exit 0, no errors, and coverage-browser/lcov.info written with 98 files / 1942 lines recorded. The jsdom path is unaffected — ng test --coverage still passes 25 tests and still writes coverage/gui/lcov.info. yarn format:ci passes.

Any related issues, documentation, discussions?

Closes #7462

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 5)

The browser-mode suite runs in CI and uploads its JUnit results, but never
its coverage, so every line it exercises is reported as untested. For
code-editor.component.ts that is 67 of the 115 lines Codecov calls
uncovered - measured by intersecting the two lcov records - and merging
them takes the file from 49.8% to 79.0% without writing a test.

Passing --coverage alone is not enough: the run fails with "Failed to
fetch dynamically imported module: /@id/@vitest/coverage-v8/browser",
because the coverage provider is loaded dynamically and is not in the
import graph that Vite's scan crawls. The tests still pass while the
coverage step errors, which is why this went unnoticed. Adding it to
optimizeDeps.include alongside buffer fixes it.

Browser coverage is written to coverage-browser/ so it does not overwrite
the jsdom run's coverage/gui/lcov.info, and both are uploaded under the
frontend flag, which Codecov merges.
Copilot AI lite review requested due to automatic review settings August 12, 2026 04:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added fix frontend Changes related to the frontend GUI ci changes related to CI labels Aug 12, 2026
@Yicong-Huang Yicong-Huang added the release/v1.2 back porting to release/v1.2 label Aug 12, 2026
@github-actions
github-actions Bot requested a review from xuang7 August 12, 2026 04:31
@github-actions

Copy link
Copy Markdown
Contributor

Backport auto-label report

This fix: PR was checked against each actively-supported release branch. release/* labels drive the post-merge backport, so add or remove one to change where this fix lands.

Release branch Analysis
release/v1.2 Change detected on this branch — label added; this fix is queued to backport here. Requested review from @xuang7.

Auto-label run.

@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @renovate-bot, @Ma77Ball
    You can notify them by mentioning @renovate-bot, @Ma77Ball in a comment.

@codecov-commenter

codecov-commenter commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.85%. Comparing base (5021bc6) to head (4ea698f).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7586      +/-   ##
============================================
+ Coverage     88.63%   88.85%   +0.21%     
+ Complexity     4346     4344       -2     
============================================
  Files          1177     1177              
  Lines         46894    46943      +49     
  Branches       5229     5231       +2     
============================================
+ Hits          41566    41709     +143     
+ Misses         3568     3486      -82     
+ Partials       1760     1748      -12     
Flag Coverage Δ
access-control-service 70.00% <ø> (ø)
agent-service 98.62% <ø> (ø)
amber 84.70% <ø> (-0.02%) ⬇️
computing-unit-managing-service 60.38% <ø> (ø)
config-service 77.31% <ø> (ø)
file-service 69.05% <ø> (ø)
frontend 90.47% <ø> (+0.49%) ⬆️
notebook-migration-service 78.89% <ø> (ø)
pyamber 97.52% <ø> (ø)
workflow-compiling-service 57.89% <ø> (ø)

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 0 better · 🔴 7 worse · ⚪ 8 noise (<±5%) · 0 without baseline

Compared against main 5021bc6 benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🔴 bs=10 sw=10 sl=64 329 0.201 27,839/47,105/47,105 us 🔴 +37.2% / 🔴 +194.6%
🔴 bs=100 sw=10 sl=64 786 0.48 123,305/162,167/162,167 us 🔴 +5.3% / 🔴 +50.1%
bs=1000 sw=10 sl=64 904 0.552 1,104,813/1,192,488/1,192,488 us ⚪ within ±5% / 🔴 +14.8%
Baseline details

Latest main 5021bc6 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 329 tuples/sec 432 tuples/sec 784.3 tuples/sec -23.8% -58.1%
bs=10 sw=10 sl=64 MB/s 0.201 MB/s 0.264 MB/s 0.479 MB/s -23.9% -58.0%
bs=10 sw=10 sl=64 p50 27,839 us 21,131 us 12,590 us +31.7% +121.1%
bs=10 sw=10 sl=64 p95 47,105 us 34,328 us 15,991 us +37.2% +194.6%
bs=10 sw=10 sl=64 p99 47,105 us 34,328 us 18,694 us +37.2% +152.0%
bs=100 sw=10 sl=64 throughput 786 tuples/sec 822 tuples/sec 1,002 tuples/sec -4.4% -21.6%
bs=100 sw=10 sl=64 MB/s 0.48 MB/s 0.502 MB/s 0.612 MB/s -4.4% -21.5%
bs=100 sw=10 sl=64 p50 123,305 us 120,880 us 101,285 us +2.0% +21.7%
bs=100 sw=10 sl=64 p95 162,167 us 154,066 us 108,068 us +5.3% +50.1%
bs=100 sw=10 sl=64 p99 162,167 us 154,066 us 118,235 us +5.3% +37.2%
bs=1000 sw=10 sl=64 throughput 904 tuples/sec 924 tuples/sec 1,030 tuples/sec -2.2% -12.2%
bs=1000 sw=10 sl=64 MB/s 0.552 MB/s 0.564 MB/s 0.629 MB/s -2.1% -12.2%
bs=1000 sw=10 sl=64 p50 1,104,813 us 1,083,952 us 991,882 us +1.9% +11.4%
bs=1000 sw=10 sl=64 p95 1,192,488 us 1,135,815 us 1,038,496 us +5.0% +14.8%
bs=1000 sw=10 sl=64 p99 1,192,488 us 1,135,815 us 1,068,265 us +5.0% +11.6%
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,607.52,200,128000,329,0.201,27839.49,47105.33,47105.33
1,100,10,64,20,2543.83,2000,1280000,786,0.480,123305.12,162167.16,162167.16
2,1000,10,64,20,22113.84,20000,12800000,904,0.552,1104813.45,1192487.81,1192487.81

@aglinxinyuan aglinxinyuan removed the release/v1.2 back porting to release/v1.2 label Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci changes related to CI fix frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Browser-mode specs run without coverage, so ~75 tested lines report as uncovered

4 participants