Skip to content

merge: reconcile upstream through 1d3619d6 with native unittests directory rule - #435

Merged
bompus merged 2 commits into
fork/consolidatedfrom
reconcile/upstream-1d3619d6
Oct 10, 2026
Merged

bompus merged 2 commits into
fork/consolidatedfrom
reconcile/upstream-1d3619d6

Conversation

@bompus

@bompus bompus commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Merges upstream main through 1d3619d6 (upstream colbymchenry#2484) into fork/consolidated.

colbymchenry#2484 (C/C++): a file in a unittests/ folder (llvm, breakpad) or in a folder named like a unittest (dcheck_unittest/ in glog) is a test. Upstream changes isTestPath in src/search/query-utils.ts, which merged as is, and isTestSuitePath in src/resolution/name-matcher.ts, which the fork deleted. The merge keeps that deletion and ports the second rule to the native resolver:

  • codegraph-kernel/src/resolve/resolver_upstream.rs test_suite_path: the directory rule gains unittests and <name>[-_]unittest(s).
  • codegraph-kernel/src/resolve/tables.rs is_test_path: the same rule as upstream's new isTestPath clause (a bare unittest/ stays a non-test: CPython's Lib/unittest/ is the framework). New unit test unittest_directories_are_test_paths covers both functions.

CHANGELOG: this range's entry; the merge had re-inserted 4 entries the fork already carries, dropped. README merge point moved to 1d3619d6.

Checks: full suite 684 files / 8740 passed, 39 skipped, no worker crashes; golden dumps unchanged; upstream's three new/changed test files pass (18); Rust unit tests pass; kernel builds clean under clippy -D warnings; eval:precision gin 3/3 held.

README rows checked: merge point (2 places) updated; no fork-vs-upstream row changes.

Lands as a merge commit (not squash) to keep upstream ancestry.

Summary by CodeRabbit

  • Bug Fixes

    • Unit-test files in unittests/ and directories ending in -unittest, _unittest, -unittests, or _unittests are now recognized even when filenames don’t follow test naming conventions.
    • These files are excluded from production-code search, exploration, affected-file analysis, and symbol resolution. Files under a bare unittest/ directory remain treated as production code.
  • Documentation

    • Updated the README’s upstream comparison baseline.

colbymchenry and others added 2 commits October 10, 2026 18:09
…olbymchenry#2484)

isTestPath knew `tests/`, `test/`, `__tests__/`, CamelCase source sets and
`foo-test/` modules, but not the folders LLVM, Clang, clangd, lldb, offload
and Breakpad keep their unit tests in (`unittests/`), nor glog's
`dcheck_unittest/`-style test programs: `/unittests/` holds `tests/` only
after a `t`, and the `foo_test/` form wants a separator right before `test`.
So a helper there with no test-like name (LLVM's CountCopyAndMove.h,
SelectionDAGTestBase.h, Breakpad's dump_analysis.cc) read as production code.

isTestPath now also counts a `unittests/` folder and a `foo_unittest/` or
`foo-unittests/` one. A bare `unittest/` stays production: CPython's
`Lib/unittest/` is the framework, and LLVM vendors googletest under
`third-party/unittest/`.

isTestSuitePath counts the same folders as suites, as it counts `tests/`:
their files build into test binaries and never link into the program, and
glog builds each `foo_unittest/` folder as a test program of its own (a
`foo-test/` module stays out, as shipped test support). That matters for
C/C++ because the suite rule's CamelCase file names skip `.cpp`, so on main
none of LLVM's `*Test.cpp` files were suites and production locals named
`Ctx`, `KV`, `V` or `OpInfo` linked to what a unit test declares.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository YAML (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2a02fca2-d4e3-4ce1-8706-f93a60183649

📥 Commits

Reviewing files that changed from the base of the PR and between 8a2ae97 and d60d812.


📒 Files selected for processing (8)
  • CHANGELOG.md
  • README.md
  • __tests__/cli-affected-test-conventions.test.ts
  • __tests__/is-test-file.test.ts
  • __tests__/unittests-directories.test.ts
  • codegraph-kernel/src/resolve/resolver_upstream.rs
  • codegraph-kernel/src/resolve/tables.rs
  • src/search/query-utils.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.



📝 Walkthrough

Walkthrough

The change adds unittests and suffixed unittest directory names to test-path detection in TypeScript and Rust. Tests cover path classification, affected-file reporting, and symbol resolution. The README updates its upstream comparison baseline.

Changes

Test-directory recognition

Layer / File(s) Summary
Recognize unit-test directory patterns
src/search/query-utils.ts, codegraph-kernel/src/resolve/tables.rs, codegraph-kernel/src/resolve/resolver_upstream.rs, __tests__/is-test-file.test.ts
The TypeScript and Rust path checks recognize unittests and directory names ending in -unittest, _unittest, -unittests, or _unittests. Tests also verify that bare unittest and unittest2 directories are not classified as test paths.
Validate resolution and affected-file behavior
__tests__/unittests-directories.test.ts, __tests__/cli-affected-test-conventions.test.ts, CHANGELOG.md
Integration tests check that production references do not resolve to declarations in unit-test directories, and that changes to LLVM files report an arbitrarily named file under unittests/. The changelog describes the convention.

Upstream comparison baseline

Layer / File(s) Summary
Update the README baseline
README.md
The fork description and feature-comparison introduction update the upstream commit reference to 1d3619d6.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to d60d8

The directory-recognition change is mergeable after normal checks.

Pre-merge checks | Passed 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the upstream merge point and the main functional change: recognizing native unittests directories as test paths.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Suppressions Explained Passed The pull request adds no lint, type-check, compiler-suppression directive, or new lint/type-check ignore entry. The changed Rust, TypeScript, and test lines add matching logic, comments, and tests onl…
User-Visible Changes Documented Passed PASS. The reviewed diff changes test-path detection, resolver behavior, tests, the changelog, and README upstream-reference text. It does not add, remove, or rename a CLI command or flag, MCP tool or …

✨ Finishing Touches 💡 1
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR


🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@bompus
bompus merged commit 2bf24ef into fork/consolidated Oct 10, 2026
6 of 7 checks passed
@bompus
bompus deleted the reconcile/upstream-1d3619d6 branch October 10, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants