test: Collect test files as plain paths - #1701
Merged
Merged
Conversation
chfast
force-pushed
the
test/collector-relative-path
branch
from
September 7, 2026 10:17
05f7fca to
46b448d
Compare
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The refactor is consistent across the implementation, callers, and existing unit tests.
Pull request overview
Simplifies test collection by representing collected files directly as filesystem paths and deriving ignored paths lexically.
Changes:
- Removes the redundant
TestFilewrapper. - Passes the collection root explicitly when filtering ignored paths.
- Updates callers and unit tests for the path-based API.
File summaries
| File | Description |
|---|---|
test/utils/test_collector.hpp |
Updates the collector API. |
test/utils/test_collector.cpp |
Collects plain paths and uses lexical relative paths. |
test/unittests/test_collector_test.cpp |
Adapts ignore-filter tests. |
test/statetest/statetest.cpp |
Uses collected paths directly. |
test/blockchaintest/blockchaintest.cpp |
Uses collected paths directly. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
chfast
commented
Sep 7, 2026
chfast
force-pushed
the
test/collector-relative-path
branch
2 times, most recently
from
September 7, 2026 10:55
d398555 to
029b414
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The updated unit test uses standard-library facilities without directly including their required headers.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Balanced
A collected file carried its directory relative to the search root as a suite_name, left over from when that named the gtest suite. Nothing has displayed it since; its one reader glued the filename back on to recover the path relative to the root, which is what the ignored paths are matched against. Keep the path alone and give ignore_test_files() the root, so the relative path is derived where it is used. TestFile then holds one field, so it goes too. The derivation is textual now rather than fs::relative, so collecting a tree no longer stats every file, and a symlinked fixture is matched where it sits instead of under its target's directory.
chfast
force-pushed
the
test/collector-relative-path
branch
from
September 7, 2026 11:06
029b414 to
4840b3d
Compare
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.
A collected test file carried the name of its suite (its directory relative to the search root) from the days when that was the gtest suite it got registered under. Nothing has displayed it since gtest went away, and its only remaining reader had to glue the filename back on to recover the path it actually wanted.
So the file is now just its path, and the root goes to the one function that needs a path relative to it. That derivation is textual rather than
fs::relative, so collecting a tree no longer stats every file.