Skip to content

test: Collect test files as plain paths - #1701

Merged
chfast merged 1 commit into
masterfrom
test/collector-relative-path
Sep 7, 2026
Merged

test: Collect test files as plain paths#1701
chfast merged 1 commit into
masterfrom
test/collector-relative-path

Conversation

@chfast

@chfast chfast commented Sep 7, 2026

Copy link
Copy Markdown
Member

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.

@chfast
chfast force-pushed the test/collector-relative-path branch from 05f7fca to 46b448d Compare September 7, 2026 10:17
@codspeed-hq

codspeed-hq Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 129 untouched benchmarks


Comparing test/collector-relative-path (4840b3d) with master (13ec12d)

Open in CodSpeed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 TestFile wrapper.
  • 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.

Comment thread test/blockchaintest/blockchaintest.cpp Outdated
@chfast
chfast force-pushed the test/collector-relative-path branch 2 times, most recently from d398555 to 029b414 Compare September 7, 2026 10:55
@chfast
chfast requested a balanced review from Copilot September 7, 2026 10:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread test/unittests/test_collector_test.cpp
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
chfast force-pushed the test/collector-relative-path branch from 029b414 to 4840b3d Compare September 7, 2026 11:06
@chfast
chfast merged commit ab3d68e into master Sep 7, 2026
23 checks passed
@chfast
chfast deleted the test/collector-relative-path branch September 7, 2026 11:23
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