Repository navigation
fix(OMN-16917): count every configured test filename pattern when sizing selector splits - #1616
Conversation
…ing splits CodeRabbit review finding on #1614, valid and in-seam. `_contains_collectable_test` admits a directory on EITHER pattern in TEST_FILE_PATTERNS ("test_*.py", "*_test.py" -- mirroring pytest's python_files), and `ci_contract_test_paths` selects tests/ci/ on exactly that predicate. But `_count_test_files` globbed only `test_*.py`, so a directory could be SELECTED on the strength of files the volume counter then did not count: undercounted volume, too few matrix splits, a selection whose own proof was invisible to its sizing. `_count_test_files` now counts every name `is_test_file_name` accepts, so the selection predicate and the sizing predicate are the same predicate. No behavior change on the current tree (0 `*_test.py` files today, 1,586 `test_*.py`) -- this closes the latent divergence rather than reacting to a live miscount. The new test asserts the counter directly against a synthetic tree holding both patterns plus a non-test helper, so the invariant holds regardless of which patterns are populated in the live tree. Readback on the OMN-16625 diff is unchanged: split_count 5, is_full_suite=false, tests/unit/ absent. OMN-16917
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour. 📝 WalkthroughWalkthrough
ChangesTest path counting
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized change makes test-volume sizing count all configured test filename patterns and includes direct coverage for the previously missed pattern. No actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
…#7544) * evidence: OCC companion pass 1 for OmniNode-ai/omnibase_core#1616 * evidence: OCC companion self-bind for #7544 --------- Co-authored-by: node-occ-companion-effect <occ-companion-effect@omninode.ai>
OMN-16917 follow-up — the selection predicate and the sizing predicate are now the same predicate
Follow-up to omnibase_core#1614 (merged to
devas22adaa83), landing a valid CodeRabbit review finding on that PR that was orphaned: the repo's auto-squash bot merged #1614 on its first commit while the second commit's governed full-suite pre-push was still running, so the fix never reacheddev. This PR is that commit, cherry-picked onto post-mergedev.The defect
TEST_FILE_PATTERNSmirrors pytest'spython_filesand holds two patterns:is_test_file_namehonours both._contains_collectable_testtherefore admits a directory on either pattern — andci_contract_test_paths(added in #1614) selectstests/ci/on exactly that predicate.But
_count_test_filesglobbed only one half:So a directory could be selected on the strength of files the volume counter then did not count. The consequence runs through
_split_count_for→VOLUME_THRESHOLD_FILES/VOLUME_TARGET_FILES_PER_SPLIT: undercounted volume, too few matrix splits, each split carrying more than the sizing intended. A selection whose own justification was invisible to its sizing.The change
_count_test_filesnow counts every nameis_test_file_nameaccepts, so the predicate that decides whether a directory is selected and the predicate that decides how big that selection is are the same predicate. One function, one source of truth, no second copy of the pattern list to drift.Behavior on the current tree
Unchanged. The live tree holds 0
*_test.pyfiles against 1,586test_*.py, so no selection is sized differently today. This closes a latent divergence rather than reacting to a live miscount — which is precisely why it needed a test that does not depend on the live tree's population.test_split_count_counts_every_configured_test_filename_patternasserts the counter directly, against a synthetic tree holding one file of each pattern plus a non-test helper:so the invariant holds regardless of which patterns happen to be populated in the repo later.
Readback unchanged
Same real OMN-16625 5-file diff that #1614 was measured on:
Identical to the post-merge readback on
22adaa83. This PR narrows nothing and widens nothing on today's tree.No bypass
No
[skip-*token, noENABLE_SMART_TESTS=off, noPREPUSH_FULL_SUITE, no new environment variable. The pre-existing knobs are untouched.dod_evidence
uv run pytest tests/unit/scripts/ci/test_detect_test_paths_ci_contract_omn16917.py→ 16 passed (15 from fix(OMN-16917): apply the OMN-16745 CI-contract ruling to core's own import-graph selector #1614 plus the new counter test).split_count: 5,is_full_suite=false,tests/unit/absent — byte-identical to the merged22adaa83readback.is_full_suite=true, full_suite_reason=test_infrastructure(this PR changesscripts/ci/detect_test_paths.py, atest_infrastructure_pathsentry) → the hook ran the full suite and allowed the push. No knob set, no override grant, no--no-verify.uv run ruff format --check/uv run ruff checkon both changed files → clean. Full pre-commit ran as part of the push.Ticket: OMN-16917
Evidence-Ticket: OMN-16917
Evidence-Source: OCC#7544
Summary by CodeRabbit
Bug Fixes
Tests