diff --git a/.github/workflows/ci-java.yml b/.github/workflows/ci-java.yml index a8cdd0f331745..ce3f6955d10e3 100644 --- a/.github/workflows/ci-java.yml +++ b/.github/workflows/ci-java.yml @@ -74,8 +74,8 @@ jobs: bazel query "attr(tags, ${{ matrix.browser }}, tests(//java/...)) except attr(tags, 'rc|remote', tests(//java/...))" | xargs bazel test --flaky_test_attempts 3 - server-tests: - name: Server Tests + remote-tests: + name: Remote Tests needs: small-tests uses: ./.github/workflows/bazel.yml strategy: @@ -91,10 +91,10 @@ jobs: - browser: firefox browser-version: latest-devedition with: - name: Server Tests (${{ matrix.browser }}, ${{ matrix.browser-version }}) + name: Remote Tests (${{ matrix.browser }}, ${{ matrix.browser-version }}) browser: ${{ matrix.browser }} browser-version: ${{ matrix.browser-version }} - cache-key: java-${{ matrix.browser }}-server-tests + cache-key: java-${{ matrix.browser }}-remote-tests run: > bazel query "attr(tags, ${{ matrix.browser }}, tests(//java/...)) intersect attr(tags, 'remote', tests(//java/...))" | xargs bazel test --flaky_test_attempts 3 diff --git a/java/private/selenium_test.bzl b/java/private/selenium_test.bzl index 1f1e7abf2bcb4..549a8ad23554a 100644 --- a/java/private/selenium_test.bzl +++ b/java/private/selenium_test.bzl @@ -68,6 +68,11 @@ def selenium_test(name, test_class, size = "medium", browsers = BROWSERS.keys(), jvm_flags = kwargs["jvm_flags"] if "jvm_flags" in kwargs else [] tags = kwargs["tags"] if "tags" in kwargs else [] + remote = False + if "selenium-remote" in tags: + tags.remove("selenium-remote") + remote = True + stripped_args = dict(**kwargs) stripped_args.pop("data", None) stripped_args.pop("jvm_flags", None) @@ -98,7 +103,7 @@ def selenium_test(name, test_class, size = "medium", browsers = BROWSERS.keys(), ) all_tests.append(":%s" % test) - if "selenium-remote" in tags: + if remote: java_junit5_test( name = "%s-remote" % test, test_class = test_class, @@ -108,7 +113,7 @@ def selenium_test(name, test_class, size = "medium", browsers = BROWSERS.keys(), "-Dselenium.browser.remote.path=$(location @selenium//java/src/org/openqa/selenium/grid:selenium_server_deploy.jar)", ], # No need to lint remote tests as the code for non-remote is the same and they get linted - tags = BROWSERS[browser]["tags"] + tags + ["remote", "no-lint"], + tags = BROWSERS[browser]["tags"] + tags + ["remote1", "no-lint"], data = BROWSERS[browser]["data"] + data + [ "@selenium//java/src/org/openqa/selenium/grid:selenium_server_deploy.jar", ],