test(frontend): cover the result, export and runtime-statistics services - #7993
Merged
aglinxinyuan merged 2 commits intoAug 27, 2026
Merged
Conversation
+11 fully-covered lines and +10 branch arms across four files; three reach
100%. Of the eleven, nine are reachable from the real UI and two are
defensive defaults on public methods -- split in the PR body rather than
presented as equivalent.
user-dataset-file-renderer was in scope and is absent at zero lines, and
workflow-action.service was excluded from the outset: its three partials
compare a Y.Map value against a freshly-constructed {x, y} by reference, so
the guard cannot fire in production.
Assessing the renderer found dead code, reported not pinned: the empty-row
filter in loadTabularFile can never fire, because `for (const cell in row)`
enumerates array index strings and never the empty string, so no row is ever
filtered despite the comment saying otherwise.
22 mutations, 21 killed, one equivalent. The first pass claimed no survivors
on a file it had taken to 100%; that file carried two real holes behind the
percentage.
Contributor
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7993 +/- ##
============================================
+ Coverage 93.21% 93.27% +0.06%
Complexity 4664 4664
============================================
Files 1175 1177 +2
Lines 47646 47674 +28
Branches 5319 5321 +2
============================================
+ Hits 44413 44470 +57
+ Misses 1752 1741 -11
+ Partials 1481 1463 -18
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Xinyuan Lin <xinyual3@uci.edu>
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 changes were proposed in this PR?
Four frontend services and one component, bundled because each is only ~3 lines alone. Measured with the CI command itself (
nx test --coverage --coverage-reporters=lcovonly), before state restored per-file viagit show HEAD:<path>.+11 fully-covered lines and +10 branch arms. Three of the four files reach 100%;
workflow-result.service.tsreaches 99.15%.Of those +11, nine are reachable from the real UI and two are defensive defaults on public methods. I would rather split them than present all eleven as equivalent. The weaker two:
workflow-runtime-statistics.component.ts:137is an out-of-range tab index that the template cannot produce — it renders exactly 8 tabs for 8 metric keys — but it is a public method reachable with a legal argument, so it counts rather than being refused.user-dataset-file-renderer.component.tswas in scope and is absent, contributing zero: two dead??/||fallbacks already gated byisPreviewSupported, plus an unreachable partial.workflow-action.service.tswas excluded from the outset for the same reason — its three partials compare aY.Mapvalue against a freshly-constructed{x, y}by reference, so the guard cannot fire in production.A dead-code defect found while assessing, reported not pinned
The empty-row filter in
user-dataset-file-renderer'sloadTabularFileis entirely dead.for (const cell in row)enumerates array index strings —"0","1", … — never"", socell != ""is always true,areCellAllEmptyis always false, and no row is ever filtered. Verified directly in node: a table containing an all-empty row and an empty row keeps both, with the empty one padded out — contradicting the code's own "filter out all empty row" comment.Fixing it means iterating values with
for...of, which is a production change. The current behaviour is deliberately not pinned, so a fix will not have to fight a test.Verification
22 mutations, 21 killed, 1 equivalent survivor (
workflow-result.service.ts:222, an exhaustive-union arm whose branch body is unreachable).The first draft claimed
survivors: []onui-udf-parameters-sync.service.tsat "100.00% Codecov". The percentage was metric-true — independently reproduced at 54/54 — but the file carried two real holes behind it. That is the pattern worth naming: a file can be fully executed and still barely constrained.Two further corrections: the bundle presented all +11 lines as equal in quality (split above), and one uniqueness claim was accurate as far as it went but incomplete about which sibling tests also failed.
Deliberately not included
Three arms in the dropped renderer are unreachable, and any mutation confined to them is equivalent by construction — so none was attempted rather than being reported as a survivor.
Two constraints shaped what was possible here, both worth recording.
@angular/build's unit-test runner hard-codesisolate: false, so every spec shares one module registry: that rules out mutating an exported const at test time (it would leak into every other importer), and it is why novi.mockfor Plotly was added to the runtime-statistics spec — per #6580 that pattern is green solo and red on CI. The existing mock-free real-Plotly pattern is used instead.No production file is touched.
Any related issues, documentation, discussions?
Closes #7991
How was this PR tested?
yarn format:cipasses.frontend/junit.xmlandfrontend/coverage/are regenerated by every run and are not committed; the jsdomgetContext not implementednoise from Monaco is pre-existing.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 5)