Repository navigation
merge: reconcile upstream through 1d3619d6 with native unittests directory rule - #435
Merged
Merged
Conversation
…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>
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.
Merges upstream
mainthrough1d3619d6(upstream colbymchenry#2484) intofork/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 changesisTestPathinsrc/search/query-utils.ts, which merged as is, andisTestSuitePathinsrc/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.rstest_suite_path: the directory rule gainsunittestsand<name>[-_]unittest(s).codegraph-kernel/src/resolve/tables.rsis_test_path: the same rule as upstream's newisTestPathclause (a bareunittest/stays a non-test: CPython'sLib/unittest/is the framework). New unit testunittest_directories_are_test_pathscovers 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 gin3/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
unittests/and directories ending in-unittest,_unittest,-unittests, or_unittestsare now recognized even when filenames don’t follow test naming conventions.unittest/directory remain treated as production code.Documentation