test(frontend): cover the build-version script, user config and agent registration - #8066
Merged
aglinxinyuan merged 1 commit intoAug 29, 2026
Conversation
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 #8066 +/- ##
============================================
+ Coverage 93.51% 93.54% +0.03%
Complexity 4709 4709
============================================
Files 1181 1181
Lines 47809 47809
Branches 5327 5327
============================================
+ Hits 44708 44723 +15
+ Misses 1663 1653 -10
+ Partials 1438 1433 -5
*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:
|
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?
Five existing frontend specs extended. +16 fully-covered lines and +8 branch arms.
build-version.jsuser-config.service.tsagent-registration.component.htmlcode-editor.service.tsnotebook-migration.service.tsbuild-version.jscarries most of it: lines 42–46 and 53 were never executed and 52 was partial. Its arm total rises from 3 to 4 rather than staying fixed, because loading the script as raw CJS also records thebuildNumber = generate(version)default-parameter branch that the transformed import never emitted — worth stating, since a reader comparing arm totals would otherwise think the denominator moved for no reason.agent-registration.component.htmlgains zero on plain line-hit (48/48 both before and after) and moves only on Codecov's metric, by completing three branch arms. The two numbers are not interchangeable and both are given.Deliberately excluded: every
stub-*.service.ts. Those six files hold 29 further missed lines — more than this whole PR — but they are test doubles, not production code, so covering them would be padding. One of them (stub-user-project.service.ts, 18 missed lines) is being deleted outright by the open project-removal work.Verification
21 mutations, no survivors. Every one was re-derived from scratch on the shipping tree: snapshot first, anchor asserted to occur exactly once, one mutant at a time, hash-equality plus an empty non-spec diff verified immediately before each run, reverted from the snapshot rather than from git.
19 of the 21 die to exactly one test with the rest of the file green. The other two are named rather than rounded up: the
writeFileSyncpayload exchange also kills "announces the build number it produced" (the manifest stops being parseable JSON), and the error-ternary exchange atagent-registration.component.ts:104also kills a sibling.The baseline was re-measured rather than inherited: specs backed up to a scratch dir, each restored by exact single file path (never a directory),
git status --porcelain --untracked-files=allconfirmed empty, then the literal CI command body run —nx test --watch=false --progress=false --coverage --coverage-reporters=lcovonlyfromfrontend/, which is whatyarn --cwd frontend run test:ciexecutes and whose lcov is uploaded under thefrontendflag. Specs were then restored and the restored diff byte-verified against the saved patch before the second run. Both lcovs were parsed with a script implementing Codecov's rule directly: a line counts only if itsDAhit is non-zero and everyBRDAarm on it is taken.Whole suite: 5208 passed + 1 skipped → 5220 passed + 1 skipped, 204/204 files both times. The single skip is pre-existing and untouched.
One correction to an earlier draft of this bundle: it implied the agent-registration spec started from a different test count than it did. The real per-spec counts are 7→10, 20→22, 4→5, 37→39, 15→19.
yarn format:cipasses.frontend/junit.xmlandfrontend/coverage/are regenerated by every run and are not committed. No production file is touched.Any related issues, documentation, discussions?
Closes #8064
How was this PR tested?
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 5)