Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,24 +74,6 @@ jobs:
--local_test_jobs 1
--target_pattern_file=remote-targets.txt

remote-bidi-tests:
name: Remote BiDi Tests
uses: ./.github/workflows/bazel.yml
with:
name: Integration Tests Remote BiDi
needs-display: true
rerun-with-debug: true
download-artifact-name: targets
run: >
[ -s bazel-targets-py.txt ] || echo //py/... > bazel-targets-py.txt;
{ echo "tests(//py:test-remote-bidi) intersect set("; cat bazel-targets-py.txt; echo ")"; } > query.txt;
bazel query --query_file=query.txt --output=label > remote-bidi-targets.txt;
./scripts/github-actions/bazel-test-if-targets.sh
--keep_going
--flaky_test_attempts 3
--local_test_jobs 1
--target_pattern_file=remote-bidi-targets.txt

browser-tests:
name: Browser Tests
uses: ./.github/workflows/bazel.yml
Expand Down
29 changes: 11 additions & 18 deletions py/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,10 @@ BIDI_TESTS = glob([
# Tests that have bidi and classic implementations.
BIDI_IMPLEMENTATIONS = []

# BiDi test files with Grid-specific behavior, run through Grid as well. Empty
# generates no targets: an empty test_suite would mean every test in the package.
REMOTE_BIDI_TESTS = []

# Test files that only run against browsers supporting the given feature.
# Each group is split into its own sub-suite so that changing the underlying
# library only triggers that group's targets, not the full ~700-target suite.
Expand Down Expand Up @@ -1136,15 +1140,13 @@ FEATURE_SUITE_DEFS = {
if BROWSER_TESTS[browser].get("bidi", False)
]

# Generate test-<browser>-remote-bidi targets (chrome and firefox only).
# Deliberately not folded into the test-<browser>-remote aggregate: BiDi over Grid's
# websocket proxy is new coverage, so keep it out of the established remote job until
# it has proven stable.
# Generate test-<browser>-remote-bidi targets (chrome and firefox only), folded
# into test-<browser>-remote below.
Comment thread
titusfortner marked this conversation as resolved.
[
py_test_suite(
name = "test-%s-remote-bidi" % browser,
size = "large",
srcs = BIDI_TESTS + BIDI_IMPLEMENTATIONS,
srcs = REMOTE_BIDI_TESTS,
args = [
"--instafail",
"--bidi",
Expand All @@ -1166,8 +1168,8 @@ FEATURE_SUITE_DEFS = {
target_compatible_with = BROWSERS[browser]["target_compatible_with"],
test_suffix = "%s-remote-bidi" % browser,
deps = [
":bidi_protocol", # bidi/protocol_tests.py imports the generated _bidi layer directly
":common_alert", # bidi/browsing_context_tests.py calls EC.alert_is_present()
":bidi_protocol",
":common_alert",
":init-tree",
":webserver",
] + BROWSER_TESTS[browser]["deps"] + TEST_DEPS,
Expand All @@ -1176,6 +1178,7 @@ FEATURE_SUITE_DEFS = {
"chrome",
"firefox",
]
if REMOTE_BIDI_TESTS
]

# Generate test-<browser>-remote-common targets (chrome and firefox only)
Expand Down Expand Up @@ -1302,7 +1305,7 @@ FEATURE_SUITE_DEFS = {
tests = [
":test-%s-remote-common" % browser,
":test-%s-remote-actions" % browser,
] + [":test-%s-remote-%s" % (browser, f) for f in FEATURE_SUITE_DEFS],
] + [":test-%s-remote-%s" % (browser, f) for f in FEATURE_SUITE_DEFS] + ([":test-%s-remote-bidi" % browser] if REMOTE_BIDI_TESTS else []),
) for browser in [
"chrome",
"firefox",
Expand All @@ -1317,16 +1320,6 @@ test_suite(
],
)

# Kept out of :test-remote so BiDi-over-Grid runs as its own CI job while it is new.
test_suite(
name = "test-remote-bidi",
tags = ["remote"],
tests = [
":test-chrome-remote-bidi",
":test-firefox-remote-bidi",
],
)

py_binary(
name = "generate-api-listing",
srcs = ["generate_api_module_listing.py"],
Expand Down
12 changes: 6 additions & 6 deletions py/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ bazel test //py:test-chrome-bidi

# Against a Grid server (chrome and firefox only). The suite starts its own
# Selenium standalone server and talks to it with webdriver.Remote.
bazel test //py:test-chrome-remote # classic protocol
bazel test //py:test-chrome-remote-bidi # BiDi over Grid's websocket proxy
bazel test //py:test-remote # every classic remote suite
bazel test //py:test-remote-bidi # every BiDi remote suite
bazel test //py:test-chrome-remote
bazel test //py:test-remote # every remote suite

# Test filters
bazel test //py/... --test_tag_filters=chrome
Expand Down Expand Up @@ -107,8 +105,10 @@ pytest py/test/selenium/webdriver/chrome/ --driver chrome --headless -v
> To run against a Grid server, add `--remote`. It starts a Selenium standalone
> server and runs the tests through `webdriver.Remote`, so it needs the Grid jar
> built first (`bazel build //java/src/org/openqa/selenium/grid:selenium_server_deploy.jar`).
> `--bidi --remote` combine: Grid rewrites the `webSocketUrl` capability to its own
> `/session/<id>/se/bidi` endpoint and proxies the socket through to the node.
>
> A BiDi test file with Grid-specific behavior can be listed in `REMOTE_BIDI_TESTS`
> in `py/BUILD.bazel`; it then also runs with `--bidi --remote` as part of
> `test-<browser>-remote`.

## Skipping Tests

Expand Down