-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[py] make bazel test target names consistent with other languages #16969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors Python Bazel test target naming to align with other language bindings in the Selenium monorepo. Previously, Python test targets had the configuration pieces (browser, mode) before the test name, which was inconsistent with other languages. This change reorders the naming to put the test path first, followed by the configuration suffix.
Changes:
- Added helper function
_strip_test_prefixesto normalize test file paths by removing common test-related prefixes and suffixes - Added helper function
_suite_suffixto extract the configuration suffix from suite names - Modified test name generation to use format
<test_path>-<config>instead of<config>-<test_path>
navin772
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I was accustomed to the previous naming conventions 😅
cgoldberg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems more intuitive to have the full name of the test file like it was before.
Could it be something like:
//py:test/selenium/webdriver/support/event_firing_webdriver_tests.py-firefox-remote
I don't really care too much though... it's fine to merge this if you think it's better.
We should also update #16734 with an example of how to run a single file of tests.
|
@cgoldberg yeah, I was going off ruby convention for it which removed "spec": But yeah, .NET & Java both keep "Test": How about we just remove the |
476c99f to
0ce7f1c
Compare
yea, I like that better. |
|
oops.. you just merged it... I'll change it in a new PR |
…6969) * rearrange python test target naming * [py] Keep test/ prefix to avoid module shadowing on Windows * [py] Keep _tests suffix in test target names
…6969) * rearrange python test target naming * [py] Keep test/ prefix to avoid module shadowing on Windows * [py] Keep _tests suffix in test target names
User description
Python is the only language that puts the config pieces before the test name. @cgoldberg / @navin772 any objection to just renaming them so it doesn't make my eyes twitch?
Before:
After:
Eventually we move to more granular build files (colon further to the right), but that's low priority
🔄 Types of changes
PR Type
Enhancement
Description
Reorganizes Python test target naming convention
Moves config pieces after test name for consistency
Implements helper functions to strip test prefixes
Aligns Python naming with other language patterns
Diagram Walkthrough
File Walkthrough
suite.bzl
Refactor test target naming with helper functionspy/private/suite.bzl
_suite_suffix()function to extract config suffix from testsuite name
_strip_test_prefixes()function to normalize file paths byremoving test prefixes and extensions
the order of path and config components
name-srcpattern tosrc-namepattern for consistency withother languages