Skip to content

test(frontend): cover the admin-execution and user-dataset templates - #7893

Open
aglinxinyuan wants to merge 1 commit into
apache:mainfrom
aglinxinyuan:cov/dashboard-templates
Open

test(frontend): cover the admin-execution and user-dataset templates#7893
aglinxinyuan wants to merge 1 commit into
apache:mainfrom
aglinxinyuan:cov/dashboard-templates

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Two dashboard templates. 77 tests → 94.

Measured from frontend/ with ng test --coverage --coverage-reporters=lcovonly, the same spec-file filter on both sides, rm -rf coverage between runs, and the "before" run taken from HEAD's specs rather than inherited from a report.

Template Before After
admin-execution.component.html 77/82 = 93.9% (5 missed) 81/82 = 98.8% (1 missed)
user-dataset.component.html 32/37 = 86.5% (5 missed) 37/37 = 100%, branches 6/6

+9 fully-covered lines, +2 branch arms. Both "before" figures reproduce Codecov's published numbers exactly.

New tests cover the duration and end-time fallbacks, the filter and pagination wiring, and the dataset list's empty and populated states.

Verification

29 mutations, 28 killed, 1 equivalent mutant. Every mutant was run twice — once against the pre-review tree and once against the repaired tree — so the "now dies" claims are differences I observed rather than inferred.

The first draft reported "survivors": []. That was false: 17 distinct mutants survived at 87/87 on its own tree. Its numbers were right — I reproduced 93.90%/5-missed, 86.49%/5-missed, +9 lines and +2 arms — but its closing claim that "the assessment was accurate on every number I checked" papered over the fact that the assertions behind those numbers did not constrain much.

Three of its test comments described separations the tests did not achieve:

  • "The duration and end-time cells have independent fallbacks, so assert them separately" — each ngIf guard was in fact pinned in only one direction.
  • An EXCHANGE of the pause and resume [disabled] predicates was framed as pinning the pair; it pins only pause-on-RUNNING and resume-on-PAUSED, not the converse.
  • A comment claimed a template statement's assign-then-search ordering was observable; the test could not see it.

This repair pass added zero coverage

The 7 new tests and 7 strengthenings buy mutation strength, not lines — the Codecov delta is identical before and after this pass. Said plainly so the diff size is not read as coverage.

Deliberately not included, and honestly bounded

This is not a claim that these templates are mutation-complete. It is a claim about 29 specific mutants. Five wirings remain unpinned and are listed rather than hidden:

  • (nzQueryParams) on line 43 and (nzFilterChange) on line 83 of admin-execution.component.html are both still FNDA:0. Deleting either would silently break every page click or filter change and nothing in the 53 tests would notice, because the pagination and filter suites call the handlers directly. Worth 0 Codecov lines either way.
  • (click)="setViewType('card')" on user-dataset.component.html:53 is still FNDA:0 — the page starts in card view, so the existing toggle test only ever clicks the list button.
  • (refresh)="ngAfterViewInit()" on line 100 is left unpinned deliberately: pinning it would cement a duplicate-subscription defect.
  • Line 90's (refresh) has no DA record in the lcov at all, so it can never count toward the Codecov metric in either direction.

admin-execution.component.html:128 is the one remaining miss and it is dead markup: #endTimeNotAvailable is declared twice, at lines 118 and 127, so lines 127-129 are unreachable. Re-verified from my own after-run lcov rather than inherited.

No production file is touched.

Any related issues, documentation, discussions?

Closes #7892

How was this PR tested?

npx ng test --watch=false --include="**/admin-execution.component.spec.ts" --include="**/user-dataset.component.spec.ts"
 Test Files  2 passed (2)
      Tests  94 passed (94)

frontend/junit.xml and frontend/coverage/ are regenerated by every run and are not committed. yarn format:ci passes.

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

Generated-by: Claude Code (Opus 5)

77 tests to 94. admin-execution.component.html goes 93.9% to 98.8% and
user-dataset.component.html reaches 100% lines and branches: +9 fully
covered lines, +2 arms. Both baselines reproduce Codecov exactly.

29 mutations, 28 killed. The first pass reported no survivors while 17
distinct mutants survived on its own tree -- its numbers were right and its
assertions were not, and three of its test comments described separations
the tests did not achieve.

Stated in the PR rather than implied: this is not a claim that the templates
are mutation-complete, only about 29 specific mutants. Five wirings remain
unpinned and are listed, including two whose handlers the existing suites
call directly so the bindings themselves never fire, and one left unpinned
deliberately because pinning it would cement a duplicate-subscription
defect. The last remaining Codecov miss is dead markup -- a template ref
declared twice.
Copilot AI lite review requested due to automatic review settings August 23, 2026 09:35

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 the frontend Changes related to the frontend GUI label Aug 23, 2026
@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: @mengw15
    You can notify them by mentioning @mengw15 in a comment.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.21%. Comparing base (65f1f66) to head (76d371b).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7893      +/-   ##
============================================
+ Coverage     92.09%   92.21%   +0.12%     
  Complexity     4533     4533              
============================================
  Files          1173     1173              
  Lines         47347    47347              
  Branches       5306     5306              
============================================
+ Hits          43604    43661      +57     
+ Misses         2105     2069      -36     
+ Partials       1638     1617      -21     
Flag Coverage Δ *Carryforward flag
access-control-service 81.00% <ø> (ø) Carriedforward from 65f1f66
agent-service 98.62% <ø> (ø) Carriedforward from 65f1f66
amber 88.76% <ø> (ø) Carriedforward from 65f1f66
computing-unit-managing-service 73.67% <ø> (ø) Carriedforward from 65f1f66
config-service 86.73% <ø> (ø) Carriedforward from 65f1f66
file-service 75.74% <ø> (ø) Carriedforward from 65f1f66
frontend 94.26% <ø> (+0.27%) ⬆️
notebook-migration-service 79.13% <ø> (ø) Carriedforward from 65f1f66
pyamber 97.52% <ø> (ø) Carriedforward from 65f1f66
workflow-compiling-service 77.19% <ø> (ø) Carriedforward from 65f1f66

*This pull request uses carry forward flags. Click here to find out more.

☔ 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.

@aglinxinyuan
aglinxinyuan requested a review from mengw15 August 23, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cover the admin-execution and user-dataset templates

3 participants