Skip to content

[sandbox]: Use token-based test path filtering - #144

Merged
ShadowBearVR merged 1 commit into
chipsalliance:mainfrom
ShadowBearVR:test-path-filtering
Sep 26, 2026
Merged

ShadowBearVR merged 1 commit into
chipsalliance:mainfrom
ShadowBearVR:test-path-filtering

Conversation

@ShadowBearVR

@ShadowBearVR ShadowBearVR commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

This PR closes #136 and replaces hardcoded language-extension suffixes (TEST_FILE_SUFFIXES) and directory lists (TEST_DIRECTORY_NAMES) with unified word-boundary token matching (TEST_PATH_TOKENS) across directory segments and file stems.

This accurately identifies test and harness files across any language (such as Rust src/tests.rs, _tests., test_, .spec., and CamelCase FooTest. files) without false-matching substrings like 'attest.rs'.

Replaces hardcoded language-extension suffixes (TEST_FILE_SUFFIXES) and
directory lists (TEST_DIRECTORY_NAMES) with unified word-boundary token
matching (TEST_PATH_TOKENS) across directory segments and file stems.

This accurately identifies test and harness files across any language
(such as Rust src/tests.rs, *_tests.*, test_*, *.spec.*, and CamelCase
FooTest.* files) without false-matching substrings like 'attest.rs'.

@siemen11 siemen11 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks Collin!

# "foo_test.spec" -> ["foo", "test", "spec"]
# "HTTPTest" -> ["HTTP", "Test"]
# "dpe_attest" -> ["dpe", "attest"]
PATH_WORD_TOKEN_RE = re.compile(r"[A-Z]?[a-z]+|[A-Z]+(?=[A-Z]|$)|[0-9]+")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Regex the curse of coding: I have less experience here, but maybe double check this one whether we do not miss certain cases

@ShadowBearVR
ShadowBearVR merged commit 282ce70 into chipsalliance:main Sep 26, 2026
3 checks passed
@ShadowBearVR
ShadowBearVR deleted the test-path-filtering branch September 26, 2026 14:06
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.

Evaluate Test Filtering

2 participants