[py] Extract actions subpackage into //py:common_actions#17605
Merged
Conversation
The actions subpackage (action_chains.py + actions/**) was part of the monolithic //py:common library. Every browser test depended on //py:common, so changing any file in actions/ triggered a full rebuild of all ~700 test targets across all browser/OS combinations. Only 4 test files actually import from actions: - interactions_tests.py - interactions_with_device_tests.py - w3c_interaction_tests.py - event_firing_webdriver_tests.py This change: - Adds //py:common_actions containing action_chains.py and actions/** - Removes those files from //py:common so the dep graph is precise - Splits each browser test suite into a -common variant (no actions dep) and an -actions variant (deps on :common_actions only) - Restores the original suite names (test-chrome, test-chrome-bidi, etc.) as test_suite aggregates so CI targets are unchanged - Preserves existing individual test names (alerts_tests-chrome unchanged; actions tests now carry -actions suffix e.g. interactions_tests-chrome-actions) - Adds test_suffix param to py_test_suite to allow explicit override of the auto-computed suffix when a suite is renamed without changing test IDs Result: changing action_chains.py or any file in actions/ now only rebuilds the ~4 test files × browser variants (~44 targets) instead of all ~700.
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.
Summary
actions/subpackage andaction_chains.pywere part of the monolithic//py:commonlibrary, which every browser test depends on. Changing any file inactions/triggered a full rebuild of all ~700 test targets across every browser × OS combination.actions/:interactions_tests.py,interactions_with_device_tests.py,w3c_interaction_tests.py, andevent_firing_webdriver_tests.py.//py:common_actionslibrary for those 12 source files and wires the dep graph so non-actions tests have zero transitive dependency on it.What changed
py/BUILD.bazel: adds//py:common_actions; removesactions/**andaction_chains.pyfrom//py:common's glob; adds//py:common_actionsto//py:selenium; splits each browser suite into-commonand-actionsvariants; restores original suite names (test-chrome,test-chrome-bidi, etc.) astest_suiteaggregates so CI targets are unchanged.py/private/suite.bzl: adds optionaltest_suffixparameter topy_test_suiteso the-commonsub-suites can emit the original test IDs (e.g.alerts_tests-chrome, notalerts_tests-chrome-common).Impact on test names
alerts_tests-chromealerts_tests-chrome(unchanged)interactions_tests-chromeinteractions_tests-chrome-actionsCI aggregate targets (
//py:test-chrome, etc.) are unchanged.Test plan
bazel query 'rdeps(//py:*, //py:common_actions)' | grep py_test | grep -v actionsreturns empty — non-actions tests have no dep on:common_actionsbazel query 'kind(py_test, //py:*)' | grep interactionsshows-chrome-actions,-firefox-actionsetc. targets