Repository navigation
Try to filter go compiler test files before reading them and building compiler tests - #64675
Merged
Wesley Wigham (weswigham) merged 1 commit intoOct 7, 2026
Conversation
Wesley Wigham (weswigham)
requested review from
Gabriela Araujo Britto (gabritto) and
Jake Bailey (jakebailey)
and
a balanced review from Copilot
October 7, 2026 18:18
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The filtering is conservative, integrated before file reads, and adequately tested.
0 open findings
What changed in this PR
Adds a conservative pre-read filter to speed targeted compiler test runs.
Changes:
- Parses
-test.runpatterns to identify candidate files. - Skips unrelated files before loading test contents.
- Adds coverage for regex, configuration, and fallback cases.
| File | Description |
|---|---|
compiler_test_filter.go |
Implements conservative filename filtering. |
compiler_test_filter_test.go |
Tests matching and fallback behavior. |
compiler_runner.go |
Applies filtering before loading tests. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Jake Bailey (jakebailey)
approved these changes
Oct 7, 2026
Jake Bailey (jakebailey)
left a comment
Member
There was a problem hiding this comment.
If it works it's good
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.
At least if the pattern/string passed as a filter is simple enough. This works because compiler test names are derived from the file names - so we can use the targeted test names filter to filter the files we load, reducing IO and setup work we're just going to discard anyway. On windows (where file IO can be... elongated), this improves the performance of starting a limited subset of tests from ~14s to ~1s on my lower performance machine.
...there is some regex pattern reparsing going on to achieve that, though, so you can still get that benefit when you filter for, eg,
TestLocal/declarationEmit(With|Empty)StatementNoCrash, rather than just a single test.