Problem Description
The Libraries PR Bot fails the 🧪 Unit Test policy check on PRs that modify existing test suites if those test files use a capitalized naming convention (e.g., Test*.cpp).
Currently, the bot strictly expects test files to match test_* or *_test.*. Because the repository contains legacy or standard test files named with an uppercase T (such as TestBatchnormAttributes.cpp), any modifications to these files are ignored by the bot's scanner. This forces developers to introduce dummy files or rename valid files just to pass the gate.
Expected Behavior
The bot should recognize common variations of test file naming conventions present in the repository, specifically supporting case-insensitive matching or explicitly adding the Test*.cpp / Test*.hpp patterns.
How to Reproduce
- Modify a source file (e.g.,
Attributes.hpp).
- Modify or expand an existing test file named with a capital T (e.g.,
TestBatchnormAttributes.cpp).
- Push the branch and observe the bot output:
Error: Source/code files changed without an accompanying unit test.
Expected: add at least one test file named like test_.py / test_.cpp (or _test.*).
Suggested Fix
Update the regular expression or wildcard matching pattern in the bot's configuration (e.g., policy.yml or the underlying python script) to include case-insensitive matching or add the uppercase pattern:
# Conceptual fix for the policy pattern
test_file_patterns:
- "test_*"
- "*_test.*"
- "Test_*"
- "Test*" # To catch TestBatchnormAttributes.cpp
Problem Description
The
Libraries PR Botfails the 🧪 Unit Test policy check on PRs that modify existing test suites if those test files use a capitalized naming convention (e.g.,Test*.cpp).Currently, the bot strictly expects test files to match
test_*or*_test.*. Because the repository contains legacy or standard test files named with an uppercaseT(such asTestBatchnormAttributes.cpp), any modifications to these files are ignored by the bot's scanner. This forces developers to introduce dummy files or rename valid files just to pass the gate.Expected Behavior
The bot should recognize common variations of test file naming conventions present in the repository, specifically supporting case-insensitive matching or explicitly adding the
Test*.cpp/Test*.hpppatterns.How to Reproduce
Attributes.hpp).TestBatchnormAttributes.cpp).Suggested Fix
Update the regular expression or wildcard matching pattern in the bot's configuration (e.g.,
policy.ymlor the underlying python script) to include case-insensitive matching or add the uppercase pattern: