Repository navigation
test: enumerate tests/tools/ in --require-source-files - #1154
Merged
Merged
Conversation
The file-set floor walked scripts/ and src/ only, so a harness module that nothing imports was recorded nowhere and no gate moved -- exactly the blind spot --require-source-files exists to close, applied to the measuring apparatus itself. tests/tools/e2e-data-fixture-loader.cjs reached main that way and was found by eye. tests/tools/ meets the same bar scripts/ and src/ do: it is a tree, not a scattering of root-level configuration, and every module in it is part of the harness the suite runs on. isSourceFile() is unchanged, so a harness module counts toward the file-set floor without entering the src files ratios. Closes #1131 Signed-off-by: quality <quality@hive.kubestellar.io>
Contributor
Author
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will keep the |
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.
Test Improvement
--require-source-filesis the file-set floor: a ratio gate cannot see a module nobody imports, because its lines are absent from the numerator and denominator alike. The guard walkedSOURCE_ROOTS = ['scripts', 'src']only — andtests/tools/is the harness the whole suite runs on (the overlay engine, the loaders, both coverage reporters, the fake DOM, the Playwright fixtures). A module there that nothing imports was exactly as invisible, with the failure landing on the measuring apparatus itself.tests/tools/e2e-data-fixture-loader.cjsreachedmainthat way (#1129) and was found by eye, not by a check.tests/tools/coverage-report.mjsSOURCE_ROOTSnow enumeratesjoin('tests', 'tools'), with a comment stating why this tree qualifies where root-level configuration does not: it is a tree, and every module in it is expected to be exercised.isSourceFile()is deliberately unchanged — everything undertests/is still non-source, so a harness module counts toward the file-set floor without entering thesrc filesratios.--require-source-filesmessages name the third root (they interpolateSOURCE_ROOTS, so the "Never measured" notice and the failure line follow automatically).tests/coverage-report-source-files.test.mjsenumerateSourceFilesfixture now pinstests/tools/five.mjsandtests/tools/nested/six.cjsas enumerated whiletests/five.test.mjsstays out.--require-source-files names an unimported module under tests/tools/: a narrow run overtests/validate-utils.test.mjsexits 1, namestests/tools/e2e-data-fixture-loader.cjs, and still omits the one measured module and every test file outside the harness.namedInNoticehelper used by both CLI cases.Verification
npm run test:unit:coverage:check— exit 0 on this branch atbcfca86(node v26.10.0, TZ=UTC): no "Never measured" block,src files | 100.00 | 99.92 | 8849/8849 lines | 2506/2508 regions,all files | 99.44 | 95.20. The new root is green onmainbecause test: cover the e2e data-fixture webpack loader #1130 landed the first test importing the loader.node --test tests/coverage-report-source-files.test.mjs— 5 passed.prettier --checkandeslintclean on both files.No workflow file is touched:
.github/workflows/ci.ymlalready invokestest:unit:coverage:checkwith--require-source-files, so the gate picks the third root up with no workflow edit.Related Issue
Closes #1131
Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88