Skip to content

Try to filter go compiler test files before reading them and building compiler tests - #64675

Merged
Wesley Wigham (weswigham) merged 1 commit into
microsoft:mainfrom
weswigham:faster-filtered-test-runs
Oct 7, 2026
Merged

Wesley Wigham (weswigham) merged 1 commit into
microsoft:mainfrom
weswigham:faster-filtered-test-runs

Conversation

@weswigham

Copy link
Copy Markdown
Member

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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.run patterns 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.

@jakebailey Jake Bailey (jakebailey) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If it works it's good

@weswigham
Wesley Wigham (weswigham) added this pull request to the merge queue Oct 7, 2026
Merged via the queue into microsoft:main with commit 91521cf Oct 7, 2026
29 checks passed
@weswigham
Wesley Wigham (weswigham) deleted the faster-filtered-test-runs branch October 7, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants