Skip to content

[py] Extract actions subpackage into //py:common_actions#17605

Merged
AutomatedTester merged 1 commit into
trunkfrom
worktree-fix-py-coarse-libs
Jun 1, 2026
Merged

[py] Extract actions subpackage into //py:common_actions#17605
AutomatedTester merged 1 commit into
trunkfrom
worktree-fix-py-coarse-libs

Conversation

@AutomatedTester
Copy link
Copy Markdown
Member

Summary

  • The actions/ subpackage and action_chains.py were part of the monolithic //py:common library, which every browser test depends on. Changing any file in actions/ triggered a full rebuild of all ~700 test targets across every browser × OS combination.
  • Only 4 test files actually import from actions/: interactions_tests.py, interactions_with_device_tests.py, w3c_interaction_tests.py, and event_firing_webdriver_tests.py.
  • This PR creates a separate //py:common_actions library 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; removes actions/** and action_chains.py from //py:common's glob; adds //py:common_actions to //py:selenium; splits each browser suite into -common and -actions variants; restores original suite names (test-chrome, test-chrome-bidi, etc.) as test_suite aggregates so CI targets are unchanged.
  • py/private/suite.bzl: adds optional test_suffix parameter to py_test_suite so the -common sub-suites can emit the original test IDs (e.g. alerts_tests-chrome, not alerts_tests-chrome-common).

Impact on test names

Target Before After
Non-actions tests alerts_tests-chrome alerts_tests-chrome (unchanged)
Actions tests interactions_tests-chrome interactions_tests-chrome-actions

CI aggregate targets (//py:test-chrome, etc.) are unchanged.

Test plan

  • bazel query 'rdeps(//py:*, //py:common_actions)' | grep py_test | grep -v actions returns empty — non-actions tests have no dep on :common_actions
  • bazel query 'kind(py_test, //py:*)' | grep interactions shows -chrome-actions, -firefox-actions etc. targets
  • Existing unit and browser tests pass

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.
@selenium-ci selenium-ci added C-py Python Bindings B-build Includes scripting, bazel and CI integrations labels Jun 1, 2026
@AutomatedTester AutomatedTester merged commit fac1942 into trunk Jun 1, 2026
44 checks passed
@AutomatedTester AutomatedTester deleted the worktree-fix-py-coarse-libs branch June 1, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-build Includes scripting, bazel and CI integrations C-py Python Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants