From df8b7f38bf8e3d9038f7a5628c0ce0ac44a672dd Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Fri, 7 Mar 2025 00:35:11 +0000 Subject: [PATCH 01/74] test remove scala --- MODULE.bazel | 82 +++++++++++++------ scalatests/com/google/testing/web/BUILD.bazel | 66 +++++++-------- web/scala.bzl | 62 +++++++------- 3 files changed, 122 insertions(+), 88 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 17754659..ba98905b 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -3,14 +3,31 @@ module( version = "0.4.0", ) -bazel_dep(name = "bazel_skylib", version = "1.7.1") -bazel_dep(name = "platforms", version = "0.0.10") +bazel_dep( + name = "bazel_skylib", + version = "1.7.1", +) + +bazel_dep( + name = "platforms", + version = "0.0.10", +) ##### Go dependencies ##### -bazel_dep(name = "rules_go", version = "0.51.0-rc1", repo_name = "io_bazel_rules_go") -bazel_dep(name = "gazelle", version = "0.40.0", repo_name = "bazel_gazelle") +bazel_dep( + name = "rules_go", + version = "0.51.0-rc1", + repo_name = "io_bazel_rules_go", +) + +bazel_dep( + name = "gazelle", + version = "0.40.0", + repo_name = "bazel_gazelle", +) go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") + go_deps.from_file(go_mod = "//:go.mod") # All *direct* Go dependencies of the module have to be listed explicitly. @@ -21,9 +38,13 @@ use_repo( ) ##### Java dependencies ##### -bazel_dep(name = "rules_jvm_external", version = "6.6") +bazel_dep( + name = "rules_jvm_external", + version = "6.6", +) maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") + maven.install( artifacts = [ "com.google.guava:guava:33.2.1-jre", @@ -32,52 +53,65 @@ maven.install( "junit:junit:4.13.2", ], ) + use_repo(maven, "maven") ##### Python dependencies ##### -bazel_dep(name = "rules_python", version = "1.0.0") +bazel_dep( + name = "rules_python", + version = "1.0.0", +) python = use_extension("@rules_python//python/extensions:python.bzl", "python") + python.toolchain( is_default = True, python_version = "3.11", ) + use_repo(python, "python_3_11", "python_versions") pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") + pip.parse( hub_name = "rules_webtesting_py_deps", python_version = "3.11", requirements_lock = "//:requirements_lock.txt", requirements_windows = "requirements_lock_windows.txt", ) + use_repo(pip, "rules_webtesting_py_deps") ##### Scala dependencies ##### -bazel_dep(name = "rules_scala", repo_name = "io_bazel_rules_scala") +#bazel_dep( +# name = "rules_scala", +# repo_name = "io_bazel_rules_scala", +#) # TODO: Switch to a release version once it's available in BCR. # Otherwise, the root module has to declare the same override. -git_override( - module_name = "rules_scala", - commit = "219e63983e8e483e66ebf70372969ba227382001", - remote = "https://github.com/mbland/rules_scala", -) - -scala_deps = use_extension( - "@io_bazel_rules_scala//scala/extensions:deps.bzl", - "scala_deps", -) -scala_deps.settings( - fetch_sources = True, -) -scala_deps.toolchains( - scalatest = True, -) +#git_override( +# module_name = "rules_scala", +# commit = "219e63983e8e483e66ebf70372969ba227382001", +# remote = "https://github.com/mbland/rules_scala", +#) +# +#scala_deps = use_extension( +# "@io_bazel_rules_scala//scala/extensions:deps.bzl", +# "scala_deps", +#) +#scala_deps.settings( +# fetch_sources = True, +#) +#scala_deps.toolchains( +# scalatest = True, +#) ##### Browsers dependencies ##### browser_repositories = use_extension("//web:extension.bzl", "browser_repositories_extension") + browser_repositories.install(version = "0.3.4") + use_repo( browser_repositories, "com_saucelabs_sauce_connect_linux_x64", @@ -88,7 +122,7 @@ use_repo( "org_chromium_chromedriver_macos_x64", "org_chromium_chromedriver_windows_x64", "org_chromium_chromium_linux_x64", - "org_chromium_chromium_macos_arm64", # Only available in 0.3.3 + "org_chromium_chromium_macos_arm64", # Only available in 0.3.3 "org_chromium_chromium_macos_x64", "org_chromium_chromium_windows_x64", "org_mozilla_firefox_linux_x64", diff --git a/scalatests/com/google/testing/web/BUILD.bazel b/scalatests/com/google/testing/web/BUILD.bazel index a7b7c5c0..4e21ced1 100644 --- a/scalatests/com/google/testing/web/BUILD.bazel +++ b/scalatests/com/google/testing/web/BUILD.bazel @@ -1,35 +1,35 @@ -# Copyright 2018 Google Inc. +## Copyright 2018 Google Inc. +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## +################################################################################# +## +#load("//web:scala.bzl", "scala_web_test_suite") # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +#licenses(["notice"]) # Apache 2.0 # -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -################################################################################ -# -load("//web:scala.bzl", "scala_web_test_suite") - -licenses(["notice"]) # Apache 2.0 - -scala_web_test_suite( - name = "WebTestTest", - srcs = ["WebTestTest.scala"], - browsers = [ - "//browsers:chromium-local", - "//browsers:firefox-local", - "//browsers/sauce:chrome-win10", - "//browsers/sauce:chrome-win10-connect", - ], - deps = [ - "//java/com/google/testing/web", - "@maven//:junit_junit", - "@maven//:org_seleniumhq_selenium_selenium_api", - ], -) +#scala_web_test_suite( +# name = "WebTestTest", +# srcs = ["WebTestTest.scala"], +# browsers = [ +# "//browsers:chromium-local", +# "//browsers:firefox-local", +# "//browsers/sauce:chrome-win10", +# "//browsers/sauce:chrome-win10-connect", +# ], +# deps = [ +# "//java/com/google/testing/web", +# "@maven//:junit_junit", +# "@maven//:org_seleniumhq_selenium_selenium_api", +# ], +#) diff --git a/web/scala.bzl b/web/scala.bzl index 19e2ea27..2a08efc8 100644 --- a/web/scala.bzl +++ b/web/scala.bzl @@ -1,34 +1,34 @@ -# Copyright 2016 Google Inc. +## Copyright 2016 Google Inc. +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +#"""Web Test rules for Java.""" # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +#load("//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") +#load("//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") +#load("@io_bazel_rules_scala//scala:scala.bzl", "scala_test") # -# http://www.apache.org/licenses/LICENSE-2.0 +#def scala_web_test_suite(name, scala_test_tags = DEFAULT_WRAPPED_TEST_TAGS, **kwargs): +# """Defines a test_suite of web_test targets that wrap a java_test target. # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Web Test rules for Java.""" - -load("//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") -load("//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") -load("@io_bazel_rules_scala//scala:scala.bzl", "scala_test") - -def scala_web_test_suite(name, scala_test_tags = DEFAULT_WRAPPED_TEST_TAGS, **kwargs): - """Defines a test_suite of web_test targets that wrap a java_test target. - - Args: - name: The base name of the test. - scala_test_tags: A list of test tag strings to use for the scala_test - target. - **kwargs: Arguments for wrapped_web_test_suite - """ - wrap_web_test_suite( - name = name, - rule = scala_test, - wrapped_test_tags = scala_test_tags, - **kwargs - ) +# Args: +# name: The base name of the test. +# scala_test_tags: A list of test tag strings to use for the scala_test +# target. +# **kwargs: Arguments for wrapped_web_test_suite +# """ +# wrap_web_test_suite( +# name = name, +# rule = scala_test, +# wrapped_test_tags = scala_test_tags, +# **kwargs +# ) From 44f9756d9d409d0b5dbdfa77b71fcf5543c7f5aa Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Fri, 7 Mar 2025 02:36:47 +0000 Subject: [PATCH 02/74] test submodule --- MODULE.bazel | 25 -------- scalatests/com/google/testing/web/BUILD.bazel | 35 ----------- web/scala.bzl | 34 ----------- web/scala/BUILD.bazel | 35 +++++++++++ web/scala/MODULE.bazel | 59 +++++++++++++++++++ .../web => web/scala}/WebTestTest.scala | 0 web/scala/scala.bzl | 34 +++++++++++ 7 files changed, 128 insertions(+), 94 deletions(-) delete mode 100644 scalatests/com/google/testing/web/BUILD.bazel delete mode 100644 web/scala.bzl create mode 100644 web/scala/BUILD.bazel create mode 100644 web/scala/MODULE.bazel rename {scalatests/com/google/testing/web => web/scala}/WebTestTest.scala (100%) create mode 100644 web/scala/scala.bzl diff --git a/MODULE.bazel b/MODULE.bazel index ba98905b..937b409a 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -82,31 +82,6 @@ pip.parse( use_repo(pip, "rules_webtesting_py_deps") -##### Scala dependencies ##### -#bazel_dep( -# name = "rules_scala", -# repo_name = "io_bazel_rules_scala", -#) - -# TODO: Switch to a release version once it's available in BCR. -# Otherwise, the root module has to declare the same override. -#git_override( -# module_name = "rules_scala", -# commit = "219e63983e8e483e66ebf70372969ba227382001", -# remote = "https://github.com/mbland/rules_scala", -#) -# -#scala_deps = use_extension( -# "@io_bazel_rules_scala//scala/extensions:deps.bzl", -# "scala_deps", -#) -#scala_deps.settings( -# fetch_sources = True, -#) -#scala_deps.toolchains( -# scalatest = True, -#) - ##### Browsers dependencies ##### browser_repositories = use_extension("//web:extension.bzl", "browser_repositories_extension") diff --git a/scalatests/com/google/testing/web/BUILD.bazel b/scalatests/com/google/testing/web/BUILD.bazel deleted file mode 100644 index 4e21ced1..00000000 --- a/scalatests/com/google/testing/web/BUILD.bazel +++ /dev/null @@ -1,35 +0,0 @@ -## Copyright 2018 Google Inc. -## -## Licensed under the Apache License, Version 2.0 (the "License"); -## you may not use this file except in compliance with the License. -## You may obtain a copy of the License at -## -## http://www.apache.org/licenses/LICENSE-2.0 -## -## Unless required by applicable law or agreed to in writing, software -## distributed under the License is distributed on an "AS IS" BASIS, -## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -## See the License for the specific language governing permissions and -## limitations under the License. -## -################################################################################# -## -#load("//web:scala.bzl", "scala_web_test_suite") -# -#licenses(["notice"]) # Apache 2.0 -# -#scala_web_test_suite( -# name = "WebTestTest", -# srcs = ["WebTestTest.scala"], -# browsers = [ -# "//browsers:chromium-local", -# "//browsers:firefox-local", -# "//browsers/sauce:chrome-win10", -# "//browsers/sauce:chrome-win10-connect", -# ], -# deps = [ -# "//java/com/google/testing/web", -# "@maven//:junit_junit", -# "@maven//:org_seleniumhq_selenium_selenium_api", -# ], -#) diff --git a/web/scala.bzl b/web/scala.bzl deleted file mode 100644 index 2a08efc8..00000000 --- a/web/scala.bzl +++ /dev/null @@ -1,34 +0,0 @@ -## Copyright 2016 Google Inc. -## -## Licensed under the Apache License, Version 2.0 (the "License"); -## you may not use this file except in compliance with the License. -## You may obtain a copy of the License at -## -## http://www.apache.org/licenses/LICENSE-2.0 -## -## Unless required by applicable law or agreed to in writing, software -## distributed under the License is distributed on an "AS IS" BASIS, -## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -## See the License for the specific language governing permissions and -## limitations under the License. -#"""Web Test rules for Java.""" -# -#load("//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") -#load("//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") -#load("@io_bazel_rules_scala//scala:scala.bzl", "scala_test") -# -#def scala_web_test_suite(name, scala_test_tags = DEFAULT_WRAPPED_TEST_TAGS, **kwargs): -# """Defines a test_suite of web_test targets that wrap a java_test target. -# -# Args: -# name: The base name of the test. -# scala_test_tags: A list of test tag strings to use for the scala_test -# target. -# **kwargs: Arguments for wrapped_web_test_suite -# """ -# wrap_web_test_suite( -# name = name, -# rule = scala_test, -# wrapped_test_tags = scala_test_tags, -# **kwargs -# ) diff --git a/web/scala/BUILD.bazel b/web/scala/BUILD.bazel new file mode 100644 index 00000000..82a352d7 --- /dev/null +++ b/web/scala/BUILD.bazel @@ -0,0 +1,35 @@ +# Copyright 2018 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# +load("//:scala.bzl", "scala_web_test_suite") + +licenses(["notice"]) # Apache 2.0 + +scala_web_test_suite( + name = "WebTestTest", + srcs = ["WebTestTest.scala"], + browsers = [ + "@rules_webtesting//browsers:chromium-local", + "@rules_webtesting//browsers:firefox-local", + "@rules_webtesting//browsers/sauce:chrome-win10", + "@rules_webtesting//browsers/sauce:chrome-win10-connect", + ], + deps = [ + "@maven//:junit_junit", + "@maven//:org_seleniumhq_selenium_selenium_api", + "@rules_webtesting//java/com/google/testing/web", + ], +) diff --git a/web/scala/MODULE.bazel b/web/scala/MODULE.bazel new file mode 100644 index 00000000..3e239144 --- /dev/null +++ b/web/scala/MODULE.bazel @@ -0,0 +1,59 @@ +module( + name = "rules_webtesting_web_scala", + version = "0.4.0", +) + +bazel_dep( + name = "rules_webtesting", +) + +local_path_override( + module_name = "rules_webtesting", + path = "../..", +) + +##### Scala dependencies ##### +bazel_dep( + name = "rules_scala", + repo_name = "io_bazel_rules_scala", +) + +# TODO: Switch to a release version once it's available in BCR. +# Otherwise, the root module has to declare the same override. +git_override( + module_name = "rules_scala", + commit = "219e63983e8e483e66ebf70372969ba227382001", + remote = "https://github.com/mbland/rules_scala", +) + +scala_deps = use_extension( + "@io_bazel_rules_scala//scala/extensions:deps.bzl", + "scala_deps", +) + +scala_deps.settings( + fetch_sources = True, +) + +scala_deps.toolchains( + scalatest = True, +) + +##### Java dependencies ##### +bazel_dep( + name = "rules_jvm_external", + version = "6.6", +) + +maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") + +maven.install( + artifacts = [ + "com.google.guava:guava:33.2.1-jre", + "org.seleniumhq.selenium:selenium-remote-driver:4.27.0", + "org.seleniumhq.selenium:selenium-api:4.27.0", + "junit:junit:4.13.2", + ], +) + +use_repo(maven, "maven") diff --git a/scalatests/com/google/testing/web/WebTestTest.scala b/web/scala/WebTestTest.scala similarity index 100% rename from scalatests/com/google/testing/web/WebTestTest.scala rename to web/scala/WebTestTest.scala diff --git a/web/scala/scala.bzl b/web/scala/scala.bzl new file mode 100644 index 00000000..b78ec7e7 --- /dev/null +++ b/web/scala/scala.bzl @@ -0,0 +1,34 @@ +# Copyright 2016 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Web Test rules for Java.""" + +load("@io_bazel_rules_scala//scala:scala.bzl", "scala_test") +load("@rules_webtesting//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") +load("@rules_webtesting//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") + +def scala_web_test_suite(name, scala_test_tags = DEFAULT_WRAPPED_TEST_TAGS, **kwargs): + """Defines a test_suite of web_test targets that wrap a java_test target. + + Args: + name: The base name of the test. + scala_test_tags: A list of test tag strings to use for the scala_test + target. + **kwargs: Arguments for wrapped_web_test_suite + """ + wrap_web_test_suite( + name = name, + rule = scala_test, + wrapped_test_tags = scala_test_tags, + **kwargs + ) From f9bc6819032c95fbfc21206ea21d97b9a45672e0 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Sat, 8 Mar 2025 02:33:01 +0000 Subject: [PATCH 03/74] test for submodule --- MODULE.bazel | 48 +++--- rules_webtesting.iml | 12 ++ web/BUILD.bazel | 25 +-- web/internal/BUILD.bazel | 2 +- web/web_go/MODULE.bazel | 60 ++++++++ web/web_go/go/BUILD.bazel | 32 ++++ web/web_go/go/go.bzl | 33 ++++ web/web_go/gotests/BUILD.bazel | 0 web/web_java/MODULE.bazel | 36 +++++ web/web_java/java/BUILD.bazel | 29 ++++ web/{ => web_java/java}/java.bzl | 5 +- .../com/google/testing/web/BUILD.bazel | 12 +- .../com/google/testing/web/WebTestTest.java | 2 +- web/web_python/BUILD.bazel | 28 ++++ web/web_python/MODULE.bazel | 43 ++++++ web/web_python/python/BUILD.bazel | 29 ++++ web/web_python/python/py.bzl | 37 +++++ web/web_python/pythontests/BUILD.bazel | 62 ++++++++ web/web_python/pythontests/webtest.py | 59 +++++++ web/web_python/pythontests/webtest_test.py | 47 ++++++ web/web_python/requirements_lock.txt | 71 +++++++++ web/web_python/requirements_lock_windows.txt | 144 ++++++++++++++++++ web/{scala => web_scala}/MODULE.bazel | 5 + web/web_scala/scala/BUILD.bazel | 32 ++++ web/{ => web_scala}/scala/scala.bzl | 0 .../scalatests}/BUILD.bazel | 2 +- .../scalatests}/WebTestTest.scala | 0 27 files changed, 799 insertions(+), 56 deletions(-) create mode 100644 rules_webtesting.iml create mode 100644 web/web_go/MODULE.bazel create mode 100644 web/web_go/go/BUILD.bazel create mode 100644 web/web_go/go/go.bzl create mode 100644 web/web_go/gotests/BUILD.bazel create mode 100644 web/web_java/MODULE.bazel create mode 100644 web/web_java/java/BUILD.bazel rename web/{ => web_java/java}/java.bzl (83%) rename {javatests => web/web_java/javatests}/com/google/testing/web/BUILD.bazel (73%) rename {javatests => web/web_java/javatests}/com/google/testing/web/WebTestTest.java (99%) create mode 100644 web/web_python/BUILD.bazel create mode 100644 web/web_python/MODULE.bazel create mode 100644 web/web_python/python/BUILD.bazel create mode 100644 web/web_python/python/py.bzl create mode 100644 web/web_python/pythontests/BUILD.bazel create mode 100644 web/web_python/pythontests/webtest.py create mode 100644 web/web_python/pythontests/webtest_test.py create mode 100644 web/web_python/requirements_lock.txt create mode 100644 web/web_python/requirements_lock_windows.txt rename web/{scala => web_scala}/MODULE.bazel (95%) create mode 100644 web/web_scala/scala/BUILD.bazel rename web/{ => web_scala}/scala/scala.bzl (100%) rename web/{scala => web_scala/scalatests}/BUILD.bazel (96%) rename web/{scala => web_scala/scalatests}/WebTestTest.scala (100%) diff --git a/MODULE.bazel b/MODULE.bazel index 937b409a..af0ec64a 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -57,30 +57,30 @@ maven.install( use_repo(maven, "maven") ##### Python dependencies ##### -bazel_dep( - name = "rules_python", - version = "1.0.0", -) - -python = use_extension("@rules_python//python/extensions:python.bzl", "python") - -python.toolchain( - is_default = True, - python_version = "3.11", -) - -use_repo(python, "python_3_11", "python_versions") - -pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") - -pip.parse( - hub_name = "rules_webtesting_py_deps", - python_version = "3.11", - requirements_lock = "//:requirements_lock.txt", - requirements_windows = "requirements_lock_windows.txt", -) - -use_repo(pip, "rules_webtesting_py_deps") +#bazel_dep( +# name = "rules_python", +# version = "1.0.0", +#) +# +#python = use_extension("@rules_python//python/extensions:python.bzl", "python") +# +#python.toolchain( +# is_default = True, +# python_version = "3.11", +#) +# +#use_repo(python, "python_3_11", "python_versions") +# +#pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") +# +#pip.parse( +# hub_name = "rules_webtesting_py_deps", +# python_version = "3.11", +# requirements_lock = "//:requirements_lock.txt", +# requirements_windows = "requirements_lock_windows.txt", +#) +# +#use_repo(pip, "rules_webtesting_py_deps") ##### Browsers dependencies ##### browser_repositories = use_extension("//web:extension.bzl", "browser_repositories_extension") diff --git a/rules_webtesting.iml b/rules_webtesting.iml new file mode 100644 index 00000000..b3840569 --- /dev/null +++ b/rules_webtesting.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/web/BUILD.bazel b/web/BUILD.bazel index 6b5e9ae1..8a09f3b2 100644 --- a/web/BUILD.bazel +++ b/web/BUILD.bazel @@ -1,3 +1,5 @@ +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") + # Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,7 +17,6 @@ ################################################################################ # load(":web.bzl", "web_test_config") -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") package( default_testonly = True, @@ -29,15 +30,6 @@ web_test_config( visibility = ["//visibility:public"], ) -bzl_library( - name = "go", - srcs = ["go.bzl"], - deps = [ - "//web/internal:wrap_web_test_suite", - # should depend on @io_bazel_rules_go//go:def.bzl - ], -) - bzl_library( name = "java", srcs = ["java.bzl"], @@ -50,24 +42,15 @@ bzl_library( deps = ["//web/internal:wrap_web_test_suite"], ) -bzl_library( - name = "scala", - srcs = ["scala.bzl"], - deps = [ - "//web/internal:wrap_web_test_suite", - # should depend on @io_bazel_rules_scala//scala:scala.bzl - ], -) - bzl_library( name = "web", srcs = ["web.bzl"], deps = [ "//web/internal:browser", "//web/internal:constants", - "//web/internal:platform_metadata", - "//web/internal:platform_archive", "//web/internal:custom_browser", + "//web/internal:platform_archive", + "//web/internal:platform_metadata", "//web/internal:web_test", "//web/internal:web_test_config", "//web/internal:web_test_files", diff --git a/web/internal/BUILD.bazel b/web/internal/BUILD.bazel index d92ea949..582fef40 100644 --- a/web/internal/BUILD.bazel +++ b/web/internal/BUILD.bazel @@ -18,7 +18,7 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") package( default_testonly = True, - default_visibility = ["//web:__subpackages__"], + default_visibility = ["//visibility:public"], ) licenses(["notice"]) # Apache 2.0 diff --git a/web/web_go/MODULE.bazel b/web/web_go/MODULE.bazel new file mode 100644 index 00000000..7bfa121f --- /dev/null +++ b/web/web_go/MODULE.bazel @@ -0,0 +1,60 @@ +module( + name = "rules_webtesting_web_go", + version = "0.4.0", +) + +bazel_dep( + name = "rules_webtesting", +) + +local_path_override( + module_name = "rules_webtesting", + path = "../..", +) + +bazel_dep( + name = "bazel_skylib", + version = "1.7.1", +) + +bazel_dep( + name = "rules_jvm_external", + version = "6.6", +) + +maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") + +maven.install( + artifacts = [ + "com.google.guava:guava:33.2.1-jre", + "org.seleniumhq.selenium:selenium-remote-driver:4.27.0", + "org.seleniumhq.selenium:selenium-api:4.27.0", + "junit:junit:4.13.2", + ], +) + +use_repo(maven, "maven") + +##### Go dependencies ##### +bazel_dep( + name = "rules_go", + version = "0.51.0-rc1", + repo_name = "io_bazel_rules_go", +) + +bazel_dep( + name = "gazelle", + version = "0.40.0", + repo_name = "bazel_gazelle", +) + +go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") + +go_deps.from_file(go_mod = "//:go.mod") + +# All *direct* Go dependencies of the module have to be listed explicitly. +use_repo( + go_deps, + "com_github_gorilla_mux", + "com_github_tebeka_selenium", +) diff --git a/web/web_go/go/BUILD.bazel b/web/web_go/go/BUILD.bazel new file mode 100644 index 00000000..de41e9e4 --- /dev/null +++ b/web/web_go/go/BUILD.bazel @@ -0,0 +1,32 @@ +# Copyright 2016 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("@rules_webtesting//web:web.bzl", "web_test_config") + +package( + default_testonly = True, + default_visibility = ["//visibility:public"], +) + +bzl_library( + name = "go", + srcs = ["go.bzl"], + deps = [ + "@rules_webtesting//web/internal:wrap_web_test_suite", + # should depend on @io_bazel_rules_go//go:def.bzl + ], +) diff --git a/web/web_go/go/go.bzl b/web/web_go/go/go.bzl new file mode 100644 index 00000000..183226b8 --- /dev/null +++ b/web/web_go/go/go.bzl @@ -0,0 +1,33 @@ +# Copyright 2016 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Web Test rules for Go.""" + +load("@io_bazel_rules_go//go:def.bzl", "go_test") +load("@rules_webtesting//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") +load("@rules_webtesting//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") + +def go_web_test_suite(name, go_test_tags = DEFAULT_WRAPPED_TEST_TAGS, **kwargs): + """Defines a test_suite of web_test targets that wrap a go_test target. + + Args: + name: The base name of the test. + go_test_tags: A list of test tag strings to use for the go_test target. + **kwargs: Arguments for wrapped_web_test_suite + """ + wrap_web_test_suite( + name = name, + rule = go_test, + wrapped_test_tags = go_test_tags, + **kwargs + ) diff --git a/web/web_go/gotests/BUILD.bazel b/web/web_go/gotests/BUILD.bazel new file mode 100644 index 00000000..e69de29b diff --git a/web/web_java/MODULE.bazel b/web/web_java/MODULE.bazel new file mode 100644 index 00000000..fc33e8cf --- /dev/null +++ b/web/web_java/MODULE.bazel @@ -0,0 +1,36 @@ +module( + name = "rules_webtesting_web_java", + version = "0.4.0", +) + +bazel_dep( + name = "rules_webtesting", +) + +local_path_override( + module_name = "rules_webtesting", + path = "../..", +) + +bazel_dep( + name = "bazel_skylib", + version = "1.7.1", +) + +bazel_dep( + name = "rules_jvm_external", + version = "6.6", +) + +maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") + +maven.install( + artifacts = [ + "com.google.guava:guava:33.2.1-jre", + "org.seleniumhq.selenium:selenium-remote-driver:4.27.0", + "org.seleniumhq.selenium:selenium-api:4.27.0", + "junit:junit:4.13.2", + ], +) + +use_repo(maven, "maven") diff --git a/web/web_java/java/BUILD.bazel b/web/web_java/java/BUILD.bazel new file mode 100644 index 00000000..67a7da87 --- /dev/null +++ b/web/web_java/java/BUILD.bazel @@ -0,0 +1,29 @@ +# Copyright 2016 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("@rules_webtesting//web:web.bzl", "web_test_config") + +package( + default_testonly = True, + default_visibility = ["//visibility:public"], +) + +bzl_library( + name = "java", + srcs = ["java.bzl"], + deps = ["@rules_webtesting//web/internal:wrap_web_test_suite"], +) diff --git a/web/java.bzl b/web/web_java/java/java.bzl similarity index 83% rename from web/java.bzl rename to web/web_java/java/java.bzl index 359425ad..b6476ea5 100644 --- a/web/java.bzl +++ b/web/web_java/java/java.bzl @@ -13,8 +13,8 @@ # limitations under the License. """Web Test rules for Java.""" -load("//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") -load("//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") +load("@rules_webtesting//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") +load("@rules_webtesting//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") def java_web_test_suite(name, java_test_tags = DEFAULT_WRAPPED_TEST_TAGS, test_class = None, **kwargs): """Defines a test_suite of web_test targets that wrap a java_test target. @@ -29,6 +29,7 @@ def java_web_test_suite(name, java_test_tags = DEFAULT_WRAPPED_TEST_TAGS, test_c test_package = native.package_name().replace("javatests/", "") test_package = test_package.replace("/", ".") test_class = test_package + "." + name + print("test class is" + str(test_class) + "," + "the native class is" + str(native.package_name())) wrap_web_test_suite( name = name, diff --git a/javatests/com/google/testing/web/BUILD.bazel b/web/web_java/javatests/com/google/testing/web/BUILD.bazel similarity index 73% rename from javatests/com/google/testing/web/BUILD.bazel rename to web/web_java/javatests/com/google/testing/web/BUILD.bazel index 7499d4c4..d72c3919 100644 --- a/javatests/com/google/testing/web/BUILD.bazel +++ b/web/web_java/javatests/com/google/testing/web/BUILD.bazel @@ -14,7 +14,7 @@ # ################################################################################ # -load("//web:java.bzl", "java_web_test_suite") +load("//java:java.bzl", "java_web_test_suite") licenses(["notice"]) # Apache 2.0 @@ -22,14 +22,14 @@ java_web_test_suite( name = "WebTestTest", srcs = ["WebTestTest.java"], browsers = [ - "//browsers:chromium-local", - "//browsers:firefox-local", - "//browsers/sauce:chrome-win10", - "//browsers/sauce:chrome-win10-connect", + "@rules_webtesting//browsers:chromium-local", + "@rules_webtesting//browsers:firefox-local", + "@rules_webtesting//browsers/sauce:chrome-win10", + "@rules_webtesting//browsers/sauce:chrome-win10-connect", ], deps = [ - "//java/com/google/testing/web", "@maven//:junit_junit", "@maven//:org_seleniumhq_selenium_selenium_api", + "@rules_webtesting//java/com/google/testing/web", ], ) diff --git a/javatests/com/google/testing/web/WebTestTest.java b/web/web_java/javatests/com/google/testing/web/WebTestTest.java similarity index 99% rename from javatests/com/google/testing/web/WebTestTest.java rename to web/web_java/javatests/com/google/testing/web/WebTestTest.java index 922a1cb0..cf924af7 100644 --- a/javatests/com/google/testing/web/WebTestTest.java +++ b/web/web_java/javatests/com/google/testing/web/WebTestTest.java @@ -31,4 +31,4 @@ public void newWebDriverSession() { driver.get(wt.HTTPAddress().resolve("/healthz").toString()); driver.quit(); } -} +} \ No newline at end of file diff --git a/web/web_python/BUILD.bazel b/web/web_python/BUILD.bazel new file mode 100644 index 00000000..b5ad4b8c --- /dev/null +++ b/web/web_python/BUILD.bazel @@ -0,0 +1,28 @@ +# Copyright 2016 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# +load("@python_versions//3.11:defs.bzl", "compile_pip_requirements") + +licenses(["notice"]) # Apache 2.0 + +exports_files(["LICENSE"]) + +compile_pip_requirements( + name = "requirements", + requirements_in = "requirements.in", + requirements_txt = "requirements_lock.txt", + requirements_windows = "requirements_lock_windows.txt", +) diff --git a/web/web_python/MODULE.bazel b/web/web_python/MODULE.bazel new file mode 100644 index 00000000..94bf78de --- /dev/null +++ b/web/web_python/MODULE.bazel @@ -0,0 +1,43 @@ +module( + name = "rules_webtesting_web_java", + version = "0.4.0", +) + +bazel_dep( + name = "bazel_skylib", + version = "1.7.1", +) + +bazel_dep( + name = "rules_webtesting", +) + +local_path_override( + module_name = "rules_webtesting", + path = "../..", +) + +bazel_dep( + name = "rules_python", + version = "1.0.0", +) + +python = use_extension("@rules_python//python/extensions:python.bzl", "python") + +python.toolchain( + is_default = True, + python_version = "3.11", +) + +use_repo(python, "python_3_11", "python_versions") + +pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") + +pip.parse( + hub_name = "rules_webtesting_py_deps", + python_version = "3.11", + requirements_lock = "//:requirements_lock.txt", + requirements_windows = "requirements_lock_windows.txt", +) + +use_repo(pip, "rules_webtesting_py_deps") diff --git a/web/web_python/python/BUILD.bazel b/web/web_python/python/BUILD.bazel new file mode 100644 index 00000000..0c5a2bc8 --- /dev/null +++ b/web/web_python/python/BUILD.bazel @@ -0,0 +1,29 @@ +# Copyright 2024 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("@rules_webtesting//web:web.bzl", "web_test_config") + +package( + default_testonly = True, + default_visibility = ["//visibility:public"], +) + +bzl_library( + name = "py", + srcs = ["py.bzl"], + deps = ["@rules_webtesting//web/internal:wrap_web_test_suite"], +) diff --git a/web/web_python/python/py.bzl b/web/web_python/python/py.bzl new file mode 100644 index 00000000..3a641736 --- /dev/null +++ b/web/web_python/python/py.bzl @@ -0,0 +1,37 @@ +# Copyright 2016 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Web Test rules for Python.""" + +load("@rules_webtesting//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") +load("@rules_webtesting//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") + +def py_web_test_suite(name, py_test_tags = DEFAULT_WRAPPED_TEST_TAGS, main = None, **kwargs): + """Defines a test_suite of web_test targets that wrap a py_test target. + + Args: + name: The base name of the test. + py_test_tags: A list of test tag strings to use for the py_test target. + main: Optional; default computed from name. + **kwargs: Arguments for wrapped_web_test_suite + """ + if main == None: + main = name + ".py" + + wrap_web_test_suite( + name = name, + main = main, + rule = native.py_test, + wrapped_test_tags = py_test_tags, + **kwargs + ) diff --git a/web/web_python/pythontests/BUILD.bazel b/web/web_python/pythontests/BUILD.bazel new file mode 100644 index 00000000..1efe201a --- /dev/null +++ b/web/web_python/pythontests/BUILD.bazel @@ -0,0 +1,62 @@ +# Copyright 2016 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# +load("//python:py.bzl", "py_web_test_suite") + +licenses(["notice"]) # Apache 2.0 + +py_library( + name = "web", + testonly = True, + srcs = glob( + ["*.py"], + exclude = ["*_test.py"], + ), + visibility = ["//visibility:public"], + deps = [ + "@rules_webtesting_py_deps//selenium", + ], +) + +py_web_test_suite( + name = "webtest_test", + srcs = ["webtest_test.py"], + browsers = [ + "@rules_webtesting//browsers:chromium-local", + "@rules_webtesting//browsers:firefox-local", + "@rules_webtesting//browsers/sauce:chrome-win10", + "@rules_webtesting//browsers/sauce:chrome-win10-connect", + ], + tags = { + "chromium-local": [ + "native", + ], + "chrome-win10": [ + "exclusive", + "sauce", + "notravis", + ], + "chrome-win10-connect": [ + "exclusive", + "noci", + "sauce", + ], + "firefox-local": [ + "native", + ], + }, + deps = [":web"], +) diff --git a/web/web_python/pythontests/webtest.py b/web/web_python/pythontests/webtest.py new file mode 100644 index 00000000..5e3fd490 --- /dev/null +++ b/web/web_python/pythontests/webtest.py @@ -0,0 +1,59 @@ +# Copyright 2016 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Browser provisioning and information API. + +Provision a browser: + from testing.web import webtest + + driver = webtest.new_webdriver_session() + +Provision a browser with capabilities: + capabilities = {"webdriver.logging.profiler.enabled": true} + driver = webtest.new_webdriver_session(capabilities) +""" +import os + +from selenium.webdriver.remote import remote_connection +from selenium.webdriver.remote import webdriver + + +def new_webdriver_session(capabilities=None): + """Provisions a new WebDriver session. + + Args: + capabilities: a dict with the json capabilities desired for this browser + session. + + Returns: + A new WebDriver connected to a browser defined by the web test + environment. + """ + capabilities = capabilities or {} + address = os.environ['WEB_TEST_WEBDRIVER_SERVER'].rstrip('/') + + # Set the timeout for WebDriver http requests so that the socket default + # timeout is not used. + remote_connection.RemoteConnection.set_timeout(450) + + return webdriver.WebDriver(address, desired_capabilities=capabilities) + + +def http_address(): + """Return the HTTP address of WTL.""" + return os.environ['WEB_TEST_HTTP_SERVER'] + + +def https_address(): + """Return the HTTPS address of WTL.""" + return os.environ['WEB_TEST_HTTPS_SERVER'] diff --git a/web/web_python/pythontests/webtest_test.py b/web/web_python/pythontests/webtest_test.py new file mode 100644 index 00000000..bcaa4a1d --- /dev/null +++ b/web/web_python/pythontests/webtest_test.py @@ -0,0 +1,47 @@ +# Copyright 2016 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Tests for testing.web.webtest.""" + +import unittest + +from testing.web import webtest + + +class BrowserTest(unittest.TestCase): + + def testBrowserProvisioningNoCaps(self): + driver = webtest.new_webdriver_session() + + try: + driver.get(webtest.http_address() + "/healthz") + self.assertTrue(driver.current_url) + finally: + driver.quit() + + def testBrowserProvisioningWithCaps(self): + capabilities = { + "acceptInsecureCerts": False, + "pageLoadStrategy": "normal", + } + driver = webtest.new_webdriver_session(capabilities) + + try: + driver.get(webtest.http_address() + "/healthz") + self.assertTrue(driver.current_url) + finally: + driver.quit() + + +if __name__ == "__main__": + unittest.main() diff --git a/web/web_python/requirements_lock.txt b/web/web_python/requirements_lock.txt new file mode 100644 index 00000000..423b3ab0 --- /dev/null +++ b/web/web_python/requirements_lock.txt @@ -0,0 +1,71 @@ +# +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: +# +# bazel run //:requirements.update +# +attrs==24.2.0 \ + --hash=sha256:5cfb1b9148b5b086569baec03f20d7b6bf3bcacc9a42bebf87ffaaca362f6346 \ + --hash=sha256:81921eb96de3191c8258c199618104dd27ac608d9366f5e35d011eae1867ede2 + # via + # outcome + # trio +certifi==2024.8.30 \ + --hash=sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8 \ + --hash=sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9 + # via selenium +h11==0.14.0 \ + --hash=sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d \ + --hash=sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761 + # via wsproto +idna==3.10 \ + --hash=sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9 \ + --hash=sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3 + # via trio +outcome==1.3.0.post0 \ + --hash=sha256:9dcf02e65f2971b80047b377468e72a268e15c0af3cf1238e6ff14f7f91143b8 \ + --hash=sha256:e771c5ce06d1415e356078d3bdd68523f284b4ce5419828922b6871e65eda82b + # via trio +pysocks==1.7.1 \ + --hash=sha256:08e69f092cc6dbe92a0fdd16eeb9b9ffbc13cadfe5ca4c7bd92ffb078b293299 \ + --hash=sha256:2725bd0a9925919b9b51739eea5f9e2bae91e83288108a9ad338b2e3a4435ee5 \ + --hash=sha256:3f8804571ebe159c380ac6de37643bb4685970655d3bba243530d6558b799aa0 + # via urllib3 +selenium==4.27.1 \ + --hash=sha256:5296c425a75ff1b44d0d5199042b36a6d1ef76c04fb775b97b40be739a9caae2 \ + --hash=sha256:b89b1f62b5cfe8025868556fe82360d6b649d464f75d2655cb966c8f8447ea18 + # via -r requirements.in +sniffio==1.3.1 \ + --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 \ + --hash=sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc + # via trio +sortedcontainers==2.4.0 \ + --hash=sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88 \ + --hash=sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0 + # via trio +trio==0.27.0 \ + --hash=sha256:1dcc95ab1726b2da054afea8fd761af74bad79bd52381b84eae408e983c76831 \ + --hash=sha256:68eabbcf8f457d925df62da780eff15ff5dc68fd6b367e2dde59f7aaf2a0b884 + # via + # selenium + # trio-websocket +trio-websocket==0.11.1 \ + --hash=sha256:18c11793647703c158b1f6e62de638acada927344d534e3c7628eedcb746839f \ + --hash=sha256:520d046b0d030cf970b8b2b2e00c4c2245b3807853ecd44214acd33d74581638 + # via selenium +typing-extensions==4.12.2 \ + --hash=sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d \ + --hash=sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8 + # via selenium +urllib3[socks]==2.2.3 \ + --hash=sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac \ + --hash=sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9 + # via selenium +websocket-client==1.8.0 \ + --hash=sha256:17b44cc997f5c498e809b22cdf2d9c7a9e71c02c8cc2b6c56e7c2d1239bfa526 \ + --hash=sha256:3239df9f44da632f96012472805d40a23281a991027ce11d2f45a6f24ac4c3da + # via selenium +wsproto==1.2.0 \ + --hash=sha256:ad565f26ecb92588a3e43bc3d96164de84cd9902482b130d0ddbaa9664a85065 \ + --hash=sha256:b9acddd652b585d75b20477888c56642fdade28bdfd3579aa24a4d2c037dd736 + # via trio-websocket diff --git a/web/web_python/requirements_lock_windows.txt b/web/web_python/requirements_lock_windows.txt new file mode 100644 index 00000000..d94eee74 --- /dev/null +++ b/web/web_python/requirements_lock_windows.txt @@ -0,0 +1,144 @@ +# +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: +# +# bazel run //:requirements.update +# +attrs==24.2.0 \ + --hash=sha256:5cfb1b9148b5b086569baec03f20d7b6bf3bcacc9a42bebf87ffaaca362f6346 \ + --hash=sha256:81921eb96de3191c8258c199618104dd27ac608d9366f5e35d011eae1867ede2 + # via + # outcome + # trio +certifi==2024.8.30 \ + --hash=sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8 \ + --hash=sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9 + # via selenium +cffi==1.17.1 \ + --hash=sha256:045d61c734659cc045141be4bae381a41d89b741f795af1dd018bfb532fd0df8 \ + --hash=sha256:0984a4925a435b1da406122d4d7968dd861c1385afe3b45ba82b750f229811e2 \ + --hash=sha256:0e2b1fac190ae3ebfe37b979cc1ce69c81f4e4fe5746bb401dca63a9062cdaf1 \ + --hash=sha256:0f048dcf80db46f0098ccac01132761580d28e28bc0f78ae0d58048063317e15 \ + --hash=sha256:1257bdabf294dceb59f5e70c64a3e2f462c30c7ad68092d01bbbfb1c16b1ba36 \ + --hash=sha256:1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824 \ + --hash=sha256:1d599671f396c4723d016dbddb72fe8e0397082b0a77a4fab8028923bec050e8 \ + --hash=sha256:28b16024becceed8c6dfbc75629e27788d8a3f9030691a1dbf9821a128b22c36 \ + --hash=sha256:2bb1a08b8008b281856e5971307cc386a8e9c5b625ac297e853d36da6efe9c17 \ + --hash=sha256:30c5e0cb5ae493c04c8b42916e52ca38079f1b235c2f8ae5f4527b963c401caf \ + --hash=sha256:31000ec67d4221a71bd3f67df918b1f88f676f1c3b535a7eb473255fdc0b83fc \ + --hash=sha256:386c8bf53c502fff58903061338ce4f4950cbdcb23e2902d86c0f722b786bbe3 \ + --hash=sha256:3edc8d958eb099c634dace3c7e16560ae474aa3803a5df240542b305d14e14ed \ + --hash=sha256:45398b671ac6d70e67da8e4224a065cec6a93541bb7aebe1b198a61b58c7b702 \ + --hash=sha256:46bf43160c1a35f7ec506d254e5c890f3c03648a4dbac12d624e4490a7046cd1 \ + --hash=sha256:4ceb10419a9adf4460ea14cfd6bc43d08701f0835e979bf821052f1805850fe8 \ + --hash=sha256:51392eae71afec0d0c8fb1a53b204dbb3bcabcb3c9b807eedf3e1e6ccf2de903 \ + --hash=sha256:5da5719280082ac6bd9aa7becb3938dc9f9cbd57fac7d2871717b1feb0902ab6 \ + --hash=sha256:610faea79c43e44c71e1ec53a554553fa22321b65fae24889706c0a84d4ad86d \ + --hash=sha256:636062ea65bd0195bc012fea9321aca499c0504409f413dc88af450b57ffd03b \ + --hash=sha256:6883e737d7d9e4899a8a695e00ec36bd4e5e4f18fabe0aca0efe0a4b44cdb13e \ + --hash=sha256:6b8b4a92e1c65048ff98cfe1f735ef8f1ceb72e3d5f0c25fdb12087a23da22be \ + --hash=sha256:6f17be4345073b0a7b8ea599688f692ac3ef23ce28e5df79c04de519dbc4912c \ + --hash=sha256:706510fe141c86a69c8ddc029c7910003a17353970cff3b904ff0686a5927683 \ + --hash=sha256:72e72408cad3d5419375fc87d289076ee319835bdfa2caad331e377589aebba9 \ + --hash=sha256:733e99bc2df47476e3848417c5a4540522f234dfd4ef3ab7fafdf555b082ec0c \ + --hash=sha256:7596d6620d3fa590f677e9ee430df2958d2d6d6de2feeae5b20e82c00b76fbf8 \ + --hash=sha256:78122be759c3f8a014ce010908ae03364d00a1f81ab5c7f4a7a5120607ea56e1 \ + --hash=sha256:805b4371bf7197c329fcb3ead37e710d1bca9da5d583f5073b799d5c5bd1eee4 \ + --hash=sha256:85a950a4ac9c359340d5963966e3e0a94a676bd6245a4b55bc43949eee26a655 \ + --hash=sha256:8f2cdc858323644ab277e9bb925ad72ae0e67f69e804f4898c070998d50b1a67 \ + --hash=sha256:9755e4345d1ec879e3849e62222a18c7174d65a6a92d5b346b1863912168b595 \ + --hash=sha256:98e3969bcff97cae1b2def8ba499ea3d6f31ddfdb7635374834cf89a1a08ecf0 \ + --hash=sha256:a08d7e755f8ed21095a310a693525137cfe756ce62d066e53f502a83dc550f65 \ + --hash=sha256:a1ed2dd2972641495a3ec98445e09766f077aee98a1c896dcb4ad0d303628e41 \ + --hash=sha256:a24ed04c8ffd54b0729c07cee15a81d964e6fee0e3d4d342a27b020d22959dc6 \ + --hash=sha256:a45e3c6913c5b87b3ff120dcdc03f6131fa0065027d0ed7ee6190736a74cd401 \ + --hash=sha256:a9b15d491f3ad5d692e11f6b71f7857e7835eb677955c00cc0aefcd0669adaf6 \ + --hash=sha256:ad9413ccdeda48c5afdae7e4fa2192157e991ff761e7ab8fdd8926f40b160cc3 \ + --hash=sha256:b2ab587605f4ba0bf81dc0cb08a41bd1c0a5906bd59243d56bad7668a6fc6c16 \ + --hash=sha256:b62ce867176a75d03a665bad002af8e6d54644fad99a3c70905c543130e39d93 \ + --hash=sha256:c03e868a0b3bc35839ba98e74211ed2b05d2119be4e8a0f224fba9384f1fe02e \ + --hash=sha256:c59d6e989d07460165cc5ad3c61f9fd8f1b4796eacbd81cee78957842b834af4 \ + --hash=sha256:c7eac2ef9b63c79431bc4b25f1cd649d7f061a28808cbc6c47b534bd789ef964 \ + --hash=sha256:c9c3d058ebabb74db66e431095118094d06abf53284d9c81f27300d0e0d8bc7c \ + --hash=sha256:ca74b8dbe6e8e8263c0ffd60277de77dcee6c837a3d0881d8c1ead7268c9e576 \ + --hash=sha256:caaf0640ef5f5517f49bc275eca1406b0ffa6aa184892812030f04c2abf589a0 \ + --hash=sha256:cdf5ce3acdfd1661132f2a9c19cac174758dc2352bfe37d98aa7512c6b7178b3 \ + --hash=sha256:d016c76bdd850f3c626af19b0542c9677ba156e4ee4fccfdd7848803533ef662 \ + --hash=sha256:d01b12eeeb4427d3110de311e1774046ad344f5b1a7403101878976ecd7a10f3 \ + --hash=sha256:d63afe322132c194cf832bfec0dc69a99fb9bb6bbd550f161a49e9e855cc78ff \ + --hash=sha256:da95af8214998d77a98cc14e3a3bd00aa191526343078b530ceb0bd710fb48a5 \ + --hash=sha256:dd398dbc6773384a17fe0d3e7eeb8d1a21c2200473ee6806bb5e6a8e62bb73dd \ + --hash=sha256:de2ea4b5833625383e464549fec1bc395c1bdeeb5f25c4a3a82b5a8c756ec22f \ + --hash=sha256:de55b766c7aa2e2a3092c51e0483d700341182f08e67c63630d5b6f200bb28e5 \ + --hash=sha256:df8b1c11f177bc2313ec4b2d46baec87a5f3e71fc8b45dab2ee7cae86d9aba14 \ + --hash=sha256:e03eab0a8677fa80d646b5ddece1cbeaf556c313dcfac435ba11f107ba117b5d \ + --hash=sha256:e221cf152cff04059d011ee126477f0d9588303eb57e88923578ace7baad17f9 \ + --hash=sha256:e31ae45bc2e29f6b2abd0de1cc3b9d5205aa847cafaecb8af1476a609a2f6eb7 \ + --hash=sha256:edae79245293e15384b51f88b00613ba9f7198016a5948b5dddf4917d4d26382 \ + --hash=sha256:f1e22e8c4419538cb197e4dd60acc919d7696e5ef98ee4da4e01d3f8cfa4cc5a \ + --hash=sha256:f3a2b4222ce6b60e2e8b337bb9596923045681d71e5a082783484d845390938e \ + --hash=sha256:f6a16c31041f09ead72d69f583767292f750d24913dadacf5756b966aacb3f1a \ + --hash=sha256:f75c7ab1f9e4aca5414ed4d8e5c0e303a34f4421f8a0d47a4d019ceff0ab6af4 \ + --hash=sha256:f79fc4fc25f1c8698ff97788206bb3c2598949bfe0fef03d299eb1b5356ada99 \ + --hash=sha256:f7f5baafcc48261359e14bcd6d9bff6d4b28d9103847c9e136694cb0501aef87 \ + --hash=sha256:fc48c783f9c87e60831201f2cce7f3b2e4846bf4d8728eabe54d60700b318a0b + # via trio +h11==0.14.0 \ + --hash=sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d \ + --hash=sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761 + # via wsproto +idna==3.10 \ + --hash=sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9 \ + --hash=sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3 + # via trio +outcome==1.3.0.post0 \ + --hash=sha256:9dcf02e65f2971b80047b377468e72a268e15c0af3cf1238e6ff14f7f91143b8 \ + --hash=sha256:e771c5ce06d1415e356078d3bdd68523f284b4ce5419828922b6871e65eda82b + # via trio +pycparser==2.22 \ + --hash=sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6 \ + --hash=sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc + # via cffi +pysocks==1.7.1 \ + --hash=sha256:08e69f092cc6dbe92a0fdd16eeb9b9ffbc13cadfe5ca4c7bd92ffb078b293299 \ + --hash=sha256:2725bd0a9925919b9b51739eea5f9e2bae91e83288108a9ad338b2e3a4435ee5 \ + --hash=sha256:3f8804571ebe159c380ac6de37643bb4685970655d3bba243530d6558b799aa0 + # via urllib3 +selenium==4.27.1 \ + --hash=sha256:5296c425a75ff1b44d0d5199042b36a6d1ef76c04fb775b97b40be739a9caae2 \ + --hash=sha256:b89b1f62b5cfe8025868556fe82360d6b649d464f75d2655cb966c8f8447ea18 + # via -r requirements.in +sniffio==1.3.1 \ + --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 \ + --hash=sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc + # via trio +sortedcontainers==2.4.0 \ + --hash=sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88 \ + --hash=sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0 + # via trio +trio==0.27.0 \ + --hash=sha256:1dcc95ab1726b2da054afea8fd761af74bad79bd52381b84eae408e983c76831 \ + --hash=sha256:68eabbcf8f457d925df62da780eff15ff5dc68fd6b367e2dde59f7aaf2a0b884 + # via + # selenium + # trio-websocket +trio-websocket==0.11.1 \ + --hash=sha256:18c11793647703c158b1f6e62de638acada927344d534e3c7628eedcb746839f \ + --hash=sha256:520d046b0d030cf970b8b2b2e00c4c2245b3807853ecd44214acd33d74581638 + # via selenium +typing-extensions==4.12.2 \ + --hash=sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d \ + --hash=sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8 + # via selenium +urllib3[socks]==2.2.3 \ + --hash=sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac \ + --hash=sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9 + # via selenium +websocket-client==1.8.0 \ + --hash=sha256:17b44cc997f5c498e809b22cdf2d9c7a9e71c02c8cc2b6c56e7c2d1239bfa526 \ + --hash=sha256:3239df9f44da632f96012472805d40a23281a991027ce11d2f45a6f24ac4c3da + # via selenium +wsproto==1.2.0 \ + --hash=sha256:ad565f26ecb92588a3e43bc3d96164de84cd9902482b130d0ddbaa9664a85065 \ + --hash=sha256:b9acddd652b585d75b20477888c56642fdade28bdfd3579aa24a4d2c037dd736 + # via trio-websocket diff --git a/web/scala/MODULE.bazel b/web/web_scala/MODULE.bazel similarity index 95% rename from web/scala/MODULE.bazel rename to web/web_scala/MODULE.bazel index 3e239144..8b329fae 100644 --- a/web/scala/MODULE.bazel +++ b/web/web_scala/MODULE.bazel @@ -12,6 +12,11 @@ local_path_override( path = "../..", ) +bazel_dep( + name = "bazel_skylib", + version = "1.7.1", +) + ##### Scala dependencies ##### bazel_dep( name = "rules_scala", diff --git a/web/web_scala/scala/BUILD.bazel b/web/web_scala/scala/BUILD.bazel new file mode 100644 index 00000000..71796c11 --- /dev/null +++ b/web/web_scala/scala/BUILD.bazel @@ -0,0 +1,32 @@ +# Copyright 2016 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("@rules_webtesting//web:web.bzl", "web_test_config") + +package( + default_testonly = True, + default_visibility = ["//visibility:public"], +) + +bzl_library( + name = "scala", + srcs = ["scala.bzl"], + deps = [ + "@rules_webtesting//web/internal:wrap_web_test_suite", + # should depend on @io_bazel_rules_scala//scala:scala.bzl + ], +) diff --git a/web/scala/scala.bzl b/web/web_scala/scala/scala.bzl similarity index 100% rename from web/scala/scala.bzl rename to web/web_scala/scala/scala.bzl diff --git a/web/scala/BUILD.bazel b/web/web_scala/scalatests/BUILD.bazel similarity index 96% rename from web/scala/BUILD.bazel rename to web/web_scala/scalatests/BUILD.bazel index 82a352d7..8a97543e 100644 --- a/web/scala/BUILD.bazel +++ b/web/web_scala/scalatests/BUILD.bazel @@ -14,7 +14,7 @@ # ################################################################################ # -load("//:scala.bzl", "scala_web_test_suite") +load("//scala:scala.bzl", "scala_web_test_suite") licenses(["notice"]) # Apache 2.0 diff --git a/web/scala/WebTestTest.scala b/web/web_scala/scalatests/WebTestTest.scala similarity index 100% rename from web/scala/WebTestTest.scala rename to web/web_scala/scalatests/WebTestTest.scala From cd977d28f63f058f523f1a3d03dc00c4988aa57e Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Sat, 15 Mar 2025 02:11:30 +0000 Subject: [PATCH 04/74] Refactor web submodules --- BUILD.bazel | 9 - {web/web_go/go => go/web}/BUILD.bazel | 0 {web/web_go/go => go/web}/go.bzl | 0 go/webdriver/BUILD.bazel | 2 +- go/webtest/BUILD.bazel | 19 +- go/wtl/proxy/BUILD.bazel | 5 +- .../proxy/driverhub/quithandler/BUILD.bazel | 5 +- .../proxy/driverhub/scripttimeout/BUILD.bazel | 5 +- testing/web/BUILD.bazel | 62 ------ testing/web/debugger/BUILD.bazel | 22 --- testing/web/debugger/debugger.py | 179 ------------------ testing/web/webtest.py | 59 ------ testing/web/webtest_test.py | 47 ----- web/BUILD.bazel | 12 -- web/go.bzl | 33 ---- web/internal/executable_name.bzl | 8 +- web/py.bzl | 37 ---- web/web_go/MODULE.bazel | 60 ------ web/web_go/gotests/BUILD.bazel | 0 web/web_python/pythontests/webtest.py | 2 +- web/web_python/pythontests/webtest_test.py | 5 +- web/web_python/requirements.in | 1 + 22 files changed, 28 insertions(+), 544 deletions(-) rename {web/web_go/go => go/web}/BUILD.bazel (100%) rename {web/web_go/go => go/web}/go.bzl (100%) delete mode 100644 testing/web/BUILD.bazel delete mode 100644 testing/web/debugger/BUILD.bazel delete mode 100644 testing/web/debugger/debugger.py delete mode 100644 testing/web/webtest.py delete mode 100644 testing/web/webtest_test.py delete mode 100644 web/go.bzl delete mode 100644 web/py.bzl delete mode 100644 web/web_go/MODULE.bazel delete mode 100644 web/web_go/gotests/BUILD.bazel create mode 100644 web/web_python/requirements.in diff --git a/BUILD.bazel b/BUILD.bazel index af1d9d52..ab52bbb1 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -15,7 +15,6 @@ ################################################################################ # load("@bazel_gazelle//:def.bzl", "gazelle") -load("@python_versions//3.11:defs.bzl", "compile_pip_requirements") licenses(["notice"]) # Apache 2.0 @@ -25,11 +24,3 @@ gazelle( name = "gazelle", prefix = "github.com/bazelbuild/rules_webtesting", ) - -compile_pip_requirements( - name = "requirements", - requirements_in = "requirements.in", - requirements_txt = "requirements_lock.txt", - requirements_windows = "requirements_lock_windows.txt", -) - diff --git a/web/web_go/go/BUILD.bazel b/go/web/BUILD.bazel similarity index 100% rename from web/web_go/go/BUILD.bazel rename to go/web/BUILD.bazel diff --git a/web/web_go/go/go.bzl b/go/web/go.bzl similarity index 100% rename from web/web_go/go/go.bzl rename to go/web/go.bzl diff --git a/go/webdriver/BUILD.bazel b/go/webdriver/BUILD.bazel index 14c71c9e..c73692f1 100644 --- a/go/webdriver/BUILD.bazel +++ b/go/webdriver/BUILD.bazel @@ -14,8 +14,8 @@ # ################################################################################ # -load("//web:go.bzl", "go_web_test_suite") load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("//go/web:go.bzl", "go_web_test_suite") licenses(["notice"]) # Apache 2.0 diff --git a/go/webtest/BUILD.bazel b/go/webtest/BUILD.bazel index 7a268cf7..74974add 100644 --- a/go/webtest/BUILD.bazel +++ b/go/webtest/BUILD.bazel @@ -1,3 +1,5 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,8 +16,7 @@ # ################################################################################ # -load("//web:go.bzl", "go_web_test_suite") -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@rules_webtesting//go/web:go.bzl", "go_web_test_suite") licenses(["notice"]) # Apache 2.0 @@ -25,9 +26,9 @@ go_library( importpath = "github.com/bazelbuild/rules_webtesting/go/webtest", visibility = ["//visibility:public"], deps = [ - "//go/bazel:go_default_library", - "//go/metadata:go_default_library", "@com_github_tebeka_selenium//:go_default_library", + "@rules_webtesting//go/bazel:go_default_library", + "@rules_webtesting//go/metadata:go_default_library", ], ) @@ -38,12 +39,12 @@ go_web_test_suite( "webtest_test.go", ], browsers = [ - "//browsers:chromium-local", - "//browsers:firefox-local", - "//browsers/sauce:chrome-win10", - "//browsers/sauce:chrome-win10-connect", + "@rules_webtesting//browsers:chromium-local", + "@rules_webtesting//browsers:firefox-local", + "@rules_webtesting//browsers/sauce:chrome-win10", + "@rules_webtesting//browsers/sauce:chrome-win10-connect", ], - data = ["//testdata"], + data = ["@rules_webtesting//testdata"], embed = [":go_default_library"], deps = ["@com_github_tebeka_selenium//:go_default_library"], ) diff --git a/go/wtl/proxy/BUILD.bazel b/go/wtl/proxy/BUILD.bazel index bdea0d24..91cc4cad 100644 --- a/go/wtl/proxy/BUILD.bazel +++ b/go/wtl/proxy/BUILD.bazel @@ -1,3 +1,5 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + # Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,8 +16,7 @@ # ################################################################################ # -load("//web:go.bzl", "go_web_test_suite") -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("//go/web:go.bzl", "go_web_test_suite") licenses(["notice"]) # Apache 2.0 diff --git a/go/wtl/proxy/driverhub/quithandler/BUILD.bazel b/go/wtl/proxy/driverhub/quithandler/BUILD.bazel index 66ca5f26..23436758 100644 --- a/go/wtl/proxy/driverhub/quithandler/BUILD.bazel +++ b/go/wtl/proxy/driverhub/quithandler/BUILD.bazel @@ -1,3 +1,5 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,8 +16,7 @@ # ################################################################################ # -load("//web:go.bzl", "go_web_test_suite") -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("//go/web:go.bzl", "go_web_test_suite") licenses(["notice"]) # Apache 2.0 diff --git a/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel b/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel index dfb2e78e..d977f318 100644 --- a/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel +++ b/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel @@ -1,3 +1,5 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,8 +16,7 @@ # ################################################################################ # -load("//web:go.bzl", "go_web_test_suite") -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("//go/web:go.bzl", "go_web_test_suite") licenses(["notice"]) # Apache 2.0 diff --git a/testing/web/BUILD.bazel b/testing/web/BUILD.bazel deleted file mode 100644 index 6c563197..00000000 --- a/testing/web/BUILD.bazel +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright 2016 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -################################################################################ -# -load("//web:py.bzl", "py_web_test_suite") - -licenses(["notice"]) # Apache 2.0 - -py_library( - name = "web", - testonly = True, - srcs = glob( - ["*.py"], - exclude = ["*_test.py"], - ), - visibility = ["//visibility:public"], - deps = [ - "@rules_webtesting_py_deps//selenium", - ], -) - -py_web_test_suite( - name = "webtest_test", - srcs = ["webtest_test.py"], - browsers = [ - "//browsers:chromium-local", - "//browsers:firefox-local", - "//browsers/sauce:chrome-win10", - "//browsers/sauce:chrome-win10-connect", - ], - tags = { - "chromium-local": [ - "native", - ], - "chrome-win10": [ - "exclusive", - "sauce", - "notravis", - ], - "chrome-win10-connect": [ - "exclusive", - "noci", - "sauce", - ], - "firefox-local": [ - "native", - ], - }, - deps = [":web"], -) diff --git a/testing/web/debugger/BUILD.bazel b/testing/web/debugger/BUILD.bazel deleted file mode 100644 index 16cfb1f0..00000000 --- a/testing/web/debugger/BUILD.bazel +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2017 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -################################################################################ -# -licenses(["notice"]) # Apache 2.0 - -py_binary( - name = "debugger", - srcs = glob(["*.py"]), -) diff --git a/testing/web/debugger/debugger.py b/testing/web/debugger/debugger.py deleted file mode 100644 index 41f0fa0e..00000000 --- a/testing/web/debugger/debugger.py +++ /dev/null @@ -1,179 +0,0 @@ -# Copyright 2017 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Web Test Launcher Debugger Front-End.""" - -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -import code -import getpass -import hashlib -import json -import socket -import sys -from six.moves import urllib - - -class Debugger: - """Debugger connects to the WTL debugger and sends and receives messages.""" - - def __init__(self, port, host="localhost"): - self._conn = socket.create_connection(address=(host, port)) - self._file = self._conn.makefile(mode="w") - self._decoder = json.JSONDecoder() - self._next_id = 1 - self._buffer = "" - - def _get_next_id(self): - id = self._next_id - self._next_id = self._next_id + 1 - return id - - def _read_next(self): - while True: - try: - self._buffer = self._buffer.strip() - obj, p = self._decoder.raw_decode(self._buffer) - self._buffer = self._buffer[p:] - return obj - except: - pass - s = self._conn.recv(4096).decode("utf-8") - if s == "": - quit() - self._buffer = self._buffer + s - - def _read_until_waiting(self): - while True: - n = self._read_next() - print(n) - if n["status"] != "running": - return - - def step(self): - """Execute the waiting WebDriver command and stop at the next one.""" - id = self._get_next_id() - json.dump(obj={"id": id, "command": "step"}, fp=self._file) - self._file.flush() - self._read_until_waiting() - - def run(self): - """Execute WebDriver commands until a breakpoint is reached.""" - id = self._get_next_id() - json.dump(obj={"id": id, "command": "continue"}, fp=self._file) - self._file.flush() - self._read_until_waiting() - - def stop(self): - """Quit WTL and the debugger.""" - id = self._get_next_id() - json.dump(obj={"id": id, "command": "stop"}, fp=self._file) - self._file.flush() - quit() - - def set_breakpoint(self, path=None, methods=None, body=None): - """Set a WTL breakpoint. - - Args: - path: string, Go regular expression to compare to WebDriver command paths. - methods: list of strings, a list of HTTP methods ("POST", "GET", etc). - body: string, Go regular expression to compare to body of WebDriver - command. - - Returns: - int, id of the breakpoint (can be used in delete_breakpoint command). - """ - id = self._get_next_id() - - bp = {"id": id} - if path: - bp["path"] = path - if methods: - bp["methods"] = methods - if body: - bp["body"] = body - - json.dump( - obj={ - "id": id, - "command": "set breakpoint", - "breakpoint": bp, - }, - fp=self._file) - self._file.flush() - self._read_until_waiting() - return id - - def delete_breakpoint(self, breakpoint_id): - """Delete a previously set WTL breakpoint. - - Args: - breakpoint_id: int, id of the breakpoint to delete. - """ - id = self._get_next_id() - - json.dump( - obj={ - "id": id, - "command": "delete breakpoint", - "breakpoint": { - "id": breakpoint_id - }, - }, - fp=self._file) - self._file.flush() - self._read_until_waiting() - - -def collect_analytics(): - try: - urllib.request.urlopen( - "http://www.google-analytics.com/collect?v=1&aip=1&tid=UA-52159295-3" - "&t=screenview&cd=start&an=WTL+Debugger&uid=" + - hashlib.md5(getpass.getuser()).hexdigest()).close - except: - # Error collecting usage - pass - - -def main(args): - host = "localhost" - if len(args) == 2: - port = args[1] - elif len(args) == 3: - host = args[1] - port = args[2] - else: - print("Usage %s [host] port") - quit() - - wtl = Debugger(host=host, port=port) - - collect_analytics() - - code.interact( - """ -\033[95m\033[1mPython Interactive Console\033[0m - -Debugger Commands: - wtl.run(): Run test until next WTL breakpoint. - wtl.step(): Execute the current waiting command and break at the next one. - wtl.stop(): Quit WTL and the Debugger. - help(wtl): Additional debugger commands. -""", - local={"wtl": wtl}) - - -if __name__ == "__main__": - main(sys.argv) diff --git a/testing/web/webtest.py b/testing/web/webtest.py deleted file mode 100644 index 5e3fd490..00000000 --- a/testing/web/webtest.py +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright 2016 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Browser provisioning and information API. - -Provision a browser: - from testing.web import webtest - - driver = webtest.new_webdriver_session() - -Provision a browser with capabilities: - capabilities = {"webdriver.logging.profiler.enabled": true} - driver = webtest.new_webdriver_session(capabilities) -""" -import os - -from selenium.webdriver.remote import remote_connection -from selenium.webdriver.remote import webdriver - - -def new_webdriver_session(capabilities=None): - """Provisions a new WebDriver session. - - Args: - capabilities: a dict with the json capabilities desired for this browser - session. - - Returns: - A new WebDriver connected to a browser defined by the web test - environment. - """ - capabilities = capabilities or {} - address = os.environ['WEB_TEST_WEBDRIVER_SERVER'].rstrip('/') - - # Set the timeout for WebDriver http requests so that the socket default - # timeout is not used. - remote_connection.RemoteConnection.set_timeout(450) - - return webdriver.WebDriver(address, desired_capabilities=capabilities) - - -def http_address(): - """Return the HTTP address of WTL.""" - return os.environ['WEB_TEST_HTTP_SERVER'] - - -def https_address(): - """Return the HTTPS address of WTL.""" - return os.environ['WEB_TEST_HTTPS_SERVER'] diff --git a/testing/web/webtest_test.py b/testing/web/webtest_test.py deleted file mode 100644 index bcaa4a1d..00000000 --- a/testing/web/webtest_test.py +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright 2016 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Tests for testing.web.webtest.""" - -import unittest - -from testing.web import webtest - - -class BrowserTest(unittest.TestCase): - - def testBrowserProvisioningNoCaps(self): - driver = webtest.new_webdriver_session() - - try: - driver.get(webtest.http_address() + "/healthz") - self.assertTrue(driver.current_url) - finally: - driver.quit() - - def testBrowserProvisioningWithCaps(self): - capabilities = { - "acceptInsecureCerts": False, - "pageLoadStrategy": "normal", - } - driver = webtest.new_webdriver_session(capabilities) - - try: - driver.get(webtest.http_address() + "/healthz") - self.assertTrue(driver.current_url) - finally: - driver.quit() - - -if __name__ == "__main__": - unittest.main() diff --git a/web/BUILD.bazel b/web/BUILD.bazel index 8a09f3b2..71a372e4 100644 --- a/web/BUILD.bazel +++ b/web/BUILD.bazel @@ -30,18 +30,6 @@ web_test_config( visibility = ["//visibility:public"], ) -bzl_library( - name = "java", - srcs = ["java.bzl"], - deps = ["//web/internal:wrap_web_test_suite"], -) - -bzl_library( - name = "py", - srcs = ["py.bzl"], - deps = ["//web/internal:wrap_web_test_suite"], -) - bzl_library( name = "web", srcs = ["web.bzl"], diff --git a/web/go.bzl b/web/go.bzl deleted file mode 100644 index 1168176e..00000000 --- a/web/go.bzl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2016 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Web Test rules for Go.""" - -load("//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") -load("//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") -load("@io_bazel_rules_go//go:def.bzl", "go_test") - -def go_web_test_suite(name, go_test_tags = DEFAULT_WRAPPED_TEST_TAGS, **kwargs): - """Defines a test_suite of web_test targets that wrap a go_test target. - - Args: - name: The base name of the test. - go_test_tags: A list of test tag strings to use for the go_test target. - **kwargs: Arguments for wrapped_web_test_suite - """ - wrap_web_test_suite( - name = name, - rule = go_test, - wrapped_test_tags = go_test_tags, - **kwargs - ) diff --git a/web/internal/executable_name.bzl b/web/internal/executable_name.bzl index b1038686..18f3177d 100644 --- a/web/internal/executable_name.bzl +++ b/web/internal/executable_name.bzl @@ -22,8 +22,8 @@ def get_platform_executable_name(): release output, where the binaries can be referenced using the known file names. """ return select({ - "//common/conditions:linux_x64": "main_linux_x64", - "//common/conditions:macos_x64": "main_darwin_x64", - "//common/conditions:macos_arm64": "main_darwin_arm64", - "//common/conditions:windows_x64": "main_windows_x64.exe", + "@rules_webtesting//common/conditions:linux_x64": "main_linux_x64", + "@rules_webtesting//common/conditions:macos_x64": "main_darwin_x64", + "@rules_webtesting//common/conditions:macos_arm64": "main_darwin_arm64", + "@rules_webtesting//common/conditions:windows_x64": "main_windows_x64.exe", }) diff --git a/web/py.bzl b/web/py.bzl deleted file mode 100644 index 104e7c41..00000000 --- a/web/py.bzl +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2016 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Web Test rules for Python.""" - -load("//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") -load("//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") - -def py_web_test_suite(name, py_test_tags = DEFAULT_WRAPPED_TEST_TAGS, main = None, **kwargs): - """Defines a test_suite of web_test targets that wrap a py_test target. - - Args: - name: The base name of the test. - py_test_tags: A list of test tag strings to use for the py_test target. - main: Optional; default computed from name. - **kwargs: Arguments for wrapped_web_test_suite - """ - if main == None: - main = name + ".py" - - wrap_web_test_suite( - name = name, - main = main, - rule = native.py_test, - wrapped_test_tags = py_test_tags, - **kwargs - ) diff --git a/web/web_go/MODULE.bazel b/web/web_go/MODULE.bazel deleted file mode 100644 index 7bfa121f..00000000 --- a/web/web_go/MODULE.bazel +++ /dev/null @@ -1,60 +0,0 @@ -module( - name = "rules_webtesting_web_go", - version = "0.4.0", -) - -bazel_dep( - name = "rules_webtesting", -) - -local_path_override( - module_name = "rules_webtesting", - path = "../..", -) - -bazel_dep( - name = "bazel_skylib", - version = "1.7.1", -) - -bazel_dep( - name = "rules_jvm_external", - version = "6.6", -) - -maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") - -maven.install( - artifacts = [ - "com.google.guava:guava:33.2.1-jre", - "org.seleniumhq.selenium:selenium-remote-driver:4.27.0", - "org.seleniumhq.selenium:selenium-api:4.27.0", - "junit:junit:4.13.2", - ], -) - -use_repo(maven, "maven") - -##### Go dependencies ##### -bazel_dep( - name = "rules_go", - version = "0.51.0-rc1", - repo_name = "io_bazel_rules_go", -) - -bazel_dep( - name = "gazelle", - version = "0.40.0", - repo_name = "bazel_gazelle", -) - -go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") - -go_deps.from_file(go_mod = "//:go.mod") - -# All *direct* Go dependencies of the module have to be listed explicitly. -use_repo( - go_deps, - "com_github_gorilla_mux", - "com_github_tebeka_selenium", -) diff --git a/web/web_go/gotests/BUILD.bazel b/web/web_go/gotests/BUILD.bazel deleted file mode 100644 index e69de29b..00000000 diff --git a/web/web_python/pythontests/webtest.py b/web/web_python/pythontests/webtest.py index 5e3fd490..71458b69 100644 --- a/web/web_python/pythontests/webtest.py +++ b/web/web_python/pythontests/webtest.py @@ -14,7 +14,7 @@ """Browser provisioning and information API. Provision a browser: - from testing.web import webtest + from pythontests import webtest driver = webtest.new_webdriver_session() diff --git a/web/web_python/pythontests/webtest_test.py b/web/web_python/pythontests/webtest_test.py index bcaa4a1d..a140e1ba 100644 --- a/web/web_python/pythontests/webtest_test.py +++ b/web/web_python/pythontests/webtest_test.py @@ -11,12 +11,11 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -"""Tests for testing.web.webtest.""" +"""Tests for web.web_python.pythontests.""" import unittest -from testing.web import webtest - +from pythontests import webtest class BrowserTest(unittest.TestCase): diff --git a/web/web_python/requirements.in b/web/web_python/requirements.in new file mode 100644 index 00000000..72e055f5 --- /dev/null +++ b/web/web_python/requirements.in @@ -0,0 +1 @@ +selenium==4.27.1 From e3dbc073227a29466efd2b4448bac6cf63f1fe87 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Mon, 17 Mar 2025 05:57:30 +0000 Subject: [PATCH 05/74] Refactor more --- requirements.in | 1 - 1 file changed, 1 deletion(-) delete mode 100644 requirements.in diff --git a/requirements.in b/requirements.in deleted file mode 100644 index 72e055f5..00000000 --- a/requirements.in +++ /dev/null @@ -1 +0,0 @@ -selenium==4.27.1 From 921f528f5de23f5cada147be93c954d1da33c10c Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Mon, 17 Mar 2025 06:49:36 +0000 Subject: [PATCH 06/74] More polish --- .bazelci/presubmit.yml | 18 ++++++++++++++++++ web_java/BUILD.bazel | 0 {web/web_java => web_java}/MODULE.bazel | 2 +- {web/web_java => web_java}/java/BUILD.bazel | 0 {web/web_java => web_java}/java/java.bzl | 0 .../com/google/testing/web/BUILD.bazel | 0 .../com/google/testing/web/WebTestTest.java | 0 {web/web_python => web_python}/BUILD.bazel | 2 +- {web/web_python => web_python}/MODULE.bazel | 4 ++-- .../python/BUILD.bazel | 0 {web/web_python => web_python}/python/py.bzl | 0 .../pythontests/BUILD.bazel | 2 +- .../pythontests/webtest.py | 0 .../pythontests/webtest_test.py | 0 {web/web_python => web_python}/requirements.in | 0 .../requirements_lock.txt | 0 .../requirements_lock_windows.txt | 0 {web/web_scala => web_scala}/MODULE.bazel | 2 +- {web/web_scala => web_scala}/scala/BUILD.bazel | 0 {web/web_scala => web_scala}/scala/scala.bzl | 0 .../scalatests/BUILD.bazel | 2 +- .../scalatests/WebTestTest.scala | 0 22 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 web_java/BUILD.bazel rename {web/web_java => web_java}/MODULE.bazel (97%) rename {web/web_java => web_java}/java/BUILD.bazel (100%) rename {web/web_java => web_java}/java/java.bzl (100%) rename {web/web_java => web_java}/javatests/com/google/testing/web/BUILD.bazel (100%) rename {web/web_java => web_java}/javatests/com/google/testing/web/WebTestTest.java (100%) rename {web/web_python => web_python}/BUILD.bazel (97%) rename {web/web_python => web_python}/MODULE.bazel (92%) rename {web/web_python => web_python}/python/BUILD.bazel (100%) rename {web/web_python => web_python}/python/py.bzl (100%) rename {web/web_python => web_python}/pythontests/BUILD.bazel (95%) rename {web/web_python => web_python}/pythontests/webtest.py (100%) rename {web/web_python => web_python}/pythontests/webtest_test.py (100%) rename {web/web_python => web_python}/requirements.in (100%) rename {web/web_python => web_python}/requirements_lock.txt (100%) rename {web/web_python => web_python}/requirements_lock_windows.txt (100%) rename {web/web_scala => web_scala}/MODULE.bazel (98%) rename {web/web_scala => web_scala}/scala/BUILD.bazel (100%) rename {web/web_scala => web_scala}/scala/scala.bzl (100%) rename {web/web_scala => web_scala}/scalatests/BUILD.bazel (93%) rename {web/web_scala => web_scala}/scalatests/WebTestTest.scala (100%) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 0d2235f2..baf47b51 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -3,24 +3,42 @@ platforms: ubuntu2204: build_targets: - "//..." + - "-//web_java:all" + - "-//web_python:all" + - "-//web_scala:all" test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" test_targets: - "//..." + - "-//web_java:all" + - "-//web_python:all" + - "-//web_scala:all" macos: build_targets: - "//..." + - "-//web_java:all" + - "-//web_python:all" + - "-//web_scala:all" test_flags: - "--test_tag_filters=-noci,-sauce,-external,-native" test_targets: - "//..." + - "-//web_java:all" + - "-//web_python:all" + - "-//web_scala:all" windows: build_flags: - "--enable_runfiles" build_targets: - "//..." + - "-//web_java:all" + - "-//web_python:all" + - "-//web_scala:all" test_flags: - "--test_tag_filters=-noci,-sauce,-external,-native" - "--enable_runfiles" test_targets: - "//..." + - "-//web_java:all" + - "-//web_python:all" + - "-//web_scala:all" diff --git a/web_java/BUILD.bazel b/web_java/BUILD.bazel new file mode 100644 index 00000000..e69de29b diff --git a/web/web_java/MODULE.bazel b/web_java/MODULE.bazel similarity index 97% rename from web/web_java/MODULE.bazel rename to web_java/MODULE.bazel index fc33e8cf..10a0a24d 100644 --- a/web/web_java/MODULE.bazel +++ b/web_java/MODULE.bazel @@ -9,7 +9,7 @@ bazel_dep( local_path_override( module_name = "rules_webtesting", - path = "../..", + path = "..", ) bazel_dep( diff --git a/web/web_java/java/BUILD.bazel b/web_java/java/BUILD.bazel similarity index 100% rename from web/web_java/java/BUILD.bazel rename to web_java/java/BUILD.bazel diff --git a/web/web_java/java/java.bzl b/web_java/java/java.bzl similarity index 100% rename from web/web_java/java/java.bzl rename to web_java/java/java.bzl diff --git a/web/web_java/javatests/com/google/testing/web/BUILD.bazel b/web_java/javatests/com/google/testing/web/BUILD.bazel similarity index 100% rename from web/web_java/javatests/com/google/testing/web/BUILD.bazel rename to web_java/javatests/com/google/testing/web/BUILD.bazel diff --git a/web/web_java/javatests/com/google/testing/web/WebTestTest.java b/web_java/javatests/com/google/testing/web/WebTestTest.java similarity index 100% rename from web/web_java/javatests/com/google/testing/web/WebTestTest.java rename to web_java/javatests/com/google/testing/web/WebTestTest.java diff --git a/web/web_python/BUILD.bazel b/web_python/BUILD.bazel similarity index 97% rename from web/web_python/BUILD.bazel rename to web_python/BUILD.bazel index b5ad4b8c..d3b5d5c1 100644 --- a/web/web_python/BUILD.bazel +++ b/web_python/BUILD.bazel @@ -1,4 +1,4 @@ -# Copyright 2016 Google Inc. +# Copyright 2024 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/web/web_python/MODULE.bazel b/web_python/MODULE.bazel similarity index 92% rename from web/web_python/MODULE.bazel rename to web_python/MODULE.bazel index 94bf78de..d3d2e2b7 100644 --- a/web/web_python/MODULE.bazel +++ b/web_python/MODULE.bazel @@ -1,5 +1,5 @@ module( - name = "rules_webtesting_web_java", + name = "rules_webtesting_web_python", version = "0.4.0", ) @@ -14,7 +14,7 @@ bazel_dep( local_path_override( module_name = "rules_webtesting", - path = "../..", + path = "..", ) bazel_dep( diff --git a/web/web_python/python/BUILD.bazel b/web_python/python/BUILD.bazel similarity index 100% rename from web/web_python/python/BUILD.bazel rename to web_python/python/BUILD.bazel diff --git a/web/web_python/python/py.bzl b/web_python/python/py.bzl similarity index 100% rename from web/web_python/python/py.bzl rename to web_python/python/py.bzl diff --git a/web/web_python/pythontests/BUILD.bazel b/web_python/pythontests/BUILD.bazel similarity index 95% rename from web/web_python/pythontests/BUILD.bazel rename to web_python/pythontests/BUILD.bazel index 1efe201a..8caf87eb 100644 --- a/web/web_python/pythontests/BUILD.bazel +++ b/web_python/pythontests/BUILD.bazel @@ -14,7 +14,7 @@ # ################################################################################ # -load("//python:py.bzl", "py_web_test_suite") +load("@rules_webtesting_web_python//python:py.bzl", "py_web_test_suite") licenses(["notice"]) # Apache 2.0 diff --git a/web/web_python/pythontests/webtest.py b/web_python/pythontests/webtest.py similarity index 100% rename from web/web_python/pythontests/webtest.py rename to web_python/pythontests/webtest.py diff --git a/web/web_python/pythontests/webtest_test.py b/web_python/pythontests/webtest_test.py similarity index 100% rename from web/web_python/pythontests/webtest_test.py rename to web_python/pythontests/webtest_test.py diff --git a/web/web_python/requirements.in b/web_python/requirements.in similarity index 100% rename from web/web_python/requirements.in rename to web_python/requirements.in diff --git a/web/web_python/requirements_lock.txt b/web_python/requirements_lock.txt similarity index 100% rename from web/web_python/requirements_lock.txt rename to web_python/requirements_lock.txt diff --git a/web/web_python/requirements_lock_windows.txt b/web_python/requirements_lock_windows.txt similarity index 100% rename from web/web_python/requirements_lock_windows.txt rename to web_python/requirements_lock_windows.txt diff --git a/web/web_scala/MODULE.bazel b/web_scala/MODULE.bazel similarity index 98% rename from web/web_scala/MODULE.bazel rename to web_scala/MODULE.bazel index 8b329fae..84695e1e 100644 --- a/web/web_scala/MODULE.bazel +++ b/web_scala/MODULE.bazel @@ -9,7 +9,7 @@ bazel_dep( local_path_override( module_name = "rules_webtesting", - path = "../..", + path = "..", ) bazel_dep( diff --git a/web/web_scala/scala/BUILD.bazel b/web_scala/scala/BUILD.bazel similarity index 100% rename from web/web_scala/scala/BUILD.bazel rename to web_scala/scala/BUILD.bazel diff --git a/web/web_scala/scala/scala.bzl b/web_scala/scala/scala.bzl similarity index 100% rename from web/web_scala/scala/scala.bzl rename to web_scala/scala/scala.bzl diff --git a/web/web_scala/scalatests/BUILD.bazel b/web_scala/scalatests/BUILD.bazel similarity index 93% rename from web/web_scala/scalatests/BUILD.bazel rename to web_scala/scalatests/BUILD.bazel index 8a97543e..8ea9f570 100644 --- a/web/web_scala/scalatests/BUILD.bazel +++ b/web_scala/scalatests/BUILD.bazel @@ -14,7 +14,7 @@ # ################################################################################ # -load("//scala:scala.bzl", "scala_web_test_suite") +load("@rules_webtesting_web_scala//scala:scala.bzl", "scala_web_test_suite") licenses(["notice"]) # Apache 2.0 diff --git a/web/web_scala/scalatests/WebTestTest.scala b/web_scala/scalatests/WebTestTest.scala similarity index 100% rename from web/web_scala/scalatests/WebTestTest.scala rename to web_scala/scalatests/WebTestTest.scala From 1c4c8b6154f5775b8e7fc0da32a620746944800c Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Mon, 17 Mar 2025 06:59:51 +0000 Subject: [PATCH 07/74] Fix presubmit --- .bazelci/presubmit.yml | 18 ------------------ .bazelignore | 3 +++ 2 files changed, 3 insertions(+), 18 deletions(-) create mode 100644 .bazelignore diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index baf47b51..0d2235f2 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -3,42 +3,24 @@ platforms: ubuntu2204: build_targets: - "//..." - - "-//web_java:all" - - "-//web_python:all" - - "-//web_scala:all" test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" test_targets: - "//..." - - "-//web_java:all" - - "-//web_python:all" - - "-//web_scala:all" macos: build_targets: - "//..." - - "-//web_java:all" - - "-//web_python:all" - - "-//web_scala:all" test_flags: - "--test_tag_filters=-noci,-sauce,-external,-native" test_targets: - "//..." - - "-//web_java:all" - - "-//web_python:all" - - "-//web_scala:all" windows: build_flags: - "--enable_runfiles" build_targets: - "//..." - - "-//web_java:all" - - "-//web_python:all" - - "-//web_scala:all" test_flags: - "--test_tag_filters=-noci,-sauce,-external,-native" - "--enable_runfiles" test_targets: - "//..." - - "-//web_java:all" - - "-//web_python:all" - - "-//web_scala:all" diff --git a/.bazelignore b/.bazelignore new file mode 100644 index 00000000..5c42c0c5 --- /dev/null +++ b/.bazelignore @@ -0,0 +1,3 @@ +web_java +web_python +web_scala From ac5737d42a710eb264ca7d79d8e639178885113a Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Mon, 17 Mar 2025 18:30:06 +0000 Subject: [PATCH 08/74] Add web modules build script --- MODULE.bazel | 26 -------------------------- build_web_modules.sh | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 26 deletions(-) create mode 100644 build_web_modules.sh diff --git a/MODULE.bazel b/MODULE.bazel index af0ec64a..e2e077b6 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -56,32 +56,6 @@ maven.install( use_repo(maven, "maven") -##### Python dependencies ##### -#bazel_dep( -# name = "rules_python", -# version = "1.0.0", -#) -# -#python = use_extension("@rules_python//python/extensions:python.bzl", "python") -# -#python.toolchain( -# is_default = True, -# python_version = "3.11", -#) -# -#use_repo(python, "python_3_11", "python_versions") -# -#pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") -# -#pip.parse( -# hub_name = "rules_webtesting_py_deps", -# python_version = "3.11", -# requirements_lock = "//:requirements_lock.txt", -# requirements_windows = "requirements_lock_windows.txt", -#) -# -#use_repo(pip, "rules_webtesting_py_deps") - ##### Browsers dependencies ##### browser_repositories = use_extension("//web:extension.bzl", "browser_repositories_extension") diff --git a/build_web_modules.sh b/build_web_modules.sh new file mode 100644 index 00000000..d134651b --- /dev/null +++ b/build_web_modules.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# Copyright 2019 Google Inc. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -ex + +# Build and test web java and related tests in web_java module +(cd web_java && bazel test ... --java_runtime_version=17) + +# Build and test web python and related tests in web_python module +(cd web_python && bazel test ...) + +# Build and test web scala and related tests in web_scala module +(cd web_scala && bazel test ...) From e20cb797cedc0d48de4df52c700aa5dfac5885ea Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Mon, 17 Mar 2025 22:23:04 +0000 Subject: [PATCH 09/74] Modify bazel CI --- .bazelci/presubmit.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 0d2235f2..f33cd97b 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -24,3 +24,12 @@ platforms: - "--enable_runfiles" test_targets: - "//..." +tasks: + web_scala_ubuntu2004: + name: "Scala workspace for web" + platform: ubuntu2004 + test_flags: + - "--test_tag_filters=-noci,-external,-native,-sauce" + build_targets: ["//..."] + test_targets: ["//..."] + working_directory: web_scala From 1d290c0ef0ce96d4bae4b894e71b05044df63315 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Mon, 17 Mar 2025 23:02:44 +0000 Subject: [PATCH 10/74] More polish to bazel ci --- .bazelci/presubmit.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index f33cd97b..fad45f62 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -26,10 +26,26 @@ platforms: - "//..." tasks: web_scala_ubuntu2004: - name: "Scala workspace for web" + name: "Scala workspace for web in ubuntun" platform: ubuntu2004 test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" build_targets: ["//..."] test_targets: ["//..."] working_directory: web_scala + web_scala_macos: + name: "Scala workspace for web in macos" + platform: macos + test_flags: + - "--test_tag_filters=-noci,-external,-native,-sauce" + build_targets: [ "//..." ] + test_targets: [ "//..." ] + working_directory: web_scala + web_scala_windows: + name: "Scala workspace for web in windows" + platform: windows + test_flags: + - "--test_tag_filters=-noci,-external,-native,-sauce" + build_targets: [ "//..." ] + test_targets: [ "//..." ] + working_directory: web_scala \ No newline at end of file From 4e64e912cb93ba72ac9ce83861504f1cf16559b9 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Mon, 17 Mar 2025 23:55:19 +0000 Subject: [PATCH 11/74] Revert auto formatting --- .bazelci/presubmit.yml | 52 ++++++++++++++++++++++++++++++-- MODULE.bazel | 31 ++++--------------- go/web/BUILD.bazel | 4 +-- go/webtest/BUILD.bazel | 6 ++-- web/internal/executable_name.bzl | 8 ++--- 5 files changed, 65 insertions(+), 36 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index fad45f62..eb5e6fdf 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -26,7 +26,7 @@ platforms: - "//..." tasks: web_scala_ubuntu2004: - name: "Scala workspace for web in ubuntun" + name: "Scala workspace for web in ubuntu" platform: ubuntu2004 test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" @@ -48,4 +48,52 @@ tasks: - "--test_tag_filters=-noci,-external,-native,-sauce" build_targets: [ "//..." ] test_targets: [ "//..." ] - working_directory: web_scala \ No newline at end of file + working_directory: web_scala + web_java_ubuntu2004: + name: "Java workspace for web in ubuntu" + platform: ubuntu2004 + test_flags: + - "--test_tag_filters=-noci,-external,-native,-sauce" + build_targets: [ "//..." ] + test_targets: [ "//..." ] + working_directory: web_java + web_java_macos: + name: "Java workspace for web in macos" + platform: macos + test_flags: + - "--test_tag_filters=-noci,-external,-native,-sauce" + build_targets: [ "//..." ] + test_targets: [ "//..." ] + working_directory: web_java + web_java_windows: + name: "Java workspace for web in windows" + platform: windows + test_flags: + - "--test_tag_filters=-noci,-external,-native,-sauce" + build_targets: [ "//..." ] + test_targets: [ "//..." ] + working_directory: web_java + web_python_ubuntu2004: + name: "Python workspace for web in ubuntu" + platform: ubuntu2004 + test_flags: + - "--test_tag_filters=-noci,-external,-native,-sauce" + build_targets: [ "//..." ] + test_targets: [ "//..." ] + working_directory: web_python + web_python_macos: + name: "Python workspace for web in macos" + platform: macos + test_flags: + - "--test_tag_filters=-noci,-external,-native,-sauce" + build_targets: [ "//..." ] + test_targets: [ "//..." ] + working_directory: web_python + web_python_windows: + name: "Python workspace for web in windows" + platform: windows + test_flags: + - "--test_tag_filters=-noci,-external,-native,-sauce" + build_targets: [ "//..." ] + test_targets: [ "//..." ] + working_directory: web_python diff --git a/MODULE.bazel b/MODULE.bazel index e2e077b6..f74b3686 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -3,28 +3,14 @@ module( version = "0.4.0", ) -bazel_dep( - name = "bazel_skylib", - version = "1.7.1", -) +bazel_dep(name = "bazel_skylib", version = "1.7.1") -bazel_dep( - name = "platforms", - version = "0.0.10", -) +bazel_dep(name = "platforms", version = "0.0.10") ##### Go dependencies ##### -bazel_dep( - name = "rules_go", - version = "0.51.0-rc1", - repo_name = "io_bazel_rules_go", -) +bazel_dep(name = "rules_go", version = "0.51.0-rc1", repo_name = "io_bazel_rules_go") -bazel_dep( - name = "gazelle", - version = "0.40.0", - repo_name = "bazel_gazelle", -) +bazel_dep(name = "gazelle", version = "0.40.0", repo_name = "bazel_gazelle") go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") @@ -38,10 +24,7 @@ use_repo( ) ##### Java dependencies ##### -bazel_dep( - name = "rules_jvm_external", - version = "6.6", -) +bazel_dep(name = "rules_jvm_external",version = "6.6") maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") @@ -58,9 +41,7 @@ use_repo(maven, "maven") ##### Browsers dependencies ##### browser_repositories = use_extension("//web:extension.bzl", "browser_repositories_extension") - browser_repositories.install(version = "0.3.4") - use_repo( browser_repositories, "com_saucelabs_sauce_connect_linux_x64", @@ -71,7 +52,7 @@ use_repo( "org_chromium_chromedriver_macos_x64", "org_chromium_chromedriver_windows_x64", "org_chromium_chromium_linux_x64", - "org_chromium_chromium_macos_arm64", # Only available in 0.3.3 + "org_chromium_chromium_macos_arm64", # Only available in 0.3.3 "org_chromium_chromium_macos_x64", "org_chromium_chromium_windows_x64", "org_mozilla_firefox_linux_x64", diff --git a/go/web/BUILD.bazel b/go/web/BUILD.bazel index de41e9e4..b3e67c60 100644 --- a/go/web/BUILD.bazel +++ b/go/web/BUILD.bazel @@ -15,7 +15,7 @@ ################################################################################ # load("@bazel_skylib//:bzl_library.bzl", "bzl_library") -load("@rules_webtesting//web:web.bzl", "web_test_config") +load("//web:web.bzl", "web_test_config") package( default_testonly = True, @@ -26,7 +26,7 @@ bzl_library( name = "go", srcs = ["go.bzl"], deps = [ - "@rules_webtesting//web/internal:wrap_web_test_suite", + "//web/internal:wrap_web_test_suite", # should depend on @io_bazel_rules_go//go:def.bzl ], ) diff --git a/go/webtest/BUILD.bazel b/go/webtest/BUILD.bazel index 74974add..645f5f86 100644 --- a/go/webtest/BUILD.bazel +++ b/go/webtest/BUILD.bazel @@ -16,7 +16,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") # ################################################################################ # -load("@rules_webtesting//go/web:go.bzl", "go_web_test_suite") +load("//go/web:go.bzl", "go_web_test_suite") licenses(["notice"]) # Apache 2.0 @@ -27,8 +27,8 @@ go_library( visibility = ["//visibility:public"], deps = [ "@com_github_tebeka_selenium//:go_default_library", - "@rules_webtesting//go/bazel:go_default_library", - "@rules_webtesting//go/metadata:go_default_library", + "//go/bazel:go_default_library", + "//go/metadata:go_default_library", ], ) diff --git a/web/internal/executable_name.bzl b/web/internal/executable_name.bzl index 18f3177d..b1038686 100644 --- a/web/internal/executable_name.bzl +++ b/web/internal/executable_name.bzl @@ -22,8 +22,8 @@ def get_platform_executable_name(): release output, where the binaries can be referenced using the known file names. """ return select({ - "@rules_webtesting//common/conditions:linux_x64": "main_linux_x64", - "@rules_webtesting//common/conditions:macos_x64": "main_darwin_x64", - "@rules_webtesting//common/conditions:macos_arm64": "main_darwin_arm64", - "@rules_webtesting//common/conditions:windows_x64": "main_windows_x64.exe", + "//common/conditions:linux_x64": "main_linux_x64", + "//common/conditions:macos_x64": "main_darwin_x64", + "//common/conditions:macos_arm64": "main_darwin_arm64", + "//common/conditions:windows_x64": "main_windows_x64.exe", }) From de27d5211e87a1f2cd3b9269a16585e05fcf2358 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Tue, 18 Mar 2025 00:25:41 +0000 Subject: [PATCH 12/74] More polish --- go/web/go.bzl | 4 ++-- go/webdriver/BUILD.bazel | 2 +- go/webtest/BUILD.bazel | 15 +++++++-------- go/wtl/proxy/BUILD.bazel | 3 +-- go/wtl/proxy/driverhub/quithandler/BUILD.bazel | 3 +-- go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel | 3 +-- rules_webtesting.iml | 12 ------------ web/BUILD.bazel | 3 +-- web/internal/BUILD.bazel | 2 +- web_java/java/BUILD.bazel | 2 +- web_java/java/java.bzl | 7 +++---- web_python/python/BUILD.bazel | 2 +- web_python/pythontests/BUILD.bazel | 2 +- 13 files changed, 21 insertions(+), 39 deletions(-) delete mode 100644 rules_webtesting.iml diff --git a/go/web/go.bzl b/go/web/go.bzl index 183226b8..839b6bba 100644 --- a/go/web/go.bzl +++ b/go/web/go.bzl @@ -13,9 +13,9 @@ # limitations under the License. """Web Test rules for Go.""" +load("//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") +load("/web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") load("@io_bazel_rules_go//go:def.bzl", "go_test") -load("@rules_webtesting//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") -load("@rules_webtesting//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") def go_web_test_suite(name, go_test_tags = DEFAULT_WRAPPED_TEST_TAGS, **kwargs): """Defines a test_suite of web_test targets that wrap a go_test target. diff --git a/go/webdriver/BUILD.bazel b/go/webdriver/BUILD.bazel index c73692f1..ce446db1 100644 --- a/go/webdriver/BUILD.bazel +++ b/go/webdriver/BUILD.bazel @@ -14,8 +14,8 @@ # ################################################################################ # -load("@io_bazel_rules_go//go:def.bzl", "go_library") load("//go/web:go.bzl", "go_web_test_suite") +load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/go/webtest/BUILD.bazel b/go/webtest/BUILD.bazel index 645f5f86..b4b5d474 100644 --- a/go/webtest/BUILD.bazel +++ b/go/webtest/BUILD.bazel @@ -1,5 +1,3 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,6 +15,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") ################################################################################ # load("//go/web:go.bzl", "go_web_test_suite") +load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 @@ -26,9 +25,9 @@ go_library( importpath = "github.com/bazelbuild/rules_webtesting/go/webtest", visibility = ["//visibility:public"], deps = [ - "@com_github_tebeka_selenium//:go_default_library", "//go/bazel:go_default_library", "//go/metadata:go_default_library", + "@com_github_tebeka_selenium//:go_default_library", ], ) @@ -39,12 +38,12 @@ go_web_test_suite( "webtest_test.go", ], browsers = [ - "@rules_webtesting//browsers:chromium-local", - "@rules_webtesting//browsers:firefox-local", - "@rules_webtesting//browsers/sauce:chrome-win10", - "@rules_webtesting//browsers/sauce:chrome-win10-connect", + "//browsers:chromium-local", + "//browsers:firefox-local", + "//browsers/sauce:chrome-win10", + "//browsers/sauce:chrome-win10-connect", ], - data = ["@rules_webtesting//testdata"], + data = ["//testdata"], embed = [":go_default_library"], deps = ["@com_github_tebeka_selenium//:go_default_library"], ) diff --git a/go/wtl/proxy/BUILD.bazel b/go/wtl/proxy/BUILD.bazel index 91cc4cad..d6d36f54 100644 --- a/go/wtl/proxy/BUILD.bazel +++ b/go/wtl/proxy/BUILD.bazel @@ -1,5 +1,3 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - # Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,6 +15,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") ################################################################################ # load("//go/web:go.bzl", "go_web_test_suite") +load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/go/wtl/proxy/driverhub/quithandler/BUILD.bazel b/go/wtl/proxy/driverhub/quithandler/BUILD.bazel index 23436758..e1e1b0a9 100644 --- a/go/wtl/proxy/driverhub/quithandler/BUILD.bazel +++ b/go/wtl/proxy/driverhub/quithandler/BUILD.bazel @@ -1,5 +1,3 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,6 +15,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") ################################################################################ # load("//go/web:go.bzl", "go_web_test_suite") +load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel b/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel index d977f318..6908eebe 100644 --- a/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel +++ b/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel @@ -1,5 +1,3 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,6 +15,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") ################################################################################ # load("//go/web:go.bzl", "go_web_test_suite") +load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/rules_webtesting.iml b/rules_webtesting.iml deleted file mode 100644 index b3840569..00000000 --- a/rules_webtesting.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/web/BUILD.bazel b/web/BUILD.bazel index 71a372e4..3c2c08ec 100644 --- a/web/BUILD.bazel +++ b/web/BUILD.bazel @@ -1,5 +1,3 @@ -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") - # Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,6 +15,7 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") ################################################################################ # load(":web.bzl", "web_test_config") +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") package( default_testonly = True, diff --git a/web/internal/BUILD.bazel b/web/internal/BUILD.bazel index 582fef40..d92ea949 100644 --- a/web/internal/BUILD.bazel +++ b/web/internal/BUILD.bazel @@ -18,7 +18,7 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") package( default_testonly = True, - default_visibility = ["//visibility:public"], + default_visibility = ["//web:__subpackages__"], ) licenses(["notice"]) # Apache 2.0 diff --git a/web_java/java/BUILD.bazel b/web_java/java/BUILD.bazel index 67a7da87..bee0207f 100644 --- a/web_java/java/BUILD.bazel +++ b/web_java/java/BUILD.bazel @@ -1,4 +1,4 @@ -# Copyright 2016 Google Inc. +# Copyright 2025 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/web_java/java/java.bzl b/web_java/java/java.bzl index b6476ea5..2ac9af52 100644 --- a/web_java/java/java.bzl +++ b/web_java/java/java.bzl @@ -13,8 +13,8 @@ # limitations under the License. """Web Test rules for Java.""" -load("@rules_webtesting//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") -load("@rules_webtesting//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") +load("//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") +load("//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") def java_web_test_suite(name, java_test_tags = DEFAULT_WRAPPED_TEST_TAGS, test_class = None, **kwargs): """Defines a test_suite of web_test targets that wrap a java_test target. @@ -29,8 +29,7 @@ def java_web_test_suite(name, java_test_tags = DEFAULT_WRAPPED_TEST_TAGS, test_c test_package = native.package_name().replace("javatests/", "") test_package = test_package.replace("/", ".") test_class = test_package + "." + name - print("test class is" + str(test_class) + "," + "the native class is" + str(native.package_name())) - + wrap_web_test_suite( name = name, rule = native.java_test, diff --git a/web_python/python/BUILD.bazel b/web_python/python/BUILD.bazel index 0c5a2bc8..f17000e8 100644 --- a/web_python/python/BUILD.bazel +++ b/web_python/python/BUILD.bazel @@ -1,4 +1,4 @@ -# Copyright 2024 Google Inc. +# Copyright 2025 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/web_python/pythontests/BUILD.bazel b/web_python/pythontests/BUILD.bazel index 8caf87eb..dda92c09 100644 --- a/web_python/pythontests/BUILD.bazel +++ b/web_python/pythontests/BUILD.bazel @@ -1,4 +1,4 @@ -# Copyright 2016 Google Inc. +# Copyright 2025 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From 583083de6f52a4a0527a25c21d1c402c74797c14 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Tue, 18 Mar 2025 00:42:19 +0000 Subject: [PATCH 13/74] More polish --- go/web/go.bzl | 2 +- web/internal/BUILD.bazel | 2 +- web_java/java/java.bzl | 6 +++--- web_java/javatests/com/google/testing/web/BUILD.bazel | 2 +- web_java/javatests/com/google/testing/web/WebTestTest.java | 2 +- web_python/BUILD.bazel | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/go/web/go.bzl b/go/web/go.bzl index 839b6bba..1168176e 100644 --- a/go/web/go.bzl +++ b/go/web/go.bzl @@ -14,7 +14,7 @@ """Web Test rules for Go.""" load("//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") -load("/web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") +load("//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") load("@io_bazel_rules_go//go:def.bzl", "go_test") def go_web_test_suite(name, go_test_tags = DEFAULT_WRAPPED_TEST_TAGS, **kwargs): diff --git a/web/internal/BUILD.bazel b/web/internal/BUILD.bazel index d92ea949..582fef40 100644 --- a/web/internal/BUILD.bazel +++ b/web/internal/BUILD.bazel @@ -18,7 +18,7 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") package( default_testonly = True, - default_visibility = ["//web:__subpackages__"], + default_visibility = ["//visibility:public"], ) licenses(["notice"]) # Apache 2.0 diff --git a/web_java/java/java.bzl b/web_java/java/java.bzl index 2ac9af52..ecb84912 100644 --- a/web_java/java/java.bzl +++ b/web_java/java/java.bzl @@ -13,8 +13,8 @@ # limitations under the License. """Web Test rules for Java.""" -load("//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") -load("//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") +load("@rules_webtesting//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") +load("@rules_webtesting//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") def java_web_test_suite(name, java_test_tags = DEFAULT_WRAPPED_TEST_TAGS, test_class = None, **kwargs): """Defines a test_suite of web_test targets that wrap a java_test target. @@ -29,7 +29,7 @@ def java_web_test_suite(name, java_test_tags = DEFAULT_WRAPPED_TEST_TAGS, test_c test_package = native.package_name().replace("javatests/", "") test_package = test_package.replace("/", ".") test_class = test_package + "." + name - + wrap_web_test_suite( name = name, rule = native.java_test, diff --git a/web_java/javatests/com/google/testing/web/BUILD.bazel b/web_java/javatests/com/google/testing/web/BUILD.bazel index d72c3919..78dece81 100644 --- a/web_java/javatests/com/google/testing/web/BUILD.bazel +++ b/web_java/javatests/com/google/testing/web/BUILD.bazel @@ -1,4 +1,4 @@ -# Copyright 2016 Google Inc. +# Copyright 2025 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/web_java/javatests/com/google/testing/web/WebTestTest.java b/web_java/javatests/com/google/testing/web/WebTestTest.java index cf924af7..922a1cb0 100644 --- a/web_java/javatests/com/google/testing/web/WebTestTest.java +++ b/web_java/javatests/com/google/testing/web/WebTestTest.java @@ -31,4 +31,4 @@ public void newWebDriverSession() { driver.get(wt.HTTPAddress().resolve("/healthz").toString()); driver.quit(); } -} \ No newline at end of file +} diff --git a/web_python/BUILD.bazel b/web_python/BUILD.bazel index d3b5d5c1..f619eeeb 100644 --- a/web_python/BUILD.bazel +++ b/web_python/BUILD.bazel @@ -1,4 +1,4 @@ -# Copyright 2024 Google Inc. +# Copyright 2025 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From b0497da84e10f77c1ed1d0c0f3a80a81e1540bbf Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Tue, 18 Mar 2025 04:27:16 +0000 Subject: [PATCH 14/74] More polish --- .bazelci/presubmit.yml | 30 +++++++++---------- .bazelignore | 6 ++-- .../BUILD.bazel | 0 .../MODULE.bazel | 2 +- .../web}/BUILD.bazel | 0 .../web}/java.bzl | 0 .../com/google/testing/web/BUILD.bazel | 2 +- .../com/google/testing/web/WebTestTest.java | 0 .../BUILD.bazel | 0 .../MODULE.bazel | 2 +- .../requirements.in | 0 .../requirements_lock.txt | 0 .../requirements_lock_windows.txt | 0 .../web}/BUILD.bazel | 0 .../web}/py.bzl | 2 +- .../webtests}/BUILD.bazel | 2 +- .../webtests}/webtest.py | 0 .../webtests}/webtest_test.py | 2 +- .../MODULE.bazel | 2 +- .../scalatests/BUILD.bazel | 4 +-- .../scalatests/WebTestTest.scala | 0 .../web}/BUILD.bazel | 2 +- .../web}/scala.bzl | 2 +- 23 files changed, 29 insertions(+), 29 deletions(-) rename {web_java => rules_web_testing_java}/BUILD.bazel (100%) rename {web_java => rules_web_testing_java}/MODULE.bazel (93%) rename {web_java/java => rules_web_testing_java/web}/BUILD.bazel (100%) rename {web_java/java => rules_web_testing_java/web}/java.bzl (100%) rename {web_java/javatests => rules_web_testing_java/webtests}/com/google/testing/web/BUILD.bazel (96%) rename {web_java/javatests => rules_web_testing_java/webtests}/com/google/testing/web/WebTestTest.java (100%) rename {web_python => rules_web_testing_python}/BUILD.bazel (100%) rename {web_python => rules_web_testing_python}/MODULE.bazel (95%) rename {web_python => rules_web_testing_python}/requirements.in (100%) rename {web_python => rules_web_testing_python}/requirements_lock.txt (100%) rename {web_python => rules_web_testing_python}/requirements_lock_windows.txt (100%) rename {web_python/python => rules_web_testing_python/web}/BUILD.bazel (100%) rename {web_python/python => rules_web_testing_python/web}/py.bzl (97%) rename {web_python/pythontests => rules_web_testing_python/webtests}/BUILD.bazel (95%) rename {web_python/pythontests => rules_web_testing_python/webtests}/webtest.py (100%) rename {web_python/pythontests => rules_web_testing_python/webtests}/webtest_test.py (97%) rename {web_scala => rules_web_testing_scala}/MODULE.bazel (96%) rename {web_scala => rules_web_testing_scala}/scalatests/BUILD.bazel (91%) rename {web_scala => rules_web_testing_scala}/scalatests/WebTestTest.scala (100%) rename {web_scala/scala => rules_web_testing_scala/web}/BUILD.bazel (97%) rename {web_scala/scala => rules_web_testing_scala/web}/scala.bzl (97%) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index eb5e6fdf..fc149787 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -33,46 +33,46 @@ tasks: build_targets: ["//..."] test_targets: ["//..."] working_directory: web_scala - web_scala_macos: + rules_web_testing_scala_macos: name: "Scala workspace for web in macos" platform: macos test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" build_targets: [ "//..." ] test_targets: [ "//..." ] - working_directory: web_scala - web_scala_windows: + working_directory: rules_web_testing_scala + rules_web_testing_scala_windows: name: "Scala workspace for web in windows" platform: windows test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" build_targets: [ "//..." ] test_targets: [ "//..." ] - working_directory: web_scala - web_java_ubuntu2004: + working_directory: rules_web_testing_scala + rules_web_testing_java_ubuntu2004: name: "Java workspace for web in ubuntu" platform: ubuntu2004 test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" build_targets: [ "//..." ] test_targets: [ "//..." ] - working_directory: web_java - web_java_macos: + working_directory: rules_web_testing_java + rules_web_testing_java_macos: name: "Java workspace for web in macos" platform: macos test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" build_targets: [ "//..." ] test_targets: [ "//..." ] - working_directory: web_java - web_java_windows: + working_directory: rules_web_testing_java + rules_web_testing_java_windows: name: "Java workspace for web in windows" platform: windows test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" build_targets: [ "//..." ] test_targets: [ "//..." ] - working_directory: web_java + working_directory: rules_web_testing_java web_python_ubuntu2004: name: "Python workspace for web in ubuntu" platform: ubuntu2004 @@ -80,20 +80,20 @@ tasks: - "--test_tag_filters=-noci,-external,-native,-sauce" build_targets: [ "//..." ] test_targets: [ "//..." ] - working_directory: web_python - web_python_macos: + working_directory: rules_web_testing_python + rules_web_testing_python_macos: name: "Python workspace for web in macos" platform: macos test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" build_targets: [ "//..." ] test_targets: [ "//..." ] - working_directory: web_python - web_python_windows: + working_directory: rules_web_testing_python + rules_web_testing_python_windows: name: "Python workspace for web in windows" platform: windows test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" build_targets: [ "//..." ] test_targets: [ "//..." ] - working_directory: web_python + working_directory: rules_web_testing_python diff --git a/.bazelignore b/.bazelignore index 5c42c0c5..a51c320b 100644 --- a/.bazelignore +++ b/.bazelignore @@ -1,3 +1,3 @@ -web_java -web_python -web_scala +rules_web_testing_java +rules_web_testing_python +rules_web_testing_scala diff --git a/web_java/BUILD.bazel b/rules_web_testing_java/BUILD.bazel similarity index 100% rename from web_java/BUILD.bazel rename to rules_web_testing_java/BUILD.bazel diff --git a/web_java/MODULE.bazel b/rules_web_testing_java/MODULE.bazel similarity index 93% rename from web_java/MODULE.bazel rename to rules_web_testing_java/MODULE.bazel index 10a0a24d..8e7f6b39 100644 --- a/web_java/MODULE.bazel +++ b/rules_web_testing_java/MODULE.bazel @@ -1,5 +1,5 @@ module( - name = "rules_webtesting_web_java", + name = "rules_web_testing_java", version = "0.4.0", ) diff --git a/web_java/java/BUILD.bazel b/rules_web_testing_java/web/BUILD.bazel similarity index 100% rename from web_java/java/BUILD.bazel rename to rules_web_testing_java/web/BUILD.bazel diff --git a/web_java/java/java.bzl b/rules_web_testing_java/web/java.bzl similarity index 100% rename from web_java/java/java.bzl rename to rules_web_testing_java/web/java.bzl diff --git a/web_java/javatests/com/google/testing/web/BUILD.bazel b/rules_web_testing_java/webtests/com/google/testing/web/BUILD.bazel similarity index 96% rename from web_java/javatests/com/google/testing/web/BUILD.bazel rename to rules_web_testing_java/webtests/com/google/testing/web/BUILD.bazel index 78dece81..e5bdb8ec 100644 --- a/web_java/javatests/com/google/testing/web/BUILD.bazel +++ b/rules_web_testing_java/webtests/com/google/testing/web/BUILD.bazel @@ -14,7 +14,7 @@ # ################################################################################ # -load("//java:java.bzl", "java_web_test_suite") +load("//web:java.bzl", "java_web_test_suite") licenses(["notice"]) # Apache 2.0 diff --git a/web_java/javatests/com/google/testing/web/WebTestTest.java b/rules_web_testing_java/webtests/com/google/testing/web/WebTestTest.java similarity index 100% rename from web_java/javatests/com/google/testing/web/WebTestTest.java rename to rules_web_testing_java/webtests/com/google/testing/web/WebTestTest.java diff --git a/web_python/BUILD.bazel b/rules_web_testing_python/BUILD.bazel similarity index 100% rename from web_python/BUILD.bazel rename to rules_web_testing_python/BUILD.bazel diff --git a/web_python/MODULE.bazel b/rules_web_testing_python/MODULE.bazel similarity index 95% rename from web_python/MODULE.bazel rename to rules_web_testing_python/MODULE.bazel index d3d2e2b7..28f33dad 100644 --- a/web_python/MODULE.bazel +++ b/rules_web_testing_python/MODULE.bazel @@ -1,5 +1,5 @@ module( - name = "rules_webtesting_web_python", + name = "rules_web_testing_python", version = "0.4.0", ) diff --git a/web_python/requirements.in b/rules_web_testing_python/requirements.in similarity index 100% rename from web_python/requirements.in rename to rules_web_testing_python/requirements.in diff --git a/web_python/requirements_lock.txt b/rules_web_testing_python/requirements_lock.txt similarity index 100% rename from web_python/requirements_lock.txt rename to rules_web_testing_python/requirements_lock.txt diff --git a/web_python/requirements_lock_windows.txt b/rules_web_testing_python/requirements_lock_windows.txt similarity index 100% rename from web_python/requirements_lock_windows.txt rename to rules_web_testing_python/requirements_lock_windows.txt diff --git a/web_python/python/BUILD.bazel b/rules_web_testing_python/web/BUILD.bazel similarity index 100% rename from web_python/python/BUILD.bazel rename to rules_web_testing_python/web/BUILD.bazel diff --git a/web_python/python/py.bzl b/rules_web_testing_python/web/py.bzl similarity index 97% rename from web_python/python/py.bzl rename to rules_web_testing_python/web/py.bzl index 3a641736..db58bce8 100644 --- a/web_python/python/py.bzl +++ b/rules_web_testing_python/web/py.bzl @@ -1,4 +1,4 @@ -# Copyright 2016 Google Inc. +# Copyright 2025 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/web_python/pythontests/BUILD.bazel b/rules_web_testing_python/webtests/BUILD.bazel similarity index 95% rename from web_python/pythontests/BUILD.bazel rename to rules_web_testing_python/webtests/BUILD.bazel index dda92c09..6f344535 100644 --- a/web_python/pythontests/BUILD.bazel +++ b/rules_web_testing_python/webtests/BUILD.bazel @@ -14,7 +14,7 @@ # ################################################################################ # -load("@rules_webtesting_web_python//python:py.bzl", "py_web_test_suite") +load("//web:py.bzl", "py_web_test_suite") licenses(["notice"]) # Apache 2.0 diff --git a/web_python/pythontests/webtest.py b/rules_web_testing_python/webtests/webtest.py similarity index 100% rename from web_python/pythontests/webtest.py rename to rules_web_testing_python/webtests/webtest.py diff --git a/web_python/pythontests/webtest_test.py b/rules_web_testing_python/webtests/webtest_test.py similarity index 97% rename from web_python/pythontests/webtest_test.py rename to rules_web_testing_python/webtests/webtest_test.py index a140e1ba..f1faa763 100644 --- a/web_python/pythontests/webtest_test.py +++ b/rules_web_testing_python/webtests/webtest_test.py @@ -15,7 +15,7 @@ import unittest -from pythontests import webtest +from webtests import webtest class BrowserTest(unittest.TestCase): diff --git a/web_scala/MODULE.bazel b/rules_web_testing_scala/MODULE.bazel similarity index 96% rename from web_scala/MODULE.bazel rename to rules_web_testing_scala/MODULE.bazel index 84695e1e..3168de5c 100644 --- a/web_scala/MODULE.bazel +++ b/rules_web_testing_scala/MODULE.bazel @@ -1,5 +1,5 @@ module( - name = "rules_webtesting_web_scala", + name = "rules_web_testing_scala", version = "0.4.0", ) diff --git a/web_scala/scalatests/BUILD.bazel b/rules_web_testing_scala/scalatests/BUILD.bazel similarity index 91% rename from web_scala/scalatests/BUILD.bazel rename to rules_web_testing_scala/scalatests/BUILD.bazel index 8ea9f570..5c0208f6 100644 --- a/web_scala/scalatests/BUILD.bazel +++ b/rules_web_testing_scala/scalatests/BUILD.bazel @@ -1,4 +1,4 @@ -# Copyright 2018 Google Inc. +# Copyright 2025 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ # ################################################################################ # -load("@rules_webtesting_web_scala//scala:scala.bzl", "scala_web_test_suite") +load("//web:scala.bzl", "scala_web_test_suite") licenses(["notice"]) # Apache 2.0 diff --git a/web_scala/scalatests/WebTestTest.scala b/rules_web_testing_scala/scalatests/WebTestTest.scala similarity index 100% rename from web_scala/scalatests/WebTestTest.scala rename to rules_web_testing_scala/scalatests/WebTestTest.scala diff --git a/web_scala/scala/BUILD.bazel b/rules_web_testing_scala/web/BUILD.bazel similarity index 97% rename from web_scala/scala/BUILD.bazel rename to rules_web_testing_scala/web/BUILD.bazel index 71796c11..ad48c48b 100644 --- a/web_scala/scala/BUILD.bazel +++ b/rules_web_testing_scala/web/BUILD.bazel @@ -1,4 +1,4 @@ -# Copyright 2016 Google Inc. +# Copyright 2025 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/web_scala/scala/scala.bzl b/rules_web_testing_scala/web/scala.bzl similarity index 97% rename from web_scala/scala/scala.bzl rename to rules_web_testing_scala/web/scala.bzl index b78ec7e7..870d2f38 100644 --- a/web_scala/scala/scala.bzl +++ b/rules_web_testing_scala/web/scala.bzl @@ -1,4 +1,4 @@ -# Copyright 2016 Google Inc. +# Copyright 2025 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From 74ffa27084fe3d95ec7fe5987d7e71dfdc60cce6 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Tue, 18 Mar 2025 04:41:13 +0000 Subject: [PATCH 15/74] More polish --- .../webtests/com/google/testing/web/WebTestTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rules_web_testing_java/webtests/com/google/testing/web/WebTestTest.java b/rules_web_testing_java/webtests/com/google/testing/web/WebTestTest.java index 922a1cb0..354b073f 100644 --- a/rules_web_testing_java/webtests/com/google/testing/web/WebTestTest.java +++ b/rules_web_testing_java/webtests/com/google/testing/web/WebTestTest.java @@ -14,12 +14,13 @@ // // ////////////////////////////////////////////////////////////////////////////// // -package com.google.testing.web; +package webtests.com.google.testing.web; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import org.openqa.selenium.WebDriver; +import com.google.testing.web.WebTest; @RunWith(JUnit4.class) public class WebTestTest { From cc04d192f16c54d2f648c06ad823bffe15d028d0 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Tue, 18 Mar 2025 22:06:59 +0000 Subject: [PATCH 16/74] Modularize rules_webtesting --- .bazelci/presubmit.yml | 36 ++-- .bazelignore | 6 +- .../requirements_lock.txt | 71 ------- .../requirements_lock_windows.txt | 144 -------------- .../BUILD.bazel | 0 .../MODULE.bazel | 0 .../com/google/testing/web/BUILD.bazel | 2 +- .../com/google/testing/web/WebTestTest.java | 2 +- .../web/BUILD.bazel | 0 .../web/java.bzl | 0 .../BUILD.bazel | 2 +- .../MODULE.bazel | 0 .../requirements.in | 0 .../requirements_lock.txt | 0 .../requirements_lock_windows.txt | 0 .../testing/web}/BUILD.bazel | 2 +- web_testing_python/testing/web/debugger/BUILD | 22 +++ .../testing/web/debugger/debugger.py | 179 ++++++++++++++++++ .../testing/web}/webtest.py | 2 +- .../testing/web}/webtest_test.py | 4 +- .../web/BUILD.bazel | 0 .../web/py.bzl | 0 .../MODULE.bazel | 0 .../scalatests/BUILD.bazel | 2 +- .../scalatests/WebTestTest.scala | 0 .../web/BUILD.bazel | 0 .../web/scala.bzl | 0 27 files changed, 230 insertions(+), 244 deletions(-) delete mode 100644 rules_web_testing_python/requirements_lock.txt delete mode 100644 rules_web_testing_python/requirements_lock_windows.txt rename {rules_web_testing_java => web_testing_java}/BUILD.bazel (100%) rename {rules_web_testing_java => web_testing_java}/MODULE.bazel (100%) rename {rules_web_testing_java/webtests => web_testing_java/javatests}/com/google/testing/web/BUILD.bazel (97%) rename {rules_web_testing_java/webtests => web_testing_java/javatests}/com/google/testing/web/WebTestTest.java (96%) rename {rules_web_testing_java => web_testing_java}/web/BUILD.bazel (100%) rename {rules_web_testing_java => web_testing_java}/web/java.bzl (100%) rename {rules_web_testing_python => web_testing_python}/BUILD.bazel (97%) rename {rules_web_testing_python => web_testing_python}/MODULE.bazel (100%) rename {rules_web_testing_python => web_testing_python}/requirements.in (100%) rename requirements_lock.txt => web_testing_python/requirements_lock.txt (100%) rename requirements_lock_windows.txt => web_testing_python/requirements_lock_windows.txt (100%) rename {rules_web_testing_python/webtests => web_testing_python/testing/web}/BUILD.bazel (98%) create mode 100644 web_testing_python/testing/web/debugger/BUILD create mode 100644 web_testing_python/testing/web/debugger/debugger.py rename {rules_web_testing_python/webtests => web_testing_python/testing/web}/webtest.py (98%) rename {rules_web_testing_python/webtests => web_testing_python/testing/web}/webtest_test.py (94%) rename {rules_web_testing_python => web_testing_python}/web/BUILD.bazel (100%) rename {rules_web_testing_python => web_testing_python}/web/py.bzl (100%) rename {rules_web_testing_scala => web_testing_scala}/MODULE.bazel (100%) rename {rules_web_testing_scala => web_testing_scala}/scalatests/BUILD.bazel (97%) rename {rules_web_testing_scala => web_testing_scala}/scalatests/WebTestTest.scala (100%) rename {rules_web_testing_scala => web_testing_scala}/web/BUILD.bazel (100%) rename {rules_web_testing_scala => web_testing_scala}/web/scala.bzl (100%) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index fc149787..7f7f5b7c 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -25,75 +25,75 @@ platforms: test_targets: - "//..." tasks: - web_scala_ubuntu2004: + web_testing_scala_ubuntu2004: name: "Scala workspace for web in ubuntu" platform: ubuntu2004 test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" build_targets: ["//..."] test_targets: ["//..."] - working_directory: web_scala - rules_web_testing_scala_macos: + working_directory: web_testing_scala + web_testing_scala_macos: name: "Scala workspace for web in macos" platform: macos test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" build_targets: [ "//..." ] test_targets: [ "//..." ] - working_directory: rules_web_testing_scala - rules_web_testing_scala_windows: + working_directory: web_testing_scala + web_testing_scala_windows: name: "Scala workspace for web in windows" platform: windows test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" build_targets: [ "//..." ] test_targets: [ "//..." ] - working_directory: rules_web_testing_scala - rules_web_testing_java_ubuntu2004: + working_directory: web_testing_scala + web_testing_java_ubuntu2004: name: "Java workspace for web in ubuntu" platform: ubuntu2004 test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" build_targets: [ "//..." ] test_targets: [ "//..." ] - working_directory: rules_web_testing_java - rules_web_testing_java_macos: + working_directory: web_testing_java + web_testing_java_macos: name: "Java workspace for web in macos" platform: macos test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" build_targets: [ "//..." ] test_targets: [ "//..." ] - working_directory: rules_web_testing_java - rules_web_testing_java_windows: + working_directory: web_testing_java + web_testing_java_windows: name: "Java workspace for web in windows" platform: windows test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" build_targets: [ "//..." ] test_targets: [ "//..." ] - working_directory: rules_web_testing_java - web_python_ubuntu2004: + working_directory: web_testing_java + web_testing_python_ubuntu2004: name: "Python workspace for web in ubuntu" platform: ubuntu2004 test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" build_targets: [ "//..." ] test_targets: [ "//..." ] - working_directory: rules_web_testing_python - rules_web_testing_python_macos: + working_directory: web_testing_python + web_testing_python_macos: name: "Python workspace for web in macos" platform: macos test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" build_targets: [ "//..." ] test_targets: [ "//..." ] - working_directory: rules_web_testing_python - rules_web_testing_python_windows: + working_directory: web_testing_python + web_testing_python_windows: name: "Python workspace for web in windows" platform: windows test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" build_targets: [ "//..." ] test_targets: [ "//..." ] - working_directory: rules_web_testing_python + working_directory: web_testing_python diff --git a/.bazelignore b/.bazelignore index a51c320b..bdf56a88 100644 --- a/.bazelignore +++ b/.bazelignore @@ -1,3 +1,3 @@ -rules_web_testing_java -rules_web_testing_python -rules_web_testing_scala +web_testing_java +web_testing_python +web_testing_scala diff --git a/rules_web_testing_python/requirements_lock.txt b/rules_web_testing_python/requirements_lock.txt deleted file mode 100644 index 423b3ab0..00000000 --- a/rules_web_testing_python/requirements_lock.txt +++ /dev/null @@ -1,71 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.11 -# by the following command: -# -# bazel run //:requirements.update -# -attrs==24.2.0 \ - --hash=sha256:5cfb1b9148b5b086569baec03f20d7b6bf3bcacc9a42bebf87ffaaca362f6346 \ - --hash=sha256:81921eb96de3191c8258c199618104dd27ac608d9366f5e35d011eae1867ede2 - # via - # outcome - # trio -certifi==2024.8.30 \ - --hash=sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8 \ - --hash=sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9 - # via selenium -h11==0.14.0 \ - --hash=sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d \ - --hash=sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761 - # via wsproto -idna==3.10 \ - --hash=sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9 \ - --hash=sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3 - # via trio -outcome==1.3.0.post0 \ - --hash=sha256:9dcf02e65f2971b80047b377468e72a268e15c0af3cf1238e6ff14f7f91143b8 \ - --hash=sha256:e771c5ce06d1415e356078d3bdd68523f284b4ce5419828922b6871e65eda82b - # via trio -pysocks==1.7.1 \ - --hash=sha256:08e69f092cc6dbe92a0fdd16eeb9b9ffbc13cadfe5ca4c7bd92ffb078b293299 \ - --hash=sha256:2725bd0a9925919b9b51739eea5f9e2bae91e83288108a9ad338b2e3a4435ee5 \ - --hash=sha256:3f8804571ebe159c380ac6de37643bb4685970655d3bba243530d6558b799aa0 - # via urllib3 -selenium==4.27.1 \ - --hash=sha256:5296c425a75ff1b44d0d5199042b36a6d1ef76c04fb775b97b40be739a9caae2 \ - --hash=sha256:b89b1f62b5cfe8025868556fe82360d6b649d464f75d2655cb966c8f8447ea18 - # via -r requirements.in -sniffio==1.3.1 \ - --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 \ - --hash=sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc - # via trio -sortedcontainers==2.4.0 \ - --hash=sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88 \ - --hash=sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0 - # via trio -trio==0.27.0 \ - --hash=sha256:1dcc95ab1726b2da054afea8fd761af74bad79bd52381b84eae408e983c76831 \ - --hash=sha256:68eabbcf8f457d925df62da780eff15ff5dc68fd6b367e2dde59f7aaf2a0b884 - # via - # selenium - # trio-websocket -trio-websocket==0.11.1 \ - --hash=sha256:18c11793647703c158b1f6e62de638acada927344d534e3c7628eedcb746839f \ - --hash=sha256:520d046b0d030cf970b8b2b2e00c4c2245b3807853ecd44214acd33d74581638 - # via selenium -typing-extensions==4.12.2 \ - --hash=sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d \ - --hash=sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8 - # via selenium -urllib3[socks]==2.2.3 \ - --hash=sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac \ - --hash=sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9 - # via selenium -websocket-client==1.8.0 \ - --hash=sha256:17b44cc997f5c498e809b22cdf2d9c7a9e71c02c8cc2b6c56e7c2d1239bfa526 \ - --hash=sha256:3239df9f44da632f96012472805d40a23281a991027ce11d2f45a6f24ac4c3da - # via selenium -wsproto==1.2.0 \ - --hash=sha256:ad565f26ecb92588a3e43bc3d96164de84cd9902482b130d0ddbaa9664a85065 \ - --hash=sha256:b9acddd652b585d75b20477888c56642fdade28bdfd3579aa24a4d2c037dd736 - # via trio-websocket diff --git a/rules_web_testing_python/requirements_lock_windows.txt b/rules_web_testing_python/requirements_lock_windows.txt deleted file mode 100644 index d94eee74..00000000 --- a/rules_web_testing_python/requirements_lock_windows.txt +++ /dev/null @@ -1,144 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.11 -# by the following command: -# -# bazel run //:requirements.update -# -attrs==24.2.0 \ - --hash=sha256:5cfb1b9148b5b086569baec03f20d7b6bf3bcacc9a42bebf87ffaaca362f6346 \ - --hash=sha256:81921eb96de3191c8258c199618104dd27ac608d9366f5e35d011eae1867ede2 - # via - # outcome - # trio -certifi==2024.8.30 \ - --hash=sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8 \ - --hash=sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9 - # via selenium -cffi==1.17.1 \ - --hash=sha256:045d61c734659cc045141be4bae381a41d89b741f795af1dd018bfb532fd0df8 \ - --hash=sha256:0984a4925a435b1da406122d4d7968dd861c1385afe3b45ba82b750f229811e2 \ - --hash=sha256:0e2b1fac190ae3ebfe37b979cc1ce69c81f4e4fe5746bb401dca63a9062cdaf1 \ - --hash=sha256:0f048dcf80db46f0098ccac01132761580d28e28bc0f78ae0d58048063317e15 \ - --hash=sha256:1257bdabf294dceb59f5e70c64a3e2f462c30c7ad68092d01bbbfb1c16b1ba36 \ - --hash=sha256:1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824 \ - --hash=sha256:1d599671f396c4723d016dbddb72fe8e0397082b0a77a4fab8028923bec050e8 \ - --hash=sha256:28b16024becceed8c6dfbc75629e27788d8a3f9030691a1dbf9821a128b22c36 \ - --hash=sha256:2bb1a08b8008b281856e5971307cc386a8e9c5b625ac297e853d36da6efe9c17 \ - --hash=sha256:30c5e0cb5ae493c04c8b42916e52ca38079f1b235c2f8ae5f4527b963c401caf \ - --hash=sha256:31000ec67d4221a71bd3f67df918b1f88f676f1c3b535a7eb473255fdc0b83fc \ - --hash=sha256:386c8bf53c502fff58903061338ce4f4950cbdcb23e2902d86c0f722b786bbe3 \ - --hash=sha256:3edc8d958eb099c634dace3c7e16560ae474aa3803a5df240542b305d14e14ed \ - --hash=sha256:45398b671ac6d70e67da8e4224a065cec6a93541bb7aebe1b198a61b58c7b702 \ - --hash=sha256:46bf43160c1a35f7ec506d254e5c890f3c03648a4dbac12d624e4490a7046cd1 \ - --hash=sha256:4ceb10419a9adf4460ea14cfd6bc43d08701f0835e979bf821052f1805850fe8 \ - --hash=sha256:51392eae71afec0d0c8fb1a53b204dbb3bcabcb3c9b807eedf3e1e6ccf2de903 \ - --hash=sha256:5da5719280082ac6bd9aa7becb3938dc9f9cbd57fac7d2871717b1feb0902ab6 \ - --hash=sha256:610faea79c43e44c71e1ec53a554553fa22321b65fae24889706c0a84d4ad86d \ - --hash=sha256:636062ea65bd0195bc012fea9321aca499c0504409f413dc88af450b57ffd03b \ - --hash=sha256:6883e737d7d9e4899a8a695e00ec36bd4e5e4f18fabe0aca0efe0a4b44cdb13e \ - --hash=sha256:6b8b4a92e1c65048ff98cfe1f735ef8f1ceb72e3d5f0c25fdb12087a23da22be \ - --hash=sha256:6f17be4345073b0a7b8ea599688f692ac3ef23ce28e5df79c04de519dbc4912c \ - --hash=sha256:706510fe141c86a69c8ddc029c7910003a17353970cff3b904ff0686a5927683 \ - --hash=sha256:72e72408cad3d5419375fc87d289076ee319835bdfa2caad331e377589aebba9 \ - --hash=sha256:733e99bc2df47476e3848417c5a4540522f234dfd4ef3ab7fafdf555b082ec0c \ - --hash=sha256:7596d6620d3fa590f677e9ee430df2958d2d6d6de2feeae5b20e82c00b76fbf8 \ - --hash=sha256:78122be759c3f8a014ce010908ae03364d00a1f81ab5c7f4a7a5120607ea56e1 \ - --hash=sha256:805b4371bf7197c329fcb3ead37e710d1bca9da5d583f5073b799d5c5bd1eee4 \ - --hash=sha256:85a950a4ac9c359340d5963966e3e0a94a676bd6245a4b55bc43949eee26a655 \ - --hash=sha256:8f2cdc858323644ab277e9bb925ad72ae0e67f69e804f4898c070998d50b1a67 \ - --hash=sha256:9755e4345d1ec879e3849e62222a18c7174d65a6a92d5b346b1863912168b595 \ - --hash=sha256:98e3969bcff97cae1b2def8ba499ea3d6f31ddfdb7635374834cf89a1a08ecf0 \ - --hash=sha256:a08d7e755f8ed21095a310a693525137cfe756ce62d066e53f502a83dc550f65 \ - --hash=sha256:a1ed2dd2972641495a3ec98445e09766f077aee98a1c896dcb4ad0d303628e41 \ - --hash=sha256:a24ed04c8ffd54b0729c07cee15a81d964e6fee0e3d4d342a27b020d22959dc6 \ - --hash=sha256:a45e3c6913c5b87b3ff120dcdc03f6131fa0065027d0ed7ee6190736a74cd401 \ - --hash=sha256:a9b15d491f3ad5d692e11f6b71f7857e7835eb677955c00cc0aefcd0669adaf6 \ - --hash=sha256:ad9413ccdeda48c5afdae7e4fa2192157e991ff761e7ab8fdd8926f40b160cc3 \ - --hash=sha256:b2ab587605f4ba0bf81dc0cb08a41bd1c0a5906bd59243d56bad7668a6fc6c16 \ - --hash=sha256:b62ce867176a75d03a665bad002af8e6d54644fad99a3c70905c543130e39d93 \ - --hash=sha256:c03e868a0b3bc35839ba98e74211ed2b05d2119be4e8a0f224fba9384f1fe02e \ - --hash=sha256:c59d6e989d07460165cc5ad3c61f9fd8f1b4796eacbd81cee78957842b834af4 \ - --hash=sha256:c7eac2ef9b63c79431bc4b25f1cd649d7f061a28808cbc6c47b534bd789ef964 \ - --hash=sha256:c9c3d058ebabb74db66e431095118094d06abf53284d9c81f27300d0e0d8bc7c \ - --hash=sha256:ca74b8dbe6e8e8263c0ffd60277de77dcee6c837a3d0881d8c1ead7268c9e576 \ - --hash=sha256:caaf0640ef5f5517f49bc275eca1406b0ffa6aa184892812030f04c2abf589a0 \ - --hash=sha256:cdf5ce3acdfd1661132f2a9c19cac174758dc2352bfe37d98aa7512c6b7178b3 \ - --hash=sha256:d016c76bdd850f3c626af19b0542c9677ba156e4ee4fccfdd7848803533ef662 \ - --hash=sha256:d01b12eeeb4427d3110de311e1774046ad344f5b1a7403101878976ecd7a10f3 \ - --hash=sha256:d63afe322132c194cf832bfec0dc69a99fb9bb6bbd550f161a49e9e855cc78ff \ - --hash=sha256:da95af8214998d77a98cc14e3a3bd00aa191526343078b530ceb0bd710fb48a5 \ - --hash=sha256:dd398dbc6773384a17fe0d3e7eeb8d1a21c2200473ee6806bb5e6a8e62bb73dd \ - --hash=sha256:de2ea4b5833625383e464549fec1bc395c1bdeeb5f25c4a3a82b5a8c756ec22f \ - --hash=sha256:de55b766c7aa2e2a3092c51e0483d700341182f08e67c63630d5b6f200bb28e5 \ - --hash=sha256:df8b1c11f177bc2313ec4b2d46baec87a5f3e71fc8b45dab2ee7cae86d9aba14 \ - --hash=sha256:e03eab0a8677fa80d646b5ddece1cbeaf556c313dcfac435ba11f107ba117b5d \ - --hash=sha256:e221cf152cff04059d011ee126477f0d9588303eb57e88923578ace7baad17f9 \ - --hash=sha256:e31ae45bc2e29f6b2abd0de1cc3b9d5205aa847cafaecb8af1476a609a2f6eb7 \ - --hash=sha256:edae79245293e15384b51f88b00613ba9f7198016a5948b5dddf4917d4d26382 \ - --hash=sha256:f1e22e8c4419538cb197e4dd60acc919d7696e5ef98ee4da4e01d3f8cfa4cc5a \ - --hash=sha256:f3a2b4222ce6b60e2e8b337bb9596923045681d71e5a082783484d845390938e \ - --hash=sha256:f6a16c31041f09ead72d69f583767292f750d24913dadacf5756b966aacb3f1a \ - --hash=sha256:f75c7ab1f9e4aca5414ed4d8e5c0e303a34f4421f8a0d47a4d019ceff0ab6af4 \ - --hash=sha256:f79fc4fc25f1c8698ff97788206bb3c2598949bfe0fef03d299eb1b5356ada99 \ - --hash=sha256:f7f5baafcc48261359e14bcd6d9bff6d4b28d9103847c9e136694cb0501aef87 \ - --hash=sha256:fc48c783f9c87e60831201f2cce7f3b2e4846bf4d8728eabe54d60700b318a0b - # via trio -h11==0.14.0 \ - --hash=sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d \ - --hash=sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761 - # via wsproto -idna==3.10 \ - --hash=sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9 \ - --hash=sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3 - # via trio -outcome==1.3.0.post0 \ - --hash=sha256:9dcf02e65f2971b80047b377468e72a268e15c0af3cf1238e6ff14f7f91143b8 \ - --hash=sha256:e771c5ce06d1415e356078d3bdd68523f284b4ce5419828922b6871e65eda82b - # via trio -pycparser==2.22 \ - --hash=sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6 \ - --hash=sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc - # via cffi -pysocks==1.7.1 \ - --hash=sha256:08e69f092cc6dbe92a0fdd16eeb9b9ffbc13cadfe5ca4c7bd92ffb078b293299 \ - --hash=sha256:2725bd0a9925919b9b51739eea5f9e2bae91e83288108a9ad338b2e3a4435ee5 \ - --hash=sha256:3f8804571ebe159c380ac6de37643bb4685970655d3bba243530d6558b799aa0 - # via urllib3 -selenium==4.27.1 \ - --hash=sha256:5296c425a75ff1b44d0d5199042b36a6d1ef76c04fb775b97b40be739a9caae2 \ - --hash=sha256:b89b1f62b5cfe8025868556fe82360d6b649d464f75d2655cb966c8f8447ea18 - # via -r requirements.in -sniffio==1.3.1 \ - --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 \ - --hash=sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc - # via trio -sortedcontainers==2.4.0 \ - --hash=sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88 \ - --hash=sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0 - # via trio -trio==0.27.0 \ - --hash=sha256:1dcc95ab1726b2da054afea8fd761af74bad79bd52381b84eae408e983c76831 \ - --hash=sha256:68eabbcf8f457d925df62da780eff15ff5dc68fd6b367e2dde59f7aaf2a0b884 - # via - # selenium - # trio-websocket -trio-websocket==0.11.1 \ - --hash=sha256:18c11793647703c158b1f6e62de638acada927344d534e3c7628eedcb746839f \ - --hash=sha256:520d046b0d030cf970b8b2b2e00c4c2245b3807853ecd44214acd33d74581638 - # via selenium -typing-extensions==4.12.2 \ - --hash=sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d \ - --hash=sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8 - # via selenium -urllib3[socks]==2.2.3 \ - --hash=sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac \ - --hash=sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9 - # via selenium -websocket-client==1.8.0 \ - --hash=sha256:17b44cc997f5c498e809b22cdf2d9c7a9e71c02c8cc2b6c56e7c2d1239bfa526 \ - --hash=sha256:3239df9f44da632f96012472805d40a23281a991027ce11d2f45a6f24ac4c3da - # via selenium -wsproto==1.2.0 \ - --hash=sha256:ad565f26ecb92588a3e43bc3d96164de84cd9902482b130d0ddbaa9664a85065 \ - --hash=sha256:b9acddd652b585d75b20477888c56642fdade28bdfd3579aa24a4d2c037dd736 - # via trio-websocket diff --git a/rules_web_testing_java/BUILD.bazel b/web_testing_java/BUILD.bazel similarity index 100% rename from rules_web_testing_java/BUILD.bazel rename to web_testing_java/BUILD.bazel diff --git a/rules_web_testing_java/MODULE.bazel b/web_testing_java/MODULE.bazel similarity index 100% rename from rules_web_testing_java/MODULE.bazel rename to web_testing_java/MODULE.bazel diff --git a/rules_web_testing_java/webtests/com/google/testing/web/BUILD.bazel b/web_testing_java/javatests/com/google/testing/web/BUILD.bazel similarity index 97% rename from rules_web_testing_java/webtests/com/google/testing/web/BUILD.bazel rename to web_testing_java/javatests/com/google/testing/web/BUILD.bazel index e5bdb8ec..03b49ae5 100644 --- a/rules_web_testing_java/webtests/com/google/testing/web/BUILD.bazel +++ b/web_testing_java/javatests/com/google/testing/web/BUILD.bazel @@ -1,4 +1,4 @@ -# Copyright 2025 Google Inc. +# Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/rules_web_testing_java/webtests/com/google/testing/web/WebTestTest.java b/web_testing_java/javatests/com/google/testing/web/WebTestTest.java similarity index 96% rename from rules_web_testing_java/webtests/com/google/testing/web/WebTestTest.java rename to web_testing_java/javatests/com/google/testing/web/WebTestTest.java index 354b073f..a085e473 100644 --- a/rules_web_testing_java/webtests/com/google/testing/web/WebTestTest.java +++ b/web_testing_java/javatests/com/google/testing/web/WebTestTest.java @@ -14,7 +14,7 @@ // // ////////////////////////////////////////////////////////////////////////////// // -package webtests.com.google.testing.web; +package com.google.testing.web; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/rules_web_testing_java/web/BUILD.bazel b/web_testing_java/web/BUILD.bazel similarity index 100% rename from rules_web_testing_java/web/BUILD.bazel rename to web_testing_java/web/BUILD.bazel diff --git a/rules_web_testing_java/web/java.bzl b/web_testing_java/web/java.bzl similarity index 100% rename from rules_web_testing_java/web/java.bzl rename to web_testing_java/web/java.bzl diff --git a/rules_web_testing_python/BUILD.bazel b/web_testing_python/BUILD.bazel similarity index 97% rename from rules_web_testing_python/BUILD.bazel rename to web_testing_python/BUILD.bazel index f619eeeb..b5ad4b8c 100644 --- a/rules_web_testing_python/BUILD.bazel +++ b/web_testing_python/BUILD.bazel @@ -1,4 +1,4 @@ -# Copyright 2025 Google Inc. +# Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/rules_web_testing_python/MODULE.bazel b/web_testing_python/MODULE.bazel similarity index 100% rename from rules_web_testing_python/MODULE.bazel rename to web_testing_python/MODULE.bazel diff --git a/rules_web_testing_python/requirements.in b/web_testing_python/requirements.in similarity index 100% rename from rules_web_testing_python/requirements.in rename to web_testing_python/requirements.in diff --git a/requirements_lock.txt b/web_testing_python/requirements_lock.txt similarity index 100% rename from requirements_lock.txt rename to web_testing_python/requirements_lock.txt diff --git a/requirements_lock_windows.txt b/web_testing_python/requirements_lock_windows.txt similarity index 100% rename from requirements_lock_windows.txt rename to web_testing_python/requirements_lock_windows.txt diff --git a/rules_web_testing_python/webtests/BUILD.bazel b/web_testing_python/testing/web/BUILD.bazel similarity index 98% rename from rules_web_testing_python/webtests/BUILD.bazel rename to web_testing_python/testing/web/BUILD.bazel index 6f344535..d56e049b 100644 --- a/rules_web_testing_python/webtests/BUILD.bazel +++ b/web_testing_python/testing/web/BUILD.bazel @@ -1,4 +1,4 @@ -# Copyright 2025 Google Inc. +# Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/web_testing_python/testing/web/debugger/BUILD b/web_testing_python/testing/web/debugger/BUILD new file mode 100644 index 00000000..16cfb1f0 --- /dev/null +++ b/web_testing_python/testing/web/debugger/BUILD @@ -0,0 +1,22 @@ +# Copyright 2017 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# +licenses(["notice"]) # Apache 2.0 + +py_binary( + name = "debugger", + srcs = glob(["*.py"]), +) diff --git a/web_testing_python/testing/web/debugger/debugger.py b/web_testing_python/testing/web/debugger/debugger.py new file mode 100644 index 00000000..41f0fa0e --- /dev/null +++ b/web_testing_python/testing/web/debugger/debugger.py @@ -0,0 +1,179 @@ +# Copyright 2017 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Web Test Launcher Debugger Front-End.""" + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +import code +import getpass +import hashlib +import json +import socket +import sys +from six.moves import urllib + + +class Debugger: + """Debugger connects to the WTL debugger and sends and receives messages.""" + + def __init__(self, port, host="localhost"): + self._conn = socket.create_connection(address=(host, port)) + self._file = self._conn.makefile(mode="w") + self._decoder = json.JSONDecoder() + self._next_id = 1 + self._buffer = "" + + def _get_next_id(self): + id = self._next_id + self._next_id = self._next_id + 1 + return id + + def _read_next(self): + while True: + try: + self._buffer = self._buffer.strip() + obj, p = self._decoder.raw_decode(self._buffer) + self._buffer = self._buffer[p:] + return obj + except: + pass + s = self._conn.recv(4096).decode("utf-8") + if s == "": + quit() + self._buffer = self._buffer + s + + def _read_until_waiting(self): + while True: + n = self._read_next() + print(n) + if n["status"] != "running": + return + + def step(self): + """Execute the waiting WebDriver command and stop at the next one.""" + id = self._get_next_id() + json.dump(obj={"id": id, "command": "step"}, fp=self._file) + self._file.flush() + self._read_until_waiting() + + def run(self): + """Execute WebDriver commands until a breakpoint is reached.""" + id = self._get_next_id() + json.dump(obj={"id": id, "command": "continue"}, fp=self._file) + self._file.flush() + self._read_until_waiting() + + def stop(self): + """Quit WTL and the debugger.""" + id = self._get_next_id() + json.dump(obj={"id": id, "command": "stop"}, fp=self._file) + self._file.flush() + quit() + + def set_breakpoint(self, path=None, methods=None, body=None): + """Set a WTL breakpoint. + + Args: + path: string, Go regular expression to compare to WebDriver command paths. + methods: list of strings, a list of HTTP methods ("POST", "GET", etc). + body: string, Go regular expression to compare to body of WebDriver + command. + + Returns: + int, id of the breakpoint (can be used in delete_breakpoint command). + """ + id = self._get_next_id() + + bp = {"id": id} + if path: + bp["path"] = path + if methods: + bp["methods"] = methods + if body: + bp["body"] = body + + json.dump( + obj={ + "id": id, + "command": "set breakpoint", + "breakpoint": bp, + }, + fp=self._file) + self._file.flush() + self._read_until_waiting() + return id + + def delete_breakpoint(self, breakpoint_id): + """Delete a previously set WTL breakpoint. + + Args: + breakpoint_id: int, id of the breakpoint to delete. + """ + id = self._get_next_id() + + json.dump( + obj={ + "id": id, + "command": "delete breakpoint", + "breakpoint": { + "id": breakpoint_id + }, + }, + fp=self._file) + self._file.flush() + self._read_until_waiting() + + +def collect_analytics(): + try: + urllib.request.urlopen( + "http://www.google-analytics.com/collect?v=1&aip=1&tid=UA-52159295-3" + "&t=screenview&cd=start&an=WTL+Debugger&uid=" + + hashlib.md5(getpass.getuser()).hexdigest()).close + except: + # Error collecting usage + pass + + +def main(args): + host = "localhost" + if len(args) == 2: + port = args[1] + elif len(args) == 3: + host = args[1] + port = args[2] + else: + print("Usage %s [host] port") + quit() + + wtl = Debugger(host=host, port=port) + + collect_analytics() + + code.interact( + """ +\033[95m\033[1mPython Interactive Console\033[0m + +Debugger Commands: + wtl.run(): Run test until next WTL breakpoint. + wtl.step(): Execute the current waiting command and break at the next one. + wtl.stop(): Quit WTL and the Debugger. + help(wtl): Additional debugger commands. +""", + local={"wtl": wtl}) + + +if __name__ == "__main__": + main(sys.argv) diff --git a/rules_web_testing_python/webtests/webtest.py b/web_testing_python/testing/web/webtest.py similarity index 98% rename from rules_web_testing_python/webtests/webtest.py rename to web_testing_python/testing/web/webtest.py index 71458b69..5e3fd490 100644 --- a/rules_web_testing_python/webtests/webtest.py +++ b/web_testing_python/testing/web/webtest.py @@ -14,7 +14,7 @@ """Browser provisioning and information API. Provision a browser: - from pythontests import webtest + from testing.web import webtest driver = webtest.new_webdriver_session() diff --git a/rules_web_testing_python/webtests/webtest_test.py b/web_testing_python/testing/web/webtest_test.py similarity index 94% rename from rules_web_testing_python/webtests/webtest_test.py rename to web_testing_python/testing/web/webtest_test.py index f1faa763..4c484556 100644 --- a/rules_web_testing_python/webtests/webtest_test.py +++ b/web_testing_python/testing/web/webtest_test.py @@ -11,11 +11,11 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -"""Tests for web.web_python.pythontests.""" +"""Tests for testing.web.webtest.""" import unittest -from webtests import webtest +from testing.web import webtest class BrowserTest(unittest.TestCase): diff --git a/rules_web_testing_python/web/BUILD.bazel b/web_testing_python/web/BUILD.bazel similarity index 100% rename from rules_web_testing_python/web/BUILD.bazel rename to web_testing_python/web/BUILD.bazel diff --git a/rules_web_testing_python/web/py.bzl b/web_testing_python/web/py.bzl similarity index 100% rename from rules_web_testing_python/web/py.bzl rename to web_testing_python/web/py.bzl diff --git a/rules_web_testing_scala/MODULE.bazel b/web_testing_scala/MODULE.bazel similarity index 100% rename from rules_web_testing_scala/MODULE.bazel rename to web_testing_scala/MODULE.bazel diff --git a/rules_web_testing_scala/scalatests/BUILD.bazel b/web_testing_scala/scalatests/BUILD.bazel similarity index 97% rename from rules_web_testing_scala/scalatests/BUILD.bazel rename to web_testing_scala/scalatests/BUILD.bazel index 5c0208f6..7b3425ec 100644 --- a/rules_web_testing_scala/scalatests/BUILD.bazel +++ b/web_testing_scala/scalatests/BUILD.bazel @@ -1,4 +1,4 @@ -# Copyright 2025 Google Inc. +# Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/rules_web_testing_scala/scalatests/WebTestTest.scala b/web_testing_scala/scalatests/WebTestTest.scala similarity index 100% rename from rules_web_testing_scala/scalatests/WebTestTest.scala rename to web_testing_scala/scalatests/WebTestTest.scala diff --git a/rules_web_testing_scala/web/BUILD.bazel b/web_testing_scala/web/BUILD.bazel similarity index 100% rename from rules_web_testing_scala/web/BUILD.bazel rename to web_testing_scala/web/BUILD.bazel diff --git a/rules_web_testing_scala/web/scala.bzl b/web_testing_scala/web/scala.bzl similarity index 100% rename from rules_web_testing_scala/web/scala.bzl rename to web_testing_scala/web/scala.bzl From 3fd3f78b086d168ffb2b5a6a0a2c4cf4c893f928 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Tue, 18 Mar 2025 22:29:08 +0000 Subject: [PATCH 17/74] More polish --- MODULE.bazel | 2 +- build_web_modules.sh | 25 ------------------- .../com/google/testing/web/WebTestTest.java | 1 - .../testing/web/webtest_test.py | 1 + web_testing_python/web/py.bzl | 2 +- 5 files changed, 3 insertions(+), 28 deletions(-) delete mode 100644 build_web_modules.sh diff --git a/MODULE.bazel b/MODULE.bazel index f74b3686..3effa99e 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -24,7 +24,7 @@ use_repo( ) ##### Java dependencies ##### -bazel_dep(name = "rules_jvm_external",version = "6.6") +bazel_dep(name = "rules_jvm_external", version = "6.6") maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") diff --git a/build_web_modules.sh b/build_web_modules.sh deleted file mode 100644 index d134651b..00000000 --- a/build_web_modules.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# Copyright 2019 Google Inc. All Rights Reserved -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS-IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -ex - -# Build and test web java and related tests in web_java module -(cd web_java && bazel test ... --java_runtime_version=17) - -# Build and test web python and related tests in web_python module -(cd web_python && bazel test ...) - -# Build and test web scala and related tests in web_scala module -(cd web_scala && bazel test ...) diff --git a/web_testing_java/javatests/com/google/testing/web/WebTestTest.java b/web_testing_java/javatests/com/google/testing/web/WebTestTest.java index a085e473..922a1cb0 100644 --- a/web_testing_java/javatests/com/google/testing/web/WebTestTest.java +++ b/web_testing_java/javatests/com/google/testing/web/WebTestTest.java @@ -20,7 +20,6 @@ import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import org.openqa.selenium.WebDriver; -import com.google.testing.web.WebTest; @RunWith(JUnit4.class) public class WebTestTest { diff --git a/web_testing_python/testing/web/webtest_test.py b/web_testing_python/testing/web/webtest_test.py index 4c484556..bcaa4a1d 100644 --- a/web_testing_python/testing/web/webtest_test.py +++ b/web_testing_python/testing/web/webtest_test.py @@ -17,6 +17,7 @@ from testing.web import webtest + class BrowserTest(unittest.TestCase): def testBrowserProvisioningNoCaps(self): diff --git a/web_testing_python/web/py.bzl b/web_testing_python/web/py.bzl index db58bce8..3a641736 100644 --- a/web_testing_python/web/py.bzl +++ b/web_testing_python/web/py.bzl @@ -1,4 +1,4 @@ -# Copyright 2025 Google Inc. +# Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From 7097ef4b7ca19dedd0361cc1745461408978deb7 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Tue, 18 Mar 2025 23:31:58 +0000 Subject: [PATCH 18/74] More polish --- .bazelignore | 1 + MODULE.bazel | 40 ++++++++++++++++--- go/webdriver/BUILD.bazel | 2 +- go/webtest/BUILD.bazel | 5 ++- go/wtl/proxy/BUILD.bazel | 2 +- .../proxy/driverhub/quithandler/BUILD.bazel | 2 +- .../proxy/driverhub/scripttimeout/BUILD.bazel | 2 +- web_testing_go/MODULE.bazel | 24 +++++++++++ {go => web_testing_go}/web/BUILD.bazel | 4 +- {go => web_testing_go}/web/go.bzl | 4 +- web_testing_scala/web/scala.bzl | 2 +- 11 files changed, 71 insertions(+), 17 deletions(-) create mode 100644 web_testing_go/MODULE.bazel rename {go => web_testing_go}/web/BUILD.bazel (88%) rename {go => web_testing_go}/web/go.bzl (87%) diff --git a/.bazelignore b/.bazelignore index bdf56a88..9dad43df 100644 --- a/.bazelignore +++ b/.bazelignore @@ -1,3 +1,4 @@ +web_testing_go web_testing_java web_testing_python web_testing_scala diff --git a/MODULE.bazel b/MODULE.bazel index 3effa99e..b177b3eb 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -3,14 +3,37 @@ module( version = "0.4.0", ) -bazel_dep(name = "bazel_skylib", version = "1.7.1") +bazel_dep( + name = "rules_web_testing_go", +) + +local_path_override( + module_name = "rules_web_testing_go", + path = "web_testing_go", +) -bazel_dep(name = "platforms", version = "0.0.10") +bazel_dep( + name = "bazel_skylib", + version = "1.7.1", +) + +bazel_dep( + name = "platforms", + version = "0.0.10", +) ##### Go dependencies ##### -bazel_dep(name = "rules_go", version = "0.51.0-rc1", repo_name = "io_bazel_rules_go") +bazel_dep( + name = "rules_go", + version = "0.51.0-rc1", + repo_name = "io_bazel_rules_go", +) -bazel_dep(name = "gazelle", version = "0.40.0", repo_name = "bazel_gazelle") +bazel_dep( + name = "gazelle", + version = "0.40.0", + repo_name = "bazel_gazelle", +) go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") @@ -24,7 +47,10 @@ use_repo( ) ##### Java dependencies ##### -bazel_dep(name = "rules_jvm_external", version = "6.6") +bazel_dep( + name = "rules_jvm_external", + version = "6.6", +) maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") @@ -41,7 +67,9 @@ use_repo(maven, "maven") ##### Browsers dependencies ##### browser_repositories = use_extension("//web:extension.bzl", "browser_repositories_extension") + browser_repositories.install(version = "0.3.4") + use_repo( browser_repositories, "com_saucelabs_sauce_connect_linux_x64", @@ -52,7 +80,7 @@ use_repo( "org_chromium_chromedriver_macos_x64", "org_chromium_chromedriver_windows_x64", "org_chromium_chromium_linux_x64", - "org_chromium_chromium_macos_arm64", # Only available in 0.3.3 + "org_chromium_chromium_macos_arm64", # Only available in 0.3.3 "org_chromium_chromium_macos_x64", "org_chromium_chromium_windows_x64", "org_mozilla_firefox_linux_x64", diff --git a/go/webdriver/BUILD.bazel b/go/webdriver/BUILD.bazel index ce446db1..d25279a8 100644 --- a/go/webdriver/BUILD.bazel +++ b/go/webdriver/BUILD.bazel @@ -14,7 +14,7 @@ # ################################################################################ # -load("//go/web:go.bzl", "go_web_test_suite") +load("@rules_web_testing_go//web:go.bzl", "go_web_test_suite") load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/go/webtest/BUILD.bazel b/go/webtest/BUILD.bazel index b4b5d474..e27e5e29 100644 --- a/go/webtest/BUILD.bazel +++ b/go/webtest/BUILD.bazel @@ -1,3 +1,5 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,8 +16,7 @@ # ################################################################################ # -load("//go/web:go.bzl", "go_web_test_suite") -load("@io_bazel_rules_go//go:def.bzl", "go_library") +load("@rules_web_testing_go//web:go.bzl", "go_web_test_suite") licenses(["notice"]) # Apache 2.0 diff --git a/go/wtl/proxy/BUILD.bazel b/go/wtl/proxy/BUILD.bazel index d6d36f54..52c87858 100644 --- a/go/wtl/proxy/BUILD.bazel +++ b/go/wtl/proxy/BUILD.bazel @@ -14,7 +14,7 @@ # ################################################################################ # -load("//go/web:go.bzl", "go_web_test_suite") +load("@rules_web_testing_go//web:go.bzl", "go_web_test_suite") load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/go/wtl/proxy/driverhub/quithandler/BUILD.bazel b/go/wtl/proxy/driverhub/quithandler/BUILD.bazel index e1e1b0a9..7e90b9ce 100644 --- a/go/wtl/proxy/driverhub/quithandler/BUILD.bazel +++ b/go/wtl/proxy/driverhub/quithandler/BUILD.bazel @@ -14,7 +14,7 @@ # ################################################################################ # -load("//go/web:go.bzl", "go_web_test_suite") +load("@rules_web_testing_go//web:go.bzl", "go_web_test_suite") load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel b/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel index 6908eebe..c037a326 100644 --- a/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel +++ b/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel @@ -14,7 +14,7 @@ # ################################################################################ # -load("//go/web:go.bzl", "go_web_test_suite") +load("@rules_web_testing_go//web:go.bzl", "go_web_test_suite") load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/web_testing_go/MODULE.bazel b/web_testing_go/MODULE.bazel new file mode 100644 index 00000000..20f84f22 --- /dev/null +++ b/web_testing_go/MODULE.bazel @@ -0,0 +1,24 @@ +module( + name = "rules_web_testing_go", + version = "0.4.0", +) + +bazel_dep( + name = "rules_webtesting", +) + +local_path_override( + module_name = "rules_webtesting", + path = "..", +) + +bazel_dep( + name = "bazel_skylib", + version = "1.7.1", +) + +bazel_dep( + name = "rules_go", + version = "0.51.0-rc1", + repo_name = "io_bazel_rules_go", +) diff --git a/go/web/BUILD.bazel b/web_testing_go/web/BUILD.bazel similarity index 88% rename from go/web/BUILD.bazel rename to web_testing_go/web/BUILD.bazel index b3e67c60..de41e9e4 100644 --- a/go/web/BUILD.bazel +++ b/web_testing_go/web/BUILD.bazel @@ -15,7 +15,7 @@ ################################################################################ # load("@bazel_skylib//:bzl_library.bzl", "bzl_library") -load("//web:web.bzl", "web_test_config") +load("@rules_webtesting//web:web.bzl", "web_test_config") package( default_testonly = True, @@ -26,7 +26,7 @@ bzl_library( name = "go", srcs = ["go.bzl"], deps = [ - "//web/internal:wrap_web_test_suite", + "@rules_webtesting//web/internal:wrap_web_test_suite", # should depend on @io_bazel_rules_go//go:def.bzl ], ) diff --git a/go/web/go.bzl b/web_testing_go/web/go.bzl similarity index 87% rename from go/web/go.bzl rename to web_testing_go/web/go.bzl index 1168176e..183226b8 100644 --- a/go/web/go.bzl +++ b/web_testing_go/web/go.bzl @@ -13,9 +13,9 @@ # limitations under the License. """Web Test rules for Go.""" -load("//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") -load("//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") load("@io_bazel_rules_go//go:def.bzl", "go_test") +load("@rules_webtesting//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") +load("@rules_webtesting//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") def go_web_test_suite(name, go_test_tags = DEFAULT_WRAPPED_TEST_TAGS, **kwargs): """Defines a test_suite of web_test targets that wrap a go_test target. diff --git a/web_testing_scala/web/scala.bzl b/web_testing_scala/web/scala.bzl index 870d2f38..b78ec7e7 100644 --- a/web_testing_scala/web/scala.bzl +++ b/web_testing_scala/web/scala.bzl @@ -1,4 +1,4 @@ -# Copyright 2025 Google Inc. +# Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From 5acecd8bf93e89300ccbccc699c6e2d987f77acd Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Wed, 19 Mar 2025 02:30:05 +0000 Subject: [PATCH 19/74] More polish --- MODULE.bazel | 1 + go/webdriver/BUILD.bazel | 3 ++- go/wtl/proxy/BUILD.bazel | 3 ++- go/wtl/proxy/driverhub/quithandler/BUILD.bazel | 3 ++- go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel | 3 ++- web_testing_java/MODULE.bazel | 5 +++++ web_testing_python/MODULE.bazel | 5 +++++ web_testing_scala/MODULE.bazel | 5 +++++ 8 files changed, 24 insertions(+), 4 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index b177b3eb..7413550b 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -5,6 +5,7 @@ module( bazel_dep( name = "rules_web_testing_go", + version = "0.4.0", ) local_path_override( diff --git a/go/webdriver/BUILD.bazel b/go/webdriver/BUILD.bazel index d25279a8..67229ad0 100644 --- a/go/webdriver/BUILD.bazel +++ b/go/webdriver/BUILD.bazel @@ -1,3 +1,5 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,7 +17,6 @@ ################################################################################ # load("@rules_web_testing_go//web:go.bzl", "go_web_test_suite") -load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/go/wtl/proxy/BUILD.bazel b/go/wtl/proxy/BUILD.bazel index 52c87858..28e0286c 100644 --- a/go/wtl/proxy/BUILD.bazel +++ b/go/wtl/proxy/BUILD.bazel @@ -1,3 +1,5 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + # Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,7 +17,6 @@ ################################################################################ # load("@rules_web_testing_go//web:go.bzl", "go_web_test_suite") -load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/go/wtl/proxy/driverhub/quithandler/BUILD.bazel b/go/wtl/proxy/driverhub/quithandler/BUILD.bazel index 7e90b9ce..7d2dd97d 100644 --- a/go/wtl/proxy/driverhub/quithandler/BUILD.bazel +++ b/go/wtl/proxy/driverhub/quithandler/BUILD.bazel @@ -1,3 +1,5 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,7 +17,6 @@ ################################################################################ # load("@rules_web_testing_go//web:go.bzl", "go_web_test_suite") -load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel b/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel index c037a326..9978e939 100644 --- a/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel +++ b/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel @@ -1,3 +1,5 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,7 +17,6 @@ ################################################################################ # load("@rules_web_testing_go//web:go.bzl", "go_web_test_suite") -load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/web_testing_java/MODULE.bazel b/web_testing_java/MODULE.bazel index 8e7f6b39..4cee4ab4 100644 --- a/web_testing_java/MODULE.bazel +++ b/web_testing_java/MODULE.bazel @@ -12,6 +12,11 @@ local_path_override( path = "..", ) +local_path_override( + module_name = "rules_web_testing_go", + path = "../web_testing_go", +) + bazel_dep( name = "bazel_skylib", version = "1.7.1", diff --git a/web_testing_python/MODULE.bazel b/web_testing_python/MODULE.bazel index 28f33dad..0d091c3d 100644 --- a/web_testing_python/MODULE.bazel +++ b/web_testing_python/MODULE.bazel @@ -17,6 +17,11 @@ local_path_override( path = "..", ) +local_path_override( + module_name = "rules_web_testing_go", + path = "../web_testing_go", +) + bazel_dep( name = "rules_python", version = "1.0.0", diff --git a/web_testing_scala/MODULE.bazel b/web_testing_scala/MODULE.bazel index 3168de5c..03fe5677 100644 --- a/web_testing_scala/MODULE.bazel +++ b/web_testing_scala/MODULE.bazel @@ -12,6 +12,11 @@ local_path_override( path = "..", ) +local_path_override( + module_name = "rules_web_testing_go", + path = "../web_testing_go", +) + bazel_dep( name = "bazel_skylib", version = "1.7.1", From 007f966f6185cd3fd93ce3ae4ea86a93b7f109c0 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Wed, 19 Mar 2025 02:39:35 +0000 Subject: [PATCH 20/74] Revert formatting --- MODULE.bazel | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 7413550b..6fc7e4fd 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -13,45 +13,24 @@ local_path_override( path = "web_testing_go", ) -bazel_dep( - name = "bazel_skylib", - version = "1.7.1", -) +bazel_dep(name = "bazel_skylib", version = "1.7.1") -bazel_dep( - name = "platforms", - version = "0.0.10", -) +bazel_dep(name = "platforms", version = "0.0.10") ##### Go dependencies ##### -bazel_dep( - name = "rules_go", - version = "0.51.0-rc1", - repo_name = "io_bazel_rules_go", -) +bazel_dep(name = "rules_go", version = "0.51.0-rc1", repo_name = "io_bazel_rules_go") -bazel_dep( - name = "gazelle", - version = "0.40.0", - repo_name = "bazel_gazelle", -) +bazel_dep(name = "gazelle", version = "0.40.0", repo_name = "bazel_gazelle") go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") go_deps.from_file(go_mod = "//:go.mod") # All *direct* Go dependencies of the module have to be listed explicitly. -use_repo( - go_deps, - "com_github_gorilla_mux", - "com_github_tebeka_selenium", -) +use_repo(go_deps, "com_github_gorilla_mux", "com_github_tebeka_selenium") ##### Java dependencies ##### -bazel_dep( - name = "rules_jvm_external", - version = "6.6", -) +bazel_dep(name = "rules_jvm_external", version = "6.6") maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") From 62bbe071fb6d3feb680e331ef4010abe0e978c2c Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Wed, 19 Mar 2025 02:51:08 +0000 Subject: [PATCH 21/74] Revert auto formatting --- go/webdriver/BUILD.bazel | 3 +-- go/wtl/proxy/BUILD.bazel | 3 +-- go/wtl/proxy/driverhub/quithandler/BUILD.bazel | 3 +-- go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel | 3 +-- web_testing_scala/scalatests/BUILD.bazel | 2 +- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/go/webdriver/BUILD.bazel b/go/webdriver/BUILD.bazel index 67229ad0..d25279a8 100644 --- a/go/webdriver/BUILD.bazel +++ b/go/webdriver/BUILD.bazel @@ -1,5 +1,3 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,6 +15,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") ################################################################################ # load("@rules_web_testing_go//web:go.bzl", "go_web_test_suite") +load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/go/wtl/proxy/BUILD.bazel b/go/wtl/proxy/BUILD.bazel index 28e0286c..52c87858 100644 --- a/go/wtl/proxy/BUILD.bazel +++ b/go/wtl/proxy/BUILD.bazel @@ -1,5 +1,3 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - # Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,6 +15,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") ################################################################################ # load("@rules_web_testing_go//web:go.bzl", "go_web_test_suite") +load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/go/wtl/proxy/driverhub/quithandler/BUILD.bazel b/go/wtl/proxy/driverhub/quithandler/BUILD.bazel index 7d2dd97d..7e90b9ce 100644 --- a/go/wtl/proxy/driverhub/quithandler/BUILD.bazel +++ b/go/wtl/proxy/driverhub/quithandler/BUILD.bazel @@ -1,5 +1,3 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,6 +15,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") ################################################################################ # load("@rules_web_testing_go//web:go.bzl", "go_web_test_suite") +load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel b/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel index 9978e939..c037a326 100644 --- a/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel +++ b/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel @@ -1,5 +1,3 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,6 +15,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") ################################################################################ # load("@rules_web_testing_go//web:go.bzl", "go_web_test_suite") +load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/web_testing_scala/scalatests/BUILD.bazel b/web_testing_scala/scalatests/BUILD.bazel index 7b3425ec..da190c10 100644 --- a/web_testing_scala/scalatests/BUILD.bazel +++ b/web_testing_scala/scalatests/BUILD.bazel @@ -1,4 +1,4 @@ -# Copyright 2016 Google Inc. +# Copyright 2018 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From 2e6173b47e46758975f13e29a45f5db2d313e811 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Wed, 19 Mar 2025 02:54:41 +0000 Subject: [PATCH 22/74] Revert formatting --- MODULE.bazel | 2 +- go/webtest/BUILD.bazel | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 6fc7e4fd..f99deb8b 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -60,7 +60,7 @@ use_repo( "org_chromium_chromedriver_macos_x64", "org_chromium_chromedriver_windows_x64", "org_chromium_chromium_linux_x64", - "org_chromium_chromium_macos_arm64", # Only available in 0.3.3 + "org_chromium_chromium_macos_arm64", # Only available in 0.3.3 "org_chromium_chromium_macos_x64", "org_chromium_chromium_windows_x64", "org_mozilla_firefox_linux_x64", diff --git a/go/webtest/BUILD.bazel b/go/webtest/BUILD.bazel index e27e5e29..a4f5056a 100644 --- a/go/webtest/BUILD.bazel +++ b/go/webtest/BUILD.bazel @@ -1,5 +1,3 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,6 +15,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") ################################################################################ # load("@rules_web_testing_go//web:go.bzl", "go_web_test_suite") +load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 From d5543b3f104213e6963ce87c3c1432fd401ca011 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Wed, 19 Mar 2025 04:22:45 +0000 Subject: [PATCH 23/74] Create symbol link --- web_testing_go/webtest/webtest | 1 + .../java}/com/google/testing/bazel/BUILD.bazel | 0 .../java}/com/google/testing/bazel/Bazel.java | 0 .../java}/com/google/testing/web/BUILD.bazel | 0 .../java}/com/google/testing/web/WebTest.java | 0 web_testing_java/javatests/com/google/testing/web/BUILD.bazel | 2 +- 6 files changed, 2 insertions(+), 1 deletion(-) create mode 120000 web_testing_go/webtest/webtest rename {java => web_testing_java/java}/com/google/testing/bazel/BUILD.bazel (100%) rename {java => web_testing_java/java}/com/google/testing/bazel/Bazel.java (100%) rename {java => web_testing_java/java}/com/google/testing/web/BUILD.bazel (100%) rename {java => web_testing_java/java}/com/google/testing/web/WebTest.java (100%) diff --git a/web_testing_go/webtest/webtest b/web_testing_go/webtest/webtest new file mode 120000 index 00000000..eb06eb85 --- /dev/null +++ b/web_testing_go/webtest/webtest @@ -0,0 +1 @@ +/usr/local/google/home/mollyibot/rules_webtesting03132/go/webtest \ No newline at end of file diff --git a/java/com/google/testing/bazel/BUILD.bazel b/web_testing_java/java/com/google/testing/bazel/BUILD.bazel similarity index 100% rename from java/com/google/testing/bazel/BUILD.bazel rename to web_testing_java/java/com/google/testing/bazel/BUILD.bazel diff --git a/java/com/google/testing/bazel/Bazel.java b/web_testing_java/java/com/google/testing/bazel/Bazel.java similarity index 100% rename from java/com/google/testing/bazel/Bazel.java rename to web_testing_java/java/com/google/testing/bazel/Bazel.java diff --git a/java/com/google/testing/web/BUILD.bazel b/web_testing_java/java/com/google/testing/web/BUILD.bazel similarity index 100% rename from java/com/google/testing/web/BUILD.bazel rename to web_testing_java/java/com/google/testing/web/BUILD.bazel diff --git a/java/com/google/testing/web/WebTest.java b/web_testing_java/java/com/google/testing/web/WebTest.java similarity index 100% rename from java/com/google/testing/web/WebTest.java rename to web_testing_java/java/com/google/testing/web/WebTest.java diff --git a/web_testing_java/javatests/com/google/testing/web/BUILD.bazel b/web_testing_java/javatests/com/google/testing/web/BUILD.bazel index 03b49ae5..3cddeb79 100644 --- a/web_testing_java/javatests/com/google/testing/web/BUILD.bazel +++ b/web_testing_java/javatests/com/google/testing/web/BUILD.bazel @@ -28,8 +28,8 @@ java_web_test_suite( "@rules_webtesting//browsers/sauce:chrome-win10-connect", ], deps = [ + "//java/com/google/testing/web", "@maven//:junit_junit", "@maven//:org_seleniumhq_selenium_selenium_api", - "@rules_webtesting//java/com/google/testing/web", ], ) From f367409e95fde98e72d6bd3a712910552f6fc655 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Wed, 19 Mar 2025 04:27:15 +0000 Subject: [PATCH 24/74] change to relative path --- web_testing_go/webtest | 1 + web_testing_go/webtest/webtest | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 120000 web_testing_go/webtest delete mode 120000 web_testing_go/webtest/webtest diff --git a/web_testing_go/webtest b/web_testing_go/webtest new file mode 120000 index 00000000..4fac5cc8 --- /dev/null +++ b/web_testing_go/webtest @@ -0,0 +1 @@ +/go/webtest \ No newline at end of file diff --git a/web_testing_go/webtest/webtest b/web_testing_go/webtest/webtest deleted file mode 120000 index eb06eb85..00000000 --- a/web_testing_go/webtest/webtest +++ /dev/null @@ -1 +0,0 @@ -/usr/local/google/home/mollyibot/rules_webtesting03132/go/webtest \ No newline at end of file From 423602e716692a0dd00ee4b2cd0b70edae402e1a Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Wed, 19 Mar 2025 23:39:55 +0000 Subject: [PATCH 25/74] More polish --- .bazelci/presubmit.yml | 24 +++++ MODULE.bazel | 16 --- go/bazel/BUILD.bazel | 2 +- go/metadata/BUILD.bazel | 6 +- testdata/BUILD.bazel | 2 +- web_testing_go/BUILD.bazel | 26 +++++ web_testing_go/MODULE.bazel | 9 ++ web_testing_go/go.mod | 10 ++ web_testing_go/go.sum | 114 +++++++++++++++++++++ web_testing_go/webtest | 1 - web_testing_go/webtest/BUILD.bazel | 49 +++++++++ web_testing_go/webtest/browserinfo_test.go | 1 + web_testing_go/webtest/webtest.go | 1 + web_testing_go/webtest/webtest_test.go | 1 + web_testing_scala/MODULE.bazel | 9 ++ web_testing_scala/scalatests/BUILD.bazel | 2 +- 16 files changed, 250 insertions(+), 23 deletions(-) create mode 100644 web_testing_go/BUILD.bazel create mode 100644 web_testing_go/go.mod create mode 100644 web_testing_go/go.sum delete mode 120000 web_testing_go/webtest create mode 100644 web_testing_go/webtest/BUILD.bazel create mode 120000 web_testing_go/webtest/browserinfo_test.go create mode 120000 web_testing_go/webtest/webtest.go create mode 120000 web_testing_go/webtest/webtest_test.go diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 7f7f5b7c..8e01199f 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -25,6 +25,30 @@ platforms: test_targets: - "//..." tasks: + web_testing_go_ubuntu2004: + name: "Go workspace for web in ubuntu" + platform: ubuntu2004 + test_flags: + - "--test_tag_filters=-noci,-external,-native,-sauce" + build_targets: ["//..."] + test_targets: ["//..."] + working_directory: web_testing_go + web_testing_go_macos: + name: "Go workspace for web in macos" + platform: macos + test_flags: + - "--test_tag_filters=-noci,-external,-native,-sauce" + build_targets: [ "//..." ] + test_targets: [ "//..." ] + working_directory: web_testing_go + web_testing_go_windows: + name: "Go workspace for web in windows" + platform: windows + test_flags: + - "--test_tag_filters=-noci,-external,-native,-sauce" + build_targets: [ "//..." ] + test_targets: [ "//..." ] + working_directory: web_testing_go web_testing_scala_ubuntu2004: name: "Scala workspace for web in ubuntu" platform: ubuntu2004 diff --git a/MODULE.bazel b/MODULE.bazel index f99deb8b..e6a47e2b 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -29,22 +29,6 @@ go_deps.from_file(go_mod = "//:go.mod") # All *direct* Go dependencies of the module have to be listed explicitly. use_repo(go_deps, "com_github_gorilla_mux", "com_github_tebeka_selenium") -##### Java dependencies ##### -bazel_dep(name = "rules_jvm_external", version = "6.6") - -maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") - -maven.install( - artifacts = [ - "com.google.guava:guava:33.2.1-jre", - "org.seleniumhq.selenium:selenium-remote-driver:4.27.0", - "org.seleniumhq.selenium:selenium-api:4.27.0", - "junit:junit:4.13.2", - ], -) - -use_repo(maven, "maven") - ##### Browsers dependencies ##### browser_repositories = use_extension("//web:extension.bzl", "browser_repositories_extension") diff --git a/go/bazel/BUILD.bazel b/go/bazel/BUILD.bazel index 2df1344b..df42180d 100644 --- a/go/bazel/BUILD.bazel +++ b/go/bazel/BUILD.bazel @@ -22,6 +22,6 @@ go_library( name = "go_default_library", srcs = ["bazel.go"], importpath = "github.com/bazelbuild/rules_webtesting/go/bazel", - visibility = ["//go:__subpackages__"], + visibility = ["//visibility:public"], deps = ["//go/cmdhelper:go_default_library"], ) diff --git a/go/metadata/BUILD.bazel b/go/metadata/BUILD.bazel index 99a5d16b..181da00e 100644 --- a/go/metadata/BUILD.bazel +++ b/go/metadata/BUILD.bazel @@ -25,7 +25,7 @@ go_library( "web_test_files.go", ], importpath = "github.com/bazelbuild/rules_webtesting/go/metadata", - visibility = ["//go:__subpackages__"], + visibility = ["//visibility:public"], deps = [ "//go/bazel:go_default_library", "//go/httphelper:go_default_library", @@ -39,7 +39,7 @@ go_test( "extension_test.go", "metadata_test.go", ], - data = ["//testdata"], + data = ["@rules_webtesting//testdata"], embed = [":go_default_library"], - deps = ["//go/bazel:go_default_library"], + deps = ["@rules_webtesting//go/bazel:go_default_library"], ) diff --git a/testdata/BUILD.bazel b/testdata/BUILD.bazel index cdaac083..4b8a3994 100644 --- a/testdata/BUILD.bazel +++ b/testdata/BUILD.bazel @@ -23,7 +23,7 @@ licenses(["notice"]) # Apache 2.0 filegroup( name = "testdata", srcs = glob(["*"]), - visibility = ["//:__subpackages__"], + visibility = ["//visibility:public"], ) web_test_files( diff --git a/web_testing_go/BUILD.bazel b/web_testing_go/BUILD.bazel new file mode 100644 index 00000000..ab52bbb1 --- /dev/null +++ b/web_testing_go/BUILD.bazel @@ -0,0 +1,26 @@ +# Copyright 2016 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# +load("@bazel_gazelle//:def.bzl", "gazelle") + +licenses(["notice"]) # Apache 2.0 + +exports_files(["LICENSE"]) + +gazelle( + name = "gazelle", + prefix = "github.com/bazelbuild/rules_webtesting", +) diff --git a/web_testing_go/MODULE.bazel b/web_testing_go/MODULE.bazel index 20f84f22..fe89678a 100644 --- a/web_testing_go/MODULE.bazel +++ b/web_testing_go/MODULE.bazel @@ -22,3 +22,12 @@ bazel_dep( version = "0.51.0-rc1", repo_name = "io_bazel_rules_go", ) + +bazel_dep(name = "gazelle", version = "0.40.0", repo_name = "bazel_gazelle") + +go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") + +go_deps.from_file(go_mod = "//:go.mod") + +# All *direct* Go dependencies of the module have to be listed explicitly. +use_repo(go_deps, "com_github_gorilla_mux", "com_github_tebeka_selenium") \ No newline at end of file diff --git a/web_testing_go/go.mod b/web_testing_go/go.mod new file mode 100644 index 00000000..8c2aa93c --- /dev/null +++ b/web_testing_go/go.mod @@ -0,0 +1,10 @@ +module github.com/bazelbuild/rules_webtesting + +go 1.17 + +require ( + github.com/gorilla/mux v1.8.1 + github.com/tebeka/selenium v0.9.9 +) + +require github.com/blang/semver v3.5.1+incompatible // indirect diff --git a/web_testing_go/go.sum b/web_testing_go/go.sum new file mode 100644 index 00000000..e4f19c45 --- /dev/null +++ b/web_testing_go/go.sum @@ -0,0 +1,114 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.41.0/go.mod h1:OauMR7DV8fzvZIl2qg6rkaIhD/vmgk4iwEw/h6ercmg= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/BurntSushi/xgbutil v0.0.0-20160919175755-f7c97cef3b4e h1:4ZrkT/RzpnROylmoQL57iVUL57wGKTR5O6KpVnbm2tA= +github.com/BurntSushi/xgbutil v0.0.0-20160919175755-f7c97cef3b4e/go.mod h1:uw9h2sd4WWHOPdJ13MQpwK5qYWKYDumDqxWWIknEQ+k= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= +github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-github/v27 v27.0.4/go.mod h1:/0Gr8pJ55COkmv+S/yPKCczSkUPIM/LnFyubufRNIS0= +github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/tebeka/selenium v0.9.9 h1:cNziB+etNgyH/7KlNI7RMC1ua5aH1+5wUlFQyzeMh+w= +github.com/tebeka/selenium v0.9.9/go.mod h1:5Fr8+pUvU6B1OiPfkdCKdXZyr5znvVkxuPd0NOdZCQc= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190624190245-7f2218787638/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190626174449-989357319d63/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/web_testing_go/webtest b/web_testing_go/webtest deleted file mode 120000 index 4fac5cc8..00000000 --- a/web_testing_go/webtest +++ /dev/null @@ -1 +0,0 @@ -/go/webtest \ No newline at end of file diff --git a/web_testing_go/webtest/BUILD.bazel b/web_testing_go/webtest/BUILD.bazel new file mode 100644 index 00000000..64f2aadd --- /dev/null +++ b/web_testing_go/webtest/BUILD.bazel @@ -0,0 +1,49 @@ +# Copyright 2017 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# +load("//web:go.bzl", "go_web_test_suite") +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +licenses(["notice"]) # Apache 2.0 + +go_library( + name = "go_default_library", + srcs = ["webtest.go"], + importpath = "github.com/bazelbuild/rules_webtesting/web_testing_go/webtest", + visibility = ["//visibility:public"], + deps = [ + "@rules_webtesting//go/bazel:go_default_library", + "@rules_webtesting//go/metadata:go_default_library", + "@com_github_tebeka_selenium//:go_default_library", + ], +) + +go_web_test_suite( + name = "go_default_test", + srcs = [ + "browserinfo_test.go", + "webtest_test.go", + ], + browsers = [ + "@rules_webtesting//browsers:chromium-local", + "@rules_webtesting//browsers:firefox-local", + "@rules_webtesting//browsers/sauce:chrome-win10", + "@rules_webtesting//browsers/sauce:chrome-win10-connect", + ], + data = ["@rules_webtesting//testdata"], + embed = [":go_default_library"], + deps = ["@com_github_tebeka_selenium//:go_default_library"], +) diff --git a/web_testing_go/webtest/browserinfo_test.go b/web_testing_go/webtest/browserinfo_test.go new file mode 120000 index 00000000..1ca84f79 --- /dev/null +++ b/web_testing_go/webtest/browserinfo_test.go @@ -0,0 +1 @@ +/usr/local/google/home/mollyibot/rules_webtesting03132/go/webtest/browserinfo_test.go \ No newline at end of file diff --git a/web_testing_go/webtest/webtest.go b/web_testing_go/webtest/webtest.go new file mode 120000 index 00000000..13b963fb --- /dev/null +++ b/web_testing_go/webtest/webtest.go @@ -0,0 +1 @@ +/usr/local/google/home/mollyibot/rules_webtesting03132/go/webtest/webtest.go \ No newline at end of file diff --git a/web_testing_go/webtest/webtest_test.go b/web_testing_go/webtest/webtest_test.go new file mode 120000 index 00000000..73363cbb --- /dev/null +++ b/web_testing_go/webtest/webtest_test.go @@ -0,0 +1 @@ +/usr/local/google/home/mollyibot/rules_webtesting03132/go/webtest/webtest_test.go \ No newline at end of file diff --git a/web_testing_scala/MODULE.bazel b/web_testing_scala/MODULE.bazel index 03fe5677..71e21aac 100644 --- a/web_testing_scala/MODULE.bazel +++ b/web_testing_scala/MODULE.bazel @@ -17,6 +17,15 @@ local_path_override( path = "../web_testing_go", ) +bazel_dep( + name = "rules_web_testing_java", +) + +local_path_override( + module_name = "rules_web_testing_java", + path = "../web_testing_java", +) + bazel_dep( name = "bazel_skylib", version = "1.7.1", diff --git a/web_testing_scala/scalatests/BUILD.bazel b/web_testing_scala/scalatests/BUILD.bazel index da190c10..b4cee0d7 100644 --- a/web_testing_scala/scalatests/BUILD.bazel +++ b/web_testing_scala/scalatests/BUILD.bazel @@ -30,6 +30,6 @@ scala_web_test_suite( deps = [ "@maven//:junit_junit", "@maven//:org_seleniumhq_selenium_selenium_api", - "@rules_webtesting//java/com/google/testing/web", + "@rules_web_testing_java//java/com/google/testing/web", ], ) From db3bfdfe0db8af9ca891988591488e720e1df2b5 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Thu, 20 Mar 2025 01:53:50 +0000 Subject: [PATCH 26/74] More polish --- MODULE.bazel | 5 - web_testing_go/MODULE.bazel | 2 +- web_testing_go/go.mod | 10 -- web_testing_go/go.sum | 114 --------------------- web_testing_go/webtest/browserinfo_test.go | 2 +- web_testing_go/webtest/webtest.go | 2 +- web_testing_go/webtest/webtest_test.go | 2 +- web_testing_java/MODULE.bazel | 5 - web_testing_python/MODULE.bazel | 5 - web_testing_scala/MODULE.bazel | 5 - 10 files changed, 4 insertions(+), 148 deletions(-) delete mode 100644 web_testing_go/go.mod delete mode 100644 web_testing_go/go.sum diff --git a/MODULE.bazel b/MODULE.bazel index e6a47e2b..d0880b5b 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -8,11 +8,6 @@ bazel_dep( version = "0.4.0", ) -local_path_override( - module_name = "rules_web_testing_go", - path = "web_testing_go", -) - bazel_dep(name = "bazel_skylib", version = "1.7.1") bazel_dep(name = "platforms", version = "0.0.10") diff --git a/web_testing_go/MODULE.bazel b/web_testing_go/MODULE.bazel index fe89678a..c50a63e8 100644 --- a/web_testing_go/MODULE.bazel +++ b/web_testing_go/MODULE.bazel @@ -27,7 +27,7 @@ bazel_dep(name = "gazelle", version = "0.40.0", repo_name = "bazel_gazelle") go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") -go_deps.from_file(go_mod = "//:go.mod") +go_deps.from_file(go_mod = "@rules_webtesting//:go.mod") # All *direct* Go dependencies of the module have to be listed explicitly. use_repo(go_deps, "com_github_gorilla_mux", "com_github_tebeka_selenium") \ No newline at end of file diff --git a/web_testing_go/go.mod b/web_testing_go/go.mod deleted file mode 100644 index 8c2aa93c..00000000 --- a/web_testing_go/go.mod +++ /dev/null @@ -1,10 +0,0 @@ -module github.com/bazelbuild/rules_webtesting - -go 1.17 - -require ( - github.com/gorilla/mux v1.8.1 - github.com/tebeka/selenium v0.9.9 -) - -require github.com/blang/semver v3.5.1+incompatible // indirect diff --git a/web_testing_go/go.sum b/web_testing_go/go.sum deleted file mode 100644 index e4f19c45..00000000 --- a/web_testing_go/go.sum +++ /dev/null @@ -1,114 +0,0 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.41.0/go.mod h1:OauMR7DV8fzvZIl2qg6rkaIhD/vmgk4iwEw/h6ercmg= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/BurntSushi/xgbutil v0.0.0-20160919175755-f7c97cef3b4e h1:4ZrkT/RzpnROylmoQL57iVUL57wGKTR5O6KpVnbm2tA= -github.com/BurntSushi/xgbutil v0.0.0-20160919175755-f7c97cef3b4e/go.mod h1:uw9h2sd4WWHOPdJ13MQpwK5qYWKYDumDqxWWIknEQ+k= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-github/v27 v27.0.4/go.mod h1:/0Gr8pJ55COkmv+S/yPKCczSkUPIM/LnFyubufRNIS0= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= -github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/tebeka/selenium v0.9.9 h1:cNziB+etNgyH/7KlNI7RMC1ua5aH1+5wUlFQyzeMh+w= -github.com/tebeka/selenium v0.9.9/go.mod h1:5Fr8+pUvU6B1OiPfkdCKdXZyr5znvVkxuPd0NOdZCQc= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624190245-7f2218787638/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190626174449-989357319d63/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/web_testing_go/webtest/browserinfo_test.go b/web_testing_go/webtest/browserinfo_test.go index 1ca84f79..22fad2ea 120000 --- a/web_testing_go/webtest/browserinfo_test.go +++ b/web_testing_go/webtest/browserinfo_test.go @@ -1 +1 @@ -/usr/local/google/home/mollyibot/rules_webtesting03132/go/webtest/browserinfo_test.go \ No newline at end of file +../../go/webtest/browserinfo_test.go \ No newline at end of file diff --git a/web_testing_go/webtest/webtest.go b/web_testing_go/webtest/webtest.go index 13b963fb..080357e1 120000 --- a/web_testing_go/webtest/webtest.go +++ b/web_testing_go/webtest/webtest.go @@ -1 +1 @@ -/usr/local/google/home/mollyibot/rules_webtesting03132/go/webtest/webtest.go \ No newline at end of file +../../go/webtest/webtest.go \ No newline at end of file diff --git a/web_testing_go/webtest/webtest_test.go b/web_testing_go/webtest/webtest_test.go index 73363cbb..acabea0e 120000 --- a/web_testing_go/webtest/webtest_test.go +++ b/web_testing_go/webtest/webtest_test.go @@ -1 +1 @@ -/usr/local/google/home/mollyibot/rules_webtesting03132/go/webtest/webtest_test.go \ No newline at end of file +../../go/webtest/webtest_test.go \ No newline at end of file diff --git a/web_testing_java/MODULE.bazel b/web_testing_java/MODULE.bazel index 4cee4ab4..8e7f6b39 100644 --- a/web_testing_java/MODULE.bazel +++ b/web_testing_java/MODULE.bazel @@ -12,11 +12,6 @@ local_path_override( path = "..", ) -local_path_override( - module_name = "rules_web_testing_go", - path = "../web_testing_go", -) - bazel_dep( name = "bazel_skylib", version = "1.7.1", diff --git a/web_testing_python/MODULE.bazel b/web_testing_python/MODULE.bazel index 0d091c3d..28f33dad 100644 --- a/web_testing_python/MODULE.bazel +++ b/web_testing_python/MODULE.bazel @@ -17,11 +17,6 @@ local_path_override( path = "..", ) -local_path_override( - module_name = "rules_web_testing_go", - path = "../web_testing_go", -) - bazel_dep( name = "rules_python", version = "1.0.0", diff --git a/web_testing_scala/MODULE.bazel b/web_testing_scala/MODULE.bazel index 71e21aac..d76126e7 100644 --- a/web_testing_scala/MODULE.bazel +++ b/web_testing_scala/MODULE.bazel @@ -21,11 +21,6 @@ bazel_dep( name = "rules_web_testing_java", ) -local_path_override( - module_name = "rules_web_testing_java", - path = "../web_testing_java", -) - bazel_dep( name = "bazel_skylib", version = "1.7.1", From 6aa748f210dab55c0c9709ab09c3772af52d9ca4 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Thu, 20 Mar 2025 04:26:26 +0000 Subject: [PATCH 27/74] Change sym link --- MODULE.bazel | 5 --- go/web/BUILD.bazel | 32 +++++++++++++++++ go/web/go.bzl | 33 ++++++++++++++++++ go/webdriver/BUILD.bazel | 2 +- go/webtest/BUILD.bazel | 2 +- go/wtl/proxy/BUILD.bazel | 2 +- .../proxy/driverhub/quithandler/BUILD.bazel | 2 +- .../proxy/driverhub/scripttimeout/BUILD.bazel | 2 +- web_testing_go/web/BUILD.bazel | 33 +----------------- web_testing_go/web/go.bzl | 34 +------------------ web_testing_scala/MODULE.bazel | 5 --- 11 files changed, 72 insertions(+), 80 deletions(-) create mode 100644 go/web/BUILD.bazel create mode 100644 go/web/go.bzl mode change 100644 => 120000 web_testing_go/web/BUILD.bazel mode change 100644 => 120000 web_testing_go/web/go.bzl diff --git a/MODULE.bazel b/MODULE.bazel index d0880b5b..ac865778 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -3,11 +3,6 @@ module( version = "0.4.0", ) -bazel_dep( - name = "rules_web_testing_go", - version = "0.4.0", -) - bazel_dep(name = "bazel_skylib", version = "1.7.1") bazel_dep(name = "platforms", version = "0.0.10") diff --git a/go/web/BUILD.bazel b/go/web/BUILD.bazel new file mode 100644 index 00000000..de41e9e4 --- /dev/null +++ b/go/web/BUILD.bazel @@ -0,0 +1,32 @@ +# Copyright 2016 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("@rules_webtesting//web:web.bzl", "web_test_config") + +package( + default_testonly = True, + default_visibility = ["//visibility:public"], +) + +bzl_library( + name = "go", + srcs = ["go.bzl"], + deps = [ + "@rules_webtesting//web/internal:wrap_web_test_suite", + # should depend on @io_bazel_rules_go//go:def.bzl + ], +) diff --git a/go/web/go.bzl b/go/web/go.bzl new file mode 100644 index 00000000..183226b8 --- /dev/null +++ b/go/web/go.bzl @@ -0,0 +1,33 @@ +# Copyright 2016 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""Web Test rules for Go.""" + +load("@io_bazel_rules_go//go:def.bzl", "go_test") +load("@rules_webtesting//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") +load("@rules_webtesting//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") + +def go_web_test_suite(name, go_test_tags = DEFAULT_WRAPPED_TEST_TAGS, **kwargs): + """Defines a test_suite of web_test targets that wrap a go_test target. + + Args: + name: The base name of the test. + go_test_tags: A list of test tag strings to use for the go_test target. + **kwargs: Arguments for wrapped_web_test_suite + """ + wrap_web_test_suite( + name = name, + rule = go_test, + wrapped_test_tags = go_test_tags, + **kwargs + ) diff --git a/go/webdriver/BUILD.bazel b/go/webdriver/BUILD.bazel index d25279a8..ce446db1 100644 --- a/go/webdriver/BUILD.bazel +++ b/go/webdriver/BUILD.bazel @@ -14,7 +14,7 @@ # ################################################################################ # -load("@rules_web_testing_go//web:go.bzl", "go_web_test_suite") +load("//go/web:go.bzl", "go_web_test_suite") load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/go/webtest/BUILD.bazel b/go/webtest/BUILD.bazel index a4f5056a..b4b5d474 100644 --- a/go/webtest/BUILD.bazel +++ b/go/webtest/BUILD.bazel @@ -14,7 +14,7 @@ # ################################################################################ # -load("@rules_web_testing_go//web:go.bzl", "go_web_test_suite") +load("//go/web:go.bzl", "go_web_test_suite") load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/go/wtl/proxy/BUILD.bazel b/go/wtl/proxy/BUILD.bazel index 52c87858..d6d36f54 100644 --- a/go/wtl/proxy/BUILD.bazel +++ b/go/wtl/proxy/BUILD.bazel @@ -14,7 +14,7 @@ # ################################################################################ # -load("@rules_web_testing_go//web:go.bzl", "go_web_test_suite") +load("//go/web:go.bzl", "go_web_test_suite") load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/go/wtl/proxy/driverhub/quithandler/BUILD.bazel b/go/wtl/proxy/driverhub/quithandler/BUILD.bazel index 7e90b9ce..e1e1b0a9 100644 --- a/go/wtl/proxy/driverhub/quithandler/BUILD.bazel +++ b/go/wtl/proxy/driverhub/quithandler/BUILD.bazel @@ -14,7 +14,7 @@ # ################################################################################ # -load("@rules_web_testing_go//web:go.bzl", "go_web_test_suite") +load("//go/web:go.bzl", "go_web_test_suite") load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel b/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel index c037a326..6908eebe 100644 --- a/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel +++ b/go/wtl/proxy/driverhub/scripttimeout/BUILD.bazel @@ -14,7 +14,7 @@ # ################################################################################ # -load("@rules_web_testing_go//web:go.bzl", "go_web_test_suite") +load("//go/web:go.bzl", "go_web_test_suite") load("@io_bazel_rules_go//go:def.bzl", "go_library") licenses(["notice"]) # Apache 2.0 diff --git a/web_testing_go/web/BUILD.bazel b/web_testing_go/web/BUILD.bazel deleted file mode 100644 index de41e9e4..00000000 --- a/web_testing_go/web/BUILD.bazel +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2016 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -################################################################################ -# -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") -load("@rules_webtesting//web:web.bzl", "web_test_config") - -package( - default_testonly = True, - default_visibility = ["//visibility:public"], -) - -bzl_library( - name = "go", - srcs = ["go.bzl"], - deps = [ - "@rules_webtesting//web/internal:wrap_web_test_suite", - # should depend on @io_bazel_rules_go//go:def.bzl - ], -) diff --git a/web_testing_go/web/BUILD.bazel b/web_testing_go/web/BUILD.bazel new file mode 120000 index 00000000..f6298d4c --- /dev/null +++ b/web_testing_go/web/BUILD.bazel @@ -0,0 +1 @@ +../../go/web/BUILD.bazel \ No newline at end of file diff --git a/web_testing_go/web/go.bzl b/web_testing_go/web/go.bzl deleted file mode 100644 index 183226b8..00000000 --- a/web_testing_go/web/go.bzl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2016 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Web Test rules for Go.""" - -load("@io_bazel_rules_go//go:def.bzl", "go_test") -load("@rules_webtesting//web/internal:constants.bzl", "DEFAULT_WRAPPED_TEST_TAGS") -load("@rules_webtesting//web/internal:wrap_web_test_suite.bzl", "wrap_web_test_suite") - -def go_web_test_suite(name, go_test_tags = DEFAULT_WRAPPED_TEST_TAGS, **kwargs): - """Defines a test_suite of web_test targets that wrap a go_test target. - - Args: - name: The base name of the test. - go_test_tags: A list of test tag strings to use for the go_test target. - **kwargs: Arguments for wrapped_web_test_suite - """ - wrap_web_test_suite( - name = name, - rule = go_test, - wrapped_test_tags = go_test_tags, - **kwargs - ) diff --git a/web_testing_go/web/go.bzl b/web_testing_go/web/go.bzl new file mode 120000 index 00000000..821f7f6d --- /dev/null +++ b/web_testing_go/web/go.bzl @@ -0,0 +1 @@ +../../go/web/go.bzl \ No newline at end of file diff --git a/web_testing_scala/MODULE.bazel b/web_testing_scala/MODULE.bazel index d76126e7..4683f447 100644 --- a/web_testing_scala/MODULE.bazel +++ b/web_testing_scala/MODULE.bazel @@ -12,11 +12,6 @@ local_path_override( path = "..", ) -local_path_override( - module_name = "rules_web_testing_go", - path = "../web_testing_go", -) - bazel_dep( name = "rules_web_testing_java", ) From 8a3b2528688195318c3633d6b2afbff54f81d592 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Thu, 20 Mar 2025 20:59:33 +0000 Subject: [PATCH 28/74] Modify readme --- .bazelci/presubmit.yml | 24 ++++++++++++------------ README.md | 8 ++++++-- go/web/BUILD.bazel | 2 +- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 8e01199f..3e62d8a0 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -26,7 +26,7 @@ platforms: - "//..." tasks: web_testing_go_ubuntu2004: - name: "Go workspace for web in ubuntu" + name: "rules_web_testing_go in ubuntu" platform: ubuntu2004 test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" @@ -34,7 +34,7 @@ tasks: test_targets: ["//..."] working_directory: web_testing_go web_testing_go_macos: - name: "Go workspace for web in macos" + name: "rules_web_testing_go in macos" platform: macos test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" @@ -42,7 +42,7 @@ tasks: test_targets: [ "//..." ] working_directory: web_testing_go web_testing_go_windows: - name: "Go workspace for web in windows" + name: "rules_web_testing_go in windows" platform: windows test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" @@ -50,7 +50,7 @@ tasks: test_targets: [ "//..." ] working_directory: web_testing_go web_testing_scala_ubuntu2004: - name: "Scala workspace for web in ubuntu" + name: "rules_web_testing_scala in ubuntu" platform: ubuntu2004 test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" @@ -58,7 +58,7 @@ tasks: test_targets: ["//..."] working_directory: web_testing_scala web_testing_scala_macos: - name: "Scala workspace for web in macos" + name: "rules_web_testing_scala in macos" platform: macos test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" @@ -66,7 +66,7 @@ tasks: test_targets: [ "//..." ] working_directory: web_testing_scala web_testing_scala_windows: - name: "Scala workspace for web in windows" + name: "rules_web_testing_scala in windows" platform: windows test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" @@ -74,7 +74,7 @@ tasks: test_targets: [ "//..." ] working_directory: web_testing_scala web_testing_java_ubuntu2004: - name: "Java workspace for web in ubuntu" + name: "rules_web_testing_java in ubuntu" platform: ubuntu2004 test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" @@ -82,7 +82,7 @@ tasks: test_targets: [ "//..." ] working_directory: web_testing_java web_testing_java_macos: - name: "Java workspace for web in macos" + name: "rules_web_testing_java in macos" platform: macos test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" @@ -90,7 +90,7 @@ tasks: test_targets: [ "//..." ] working_directory: web_testing_java web_testing_java_windows: - name: "Java workspace for web in windows" + name: "rules_web_testing_java in windows" platform: windows test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" @@ -98,7 +98,7 @@ tasks: test_targets: [ "//..." ] working_directory: web_testing_java web_testing_python_ubuntu2004: - name: "Python workspace for web in ubuntu" + name: "rules_web_testing_python in ubuntu" platform: ubuntu2004 test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" @@ -106,7 +106,7 @@ tasks: test_targets: [ "//..." ] working_directory: web_testing_python web_testing_python_macos: - name: "Python workspace for web in macos" + name: "rules_web_testing_python in macos" platform: macos test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" @@ -114,7 +114,7 @@ tasks: test_targets: [ "//..." ] working_directory: web_testing_python web_testing_python_windows: - name: "Python workspace for web in windows" + name: "rules_web_testing_python in windows" platform: windows test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" diff --git a/README.md b/README.md index adf6569c..e665b0b4 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,14 @@ WebDriver. ## Configure your Bazel project -For all languages, you need to add the following to your MODULE.bazel file: +For each language , you need to add the following to your MODULE.bazel file: ```bzl -bazel_dep(name = "rules_webtesting", version = "0.4.0") +bazel_dep(name = "rules_webtesting_${language}", version = "0.4.0") +``` +For example for Java: +```bzl +bazel_dep(name = "rules_webtesting_java", version = "0.4.0") ``` ## Write your tests diff --git a/go/web/BUILD.bazel b/go/web/BUILD.bazel index de41e9e4..10e32208 100644 --- a/go/web/BUILD.bazel +++ b/go/web/BUILD.bazel @@ -19,7 +19,7 @@ load("@rules_webtesting//web:web.bzl", "web_test_config") package( default_testonly = True, - default_visibility = ["//visibility:public"], + default_visibility = ["//go:__subpackages__"], ) bzl_library( From a2c2afc1aed5ec3a8650f160fa5ddcd7e2cb3b63 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Fri, 21 Mar 2025 04:22:12 +0000 Subject: [PATCH 29/74] Modify ReadMe --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e665b0b4..c0e84d03 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ import ( "testing" "github.com/tebeka/selenium" - "github.com/bazelbuild/rules_webtesting/go/webtest" + "github.com/bazelbuild/rules_web_testing_go/webtest" ) func TestWebApp(t *testing.T) { @@ -104,7 +104,7 @@ In your BUILD files, load the correct language specific build rule and create a test target using it: ```bzl -load("@rules_webtesting//web:py.bzl", "py_web_test_suite") +load("@rules_web_testing_python//web:py.bzl", "py_web_test_suite") py_web_test_suite( name = "browser_test", From 20c4e73a08ffe2250fd9298adda68e49f7ad1976 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Sat, 22 Mar 2025 01:13:23 +0000 Subject: [PATCH 30/74] Modify the module --- web_testing_scala/MODULE.bazel | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web_testing_scala/MODULE.bazel b/web_testing_scala/MODULE.bazel index 4683f447..b9a095cd 100644 --- a/web_testing_scala/MODULE.bazel +++ b/web_testing_scala/MODULE.bazel @@ -16,6 +16,11 @@ bazel_dep( name = "rules_web_testing_java", ) +local_path_override( + module_name = "rules_web_testing_java", + path = "../web_testing_java", +) + bazel_dep( name = "bazel_skylib", version = "1.7.1", From 40deb589bd7a8a7baf399c516b2bb96d1a72fa29 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Sat, 22 Mar 2025 01:43:59 +0000 Subject: [PATCH 31/74] Modify presubmit yml --- .bazelci/presubmit.yml | 48 +++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 3e62d8a0..418dc50a 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -30,94 +30,94 @@ tasks: platform: ubuntu2004 test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" - build_targets: ["//..."] - test_targets: ["//..."] + build_targets: ["..."] + test_targets: ["..."] working_directory: web_testing_go web_testing_go_macos: name: "rules_web_testing_go in macos" platform: macos test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" - build_targets: [ "//..." ] - test_targets: [ "//..." ] + build_targets: [ "..." ] + test_targets: [ "..." ] working_directory: web_testing_go web_testing_go_windows: name: "rules_web_testing_go in windows" platform: windows test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" - build_targets: [ "//..." ] - test_targets: [ "//..." ] + build_targets: [ "..." ] + test_targets: [ "..." ] working_directory: web_testing_go web_testing_scala_ubuntu2004: name: "rules_web_testing_scala in ubuntu" platform: ubuntu2004 test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" - build_targets: ["//..."] - test_targets: ["//..."] + build_targets: ["..."] + test_targets: ["..."] working_directory: web_testing_scala web_testing_scala_macos: name: "rules_web_testing_scala in macos" platform: macos test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" - build_targets: [ "//..." ] - test_targets: [ "//..." ] + build_targets: [ "..." ] + test_targets: [ "..." ] working_directory: web_testing_scala web_testing_scala_windows: name: "rules_web_testing_scala in windows" platform: windows test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" - build_targets: [ "//..." ] - test_targets: [ "//..." ] + build_targets: [ "..." ] + test_targets: [ "..." ] working_directory: web_testing_scala web_testing_java_ubuntu2004: name: "rules_web_testing_java in ubuntu" platform: ubuntu2004 test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" - build_targets: [ "//..." ] - test_targets: [ "//..." ] + build_targets: [ "..." ] + test_targets: [ "..." ] working_directory: web_testing_java web_testing_java_macos: name: "rules_web_testing_java in macos" platform: macos test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" - build_targets: [ "//..." ] - test_targets: [ "//..." ] + build_targets: [ "..." ] + test_targets: [ "..." ] working_directory: web_testing_java web_testing_java_windows: name: "rules_web_testing_java in windows" platform: windows test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" - build_targets: [ "//..." ] - test_targets: [ "//..." ] + build_targets: [ "..." ] + test_targets: [ "..." ] working_directory: web_testing_java web_testing_python_ubuntu2004: name: "rules_web_testing_python in ubuntu" platform: ubuntu2004 test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" - build_targets: [ "//..." ] - test_targets: [ "//..." ] + build_targets: [ "..." ] + test_targets: [ "..." ] working_directory: web_testing_python web_testing_python_macos: name: "rules_web_testing_python in macos" platform: macos test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" - build_targets: [ "//..." ] - test_targets: [ "//..." ] + build_targets: [ "..." ] + test_targets: [ "..." ] working_directory: web_testing_python web_testing_python_windows: name: "rules_web_testing_python in windows" platform: windows test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" - build_targets: [ "//..." ] - test_targets: [ "//..." ] + build_targets: [ "..." ] + test_targets: [ "..." ] working_directory: web_testing_python From 42c9f96601a6ee453e090f85fdc213e3bcf15b61 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Mon, 24 Mar 2025 06:33:10 +0000 Subject: [PATCH 32/74] Copy build file --- web_testing_go/web/BUILD.bazel | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) mode change 120000 => 100644 web_testing_go/web/BUILD.bazel diff --git a/web_testing_go/web/BUILD.bazel b/web_testing_go/web/BUILD.bazel deleted file mode 120000 index f6298d4c..00000000 --- a/web_testing_go/web/BUILD.bazel +++ /dev/null @@ -1 +0,0 @@ -../../go/web/BUILD.bazel \ No newline at end of file diff --git a/web_testing_go/web/BUILD.bazel b/web_testing_go/web/BUILD.bazel new file mode 100644 index 00000000..de41e9e4 --- /dev/null +++ b/web_testing_go/web/BUILD.bazel @@ -0,0 +1,32 @@ +# Copyright 2016 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("@rules_webtesting//web:web.bzl", "web_test_config") + +package( + default_testonly = True, + default_visibility = ["//visibility:public"], +) + +bzl_library( + name = "go", + srcs = ["go.bzl"], + deps = [ + "@rules_webtesting//web/internal:wrap_web_test_suite", + # should depend on @io_bazel_rules_go//go:def.bzl + ], +) From 315cb809e0e9f496ff8876d2bc9bce27de1a83e0 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Thu, 8 May 2025 18:25:50 +0000 Subject: [PATCH 33/74] Modify presubmit yml and setup.sh --- .bazelci/presubmit.yml | 74 +++++++++++++++++++++++++++--------------- setup.sh | 50 ++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+), 26 deletions(-) create mode 100644 setup.sh diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 418dc50a..4b2e68ee 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -1,20 +1,22 @@ --- -platforms: - ubuntu2204: - build_targets: - - "//..." +tasks: + web_testing_ubuntu2004: + name: "rules_webtesting test in ubuntu" + platform: ubuntu2004 test_flags: - "--test_tag_filters=-noci,-external,-native,-sauce" test_targets: - "//..." - macos: - build_targets: - - "//..." + web_testing_macos: + name: "rules_webtesting test in ubuntu" + platform: macos test_flags: - - "--test_tag_filters=-noci,-sauce,-external,-native" + - "--test_tag_filters=-noci,-external,-native,-sauce" test_targets: - "//..." - windows: + web_testing_windows: + name: "rules_webtesting test in windows" + platform: windows build_flags: - "--enable_runfiles" build_targets: @@ -24,20 +26,23 @@ platforms: - "--enable_runfiles" test_targets: - "//..." -tasks: web_testing_go_ubuntu2004: name: "rules_web_testing_go in ubuntu" platform: ubuntu2004 + shell_commands: + - "sh ../setup.sh" test_flags: - - "--test_tag_filters=-noci,-external,-native,-sauce" - build_targets: ["..."] - test_targets: ["..."] + - "--test_tag_filters=-noci,-sauce" + - "--test_timeout=60" + build_targets: [ "..." ] + test_targets: [ "..." ] working_directory: web_testing_go web_testing_go_macos: name: "rules_web_testing_go in macos" platform: macos test_flags: - - "--test_tag_filters=-noci,-external,-native,-sauce" + - "--test_tag_filters=-noci,-sauce,-external,-native" + - "--test_timeout=60" build_targets: [ "..." ] test_targets: [ "..." ] working_directory: web_testing_go @@ -45,23 +50,29 @@ tasks: name: "rules_web_testing_go in windows" platform: windows test_flags: - - "--test_tag_filters=-noci,-external,-native,-sauce" + - "--test_tag_filters=-noci,-sauce" + - "--test_timeout=60" + - "--enable_runfiles" build_targets: [ "..." ] test_targets: [ "..." ] working_directory: web_testing_go web_testing_scala_ubuntu2004: name: "rules_web_testing_scala in ubuntu" platform: ubuntu2004 + shell_commands: + - "sh ../setup.sh" test_flags: - - "--test_tag_filters=-noci,-external,-native,-sauce" - build_targets: ["..."] - test_targets: ["..."] + - "--test_tag_filters=-noci,-sauce" + - "--test_timeout=60" + build_targets: [ "..." ] + test_targets: [ "..." ] working_directory: web_testing_scala web_testing_scala_macos: name: "rules_web_testing_scala in macos" platform: macos test_flags: - - "--test_tag_filters=-noci,-external,-native,-sauce" + - "--test_tag_filters=-noci,-sauce,-external,-native" + - "--test_timeout=60" build_targets: [ "..." ] test_targets: [ "..." ] working_directory: web_testing_scala @@ -69,15 +80,19 @@ tasks: name: "rules_web_testing_scala in windows" platform: windows test_flags: - - "--test_tag_filters=-noci,-external,-native,-sauce" + - "--test_tag_filters=-noci,-sauce" + - "--test_timeout=60" build_targets: [ "..." ] test_targets: [ "..." ] working_directory: web_testing_scala web_testing_java_ubuntu2004: name: "rules_web_testing_java in ubuntu" platform: ubuntu2004 + shell_commands: + - "sh ../setup.sh" test_flags: - - "--test_tag_filters=-noci,-external,-native,-sauce" + - "--test_tag_filters=-noci,-sauce" + - "--test_timeout=60" build_targets: [ "..." ] test_targets: [ "..." ] working_directory: web_testing_java @@ -85,7 +100,8 @@ tasks: name: "rules_web_testing_java in macos" platform: macos test_flags: - - "--test_tag_filters=-noci,-external,-native,-sauce" + - "--test_tag_filters=-noci,-sauce,-external,-native" + - "--test_timeout=60" build_targets: [ "..." ] test_targets: [ "..." ] working_directory: web_testing_java @@ -93,15 +109,19 @@ tasks: name: "rules_web_testing_java in windows" platform: windows test_flags: - - "--test_tag_filters=-noci,-external,-native,-sauce" + - "--test_tag_filters=-noci,-sauce" + - "--test_timeout=60" build_targets: [ "..." ] test_targets: [ "..." ] working_directory: web_testing_java web_testing_python_ubuntu2004: name: "rules_web_testing_python in ubuntu" platform: ubuntu2004 + shell_commands: + - "sh ../setup.sh" test_flags: - - "--test_tag_filters=-noci,-external,-native,-sauce" + - "--test_tag_filters=-noci,-sauce" + - "--test_timeout=60" build_targets: [ "..." ] test_targets: [ "..." ] working_directory: web_testing_python @@ -109,7 +129,8 @@ tasks: name: "rules_web_testing_python in macos" platform: macos test_flags: - - "--test_tag_filters=-noci,-external,-native,-sauce" + - "--test_tag_filters=-noci,-sauce,-external,-native" + - "--test_timeout=60" build_targets: [ "..." ] test_targets: [ "..." ] working_directory: web_testing_python @@ -117,7 +138,8 @@ tasks: name: "rules_web_testing_python in windows" platform: windows test_flags: - - "--test_tag_filters=-noci,-external,-native,-sauce" + - "--test_tag_filters=-noci,-sauce" + - "--test_timeout=60" build_targets: [ "..." ] test_targets: [ "..." ] working_directory: web_testing_python diff --git a/setup.sh b/setup.sh new file mode 100644 index 00000000..ec17453b --- /dev/null +++ b/setup.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Copyright 2025 Google Inc. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Script that can be used by CI server for testing j2cl builds. +set -ex +sudo apt -y update && sudo apt -y install libasound2 +sudo apt -y install libdbus-glib-1-2 +sudo apt -y install libatk-bridge2.0-0 +sudo apt -y install libatk1.0-0 +sudo apt -y install libc6 +sudo apt -y install libcairo2 +sudo apt -y install libcups2 +sudo apt -y install libdbus-1-3 +sudo apt -y install libexpat1 +sudo apt -y install libfontconfig1 +sudo apt -y install libgbm1 +sudo apt -y install libgcc1 +sudo apt -y install libglib2.0-0 +sudo apt -y install libgtk-3-0 +sudo apt -y install libnspr4 +sudo apt -y install libnss3 +sudo apt -y install libpango-1.0-0 +sudo apt -y install libpangocairo-1.0-0 +sudo apt -y install libstdc++6 +sudo apt -y install libx11-6 +sudo apt -y install libx11-xcb1 +sudo apt -y install libxcb1 +sudo apt -y install libxcomposite1 +sudo apt -y install libxcursor1 +sudo apt -y install libxdamage1 +sudo apt -y install libxext6 +sudo apt -y install libxfixes3 +sudo apt -y install libxi6 +sudo apt -y install libxrandr2 +sudo apt -y install libxrender1 +sudo apt -y install libxss1 +sudo apt -y install libxtst6 +sudo apt install libgtk-3-0 \ No newline at end of file From b76ec90302b67e91fa671a14564234f42a2c946e Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Thu, 8 May 2025 19:03:49 +0000 Subject: [PATCH 34/74] Modify local firefox json --- browsers/firefox-local.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/browsers/firefox-local.json b/browsers/firefox-local.json index 849aa1c4..93ad2664 100644 --- a/browsers/firefox-local.json +++ b/browsers/firefox-local.json @@ -12,8 +12,12 @@ "args": [ "--port=%WSLPORT:WSL%", "--host=%WSL:HOST_IP%", - "--marionette-port=%WSLPORT:MARIONETTE%" + "--marionette-port=%WSLPORT:MARIONETTE%", + "-vv" ], + "env": { + "HOME": "%ENV:TEST_TMPDIR%" + }, "status": true, "shutdown": false } From f1e0aa96531f62063b54e8fa40e05bb135b70c71 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Thu, 8 May 2025 19:11:29 +0000 Subject: [PATCH 35/74] Update presubmit to remove macos related tests --- .bazelci/presubmit.yml | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 4b2e68ee..9689b726 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -37,15 +37,6 @@ tasks: build_targets: [ "..." ] test_targets: [ "..." ] working_directory: web_testing_go - web_testing_go_macos: - name: "rules_web_testing_go in macos" - platform: macos - test_flags: - - "--test_tag_filters=-noci,-sauce,-external,-native" - - "--test_timeout=60" - build_targets: [ "..." ] - test_targets: [ "..." ] - working_directory: web_testing_go web_testing_go_windows: name: "rules_web_testing_go in windows" platform: windows @@ -67,15 +58,6 @@ tasks: build_targets: [ "..." ] test_targets: [ "..." ] working_directory: web_testing_scala - web_testing_scala_macos: - name: "rules_web_testing_scala in macos" - platform: macos - test_flags: - - "--test_tag_filters=-noci,-sauce,-external,-native" - - "--test_timeout=60" - build_targets: [ "..." ] - test_targets: [ "..." ] - working_directory: web_testing_scala web_testing_scala_windows: name: "rules_web_testing_scala in windows" platform: windows @@ -96,15 +78,6 @@ tasks: build_targets: [ "..." ] test_targets: [ "..." ] working_directory: web_testing_java - web_testing_java_macos: - name: "rules_web_testing_java in macos" - platform: macos - test_flags: - - "--test_tag_filters=-noci,-sauce,-external,-native" - - "--test_timeout=60" - build_targets: [ "..." ] - test_targets: [ "..." ] - working_directory: web_testing_java web_testing_java_windows: name: "rules_web_testing_java in windows" platform: windows @@ -125,15 +98,6 @@ tasks: build_targets: [ "..." ] test_targets: [ "..." ] working_directory: web_testing_python - web_testing_python_macos: - name: "rules_web_testing_python in macos" - platform: macos - test_flags: - - "--test_tag_filters=-noci,-sauce,-external,-native" - - "--test_timeout=60" - build_targets: [ "..." ] - test_targets: [ "..." ] - working_directory: web_testing_python web_testing_python_windows: name: "rules_web_testing_python in windows" platform: windows From 307967474993a213b106e4c66628c29d02f5be34 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Thu, 8 May 2025 20:22:28 +0000 Subject: [PATCH 36/74] Upgrade browser version --- browsers/BUILD.bazel | 3 --- web/versioned/browsers-0.3.4.bzl | 15 ++++++--------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/browsers/BUILD.bazel b/browsers/BUILD.bazel index f8d5a280..ada9253b 100644 --- a/browsers/BUILD.bazel +++ b/browsers/BUILD.bazel @@ -50,9 +50,6 @@ browser( browser( name = "chromium-local", metadata = "chromium-local.json", - required_tags = [ - "native", - ], deps = [ "//go/wsl", "//third_party/chromedriver", diff --git a/web/versioned/browsers-0.3.4.bzl b/web/versioned/browsers-0.3.4.bzl index 6c5c5e43..91d0811e 100644 --- a/web/versioned/browsers-0.3.4.bzl +++ b/web/versioned/browsers-0.3.4.bzl @@ -174,11 +174,10 @@ def org_mozilla_firefox(): platform_archive( name = "org_mozilla_firefox_linux_x64", licenses = ["reciprocal"], # MPL 2.0 - sha256 = "3d0f74790fe6ff5e38324222ab0c47e10edb31970ed67c6dd7a1c84e7017d1a5", + sha256 = "878a042f49ee34314bde9ca70a0f93c0941c247c72f17b87d904024bef2b27ad", # Firefox v97.0 urls = [ - "https://ftp.mozilla.org/pub/firefox/releases/97.0/linux-x86_64/en-US/firefox-97.0.tar.bz2", - "https://storage.googleapis.com/dev-infra-mirror/firefox/97.0/linux_x64/browser-bin.tar.bz2", + "https://ftp.mozilla.org/pub/firefox/releases/129.0/linux-x86_64/en-US/firefox-129.0.tar.bz2", ], named_files = { "FIREFOX": "firefox/firefox", @@ -188,11 +187,10 @@ def org_mozilla_firefox(): platform_archive( name = "org_mozilla_firefox_macos_x64", licenses = ["reciprocal"], # MPL 2.0 - sha256 = "c06c4e58179acaf55d05c3be41d0d4cdd68f811a75322a39557d91121aa2ef74", + sha256 = "4b86e9de2b26339b30342a1ef3be1e3914d70921f81fd67bc9c63595823051f1", # Firefox v97.0 urls = [ - "https://ftp.mozilla.org/pub/firefox/releases/97.0/mac/en-US/Firefox%2097.0.dmg", - "https://storage.googleapis.com/dev-infra-mirror/firefox/97.0/mac_x64/browser-bin.dmg", + "https://ftp.mozilla.org/pub/firefox/releases/129.0/mac/en-US/Firefox%20129.0.dmg", ], named_files = { "FIREFOX": "Firefox.app/Contents/MacOS/firefox", @@ -205,11 +203,10 @@ def org_mozilla_firefox(): # repositories to allow for dedicated ARM/x64 binaries if needed in the future. name = "org_mozilla_firefox_macos_arm64", licenses = ["reciprocal"], # MPL 2.0 - sha256 = "c06c4e58179acaf55d05c3be41d0d4cdd68f811a75322a39557d91121aa2ef74", + sha256 = "4b86e9de2b26339b30342a1ef3be1e3914d70921f81fd67bc9c63595823051f1", # Firefox v97.0 urls = [ - "https://ftp.mozilla.org/pub/firefox/releases/97.0/mac/en-US/Firefox%2097.0.dmg", - "https://storage.googleapis.com/dev-infra-mirror/firefox/97.0/mac_x64/browser-bin.dmg", + "https://ftp.mozilla.org/pub/firefox/releases/129.0/mac/en-US/Firefox%20129.0.dmg", ], named_files = { "FIREFOX": "Firefox.app/Contents/MacOS/firefox", From 1ea48e7553284893d5a73e259a0d26e651063332 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Thu, 8 May 2025 23:36:21 +0000 Subject: [PATCH 37/74] Downgrade selenium version --- web_testing_python/requirements.in | 2 +- web_testing_python/requirements_lock.txt | 65 +-------- .../requirements_lock_windows.txt | 138 +----------------- 3 files changed, 9 insertions(+), 196 deletions(-) diff --git a/web_testing_python/requirements.in b/web_testing_python/requirements.in index 72e055f5..600b6ebb 100644 --- a/web_testing_python/requirements.in +++ b/web_testing_python/requirements.in @@ -1 +1 @@ -selenium==4.27.1 +selenium==3.141.0 diff --git a/web_testing_python/requirements_lock.txt b/web_testing_python/requirements_lock.txt index 69896c17..9585b334 100644 --- a/web_testing_python/requirements_lock.txt +++ b/web_testing_python/requirements_lock.txt @@ -4,68 +4,11 @@ # # bazel run //:requirements.update # -attrs==24.2.0 \ - --hash=sha256:5cfb1b9148b5b086569baec03f20d7b6bf3bcacc9a42bebf87ffaaca362f6346 \ - --hash=sha256:81921eb96de3191c8258c199618104dd27ac608d9366f5e35d011eae1867ede2 - # via - # outcome - # trio -certifi==2024.8.30 \ - --hash=sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8 \ - --hash=sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9 - # via selenium -h11==0.16.0 \ - --hash=sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1 \ - --hash=sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86 - # via wsproto -idna==3.10 \ - --hash=sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9 \ - --hash=sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3 - # via trio -outcome==1.3.0.post0 \ - --hash=sha256:9dcf02e65f2971b80047b377468e72a268e15c0af3cf1238e6ff14f7f91143b8 \ - --hash=sha256:e771c5ce06d1415e356078d3bdd68523f284b4ce5419828922b6871e65eda82b - # via trio -pysocks==1.7.1 \ - --hash=sha256:08e69f092cc6dbe92a0fdd16eeb9b9ffbc13cadfe5ca4c7bd92ffb078b293299 \ - --hash=sha256:2725bd0a9925919b9b51739eea5f9e2bae91e83288108a9ad338b2e3a4435ee5 \ - --hash=sha256:3f8804571ebe159c380ac6de37643bb4685970655d3bba243530d6558b799aa0 - # via urllib3 -selenium==4.27.1 \ - --hash=sha256:5296c425a75ff1b44d0d5199042b36a6d1ef76c04fb775b97b40be739a9caae2 \ - --hash=sha256:b89b1f62b5cfe8025868556fe82360d6b649d464f75d2655cb966c8f8447ea18 +selenium==3.141.0 \ + --hash=sha256:2d7131d7bc5a5b99a2d9b04aaf2612c411b03b8ca1b1ee8d3de5845a9be2cb3c \ + --hash=sha256:deaf32b60ad91a4611b98d8002757f29e6f2c2d5fcaf202e1c9ad06d6772300d # via -r requirements.in -sniffio==1.3.1 \ - --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 \ - --hash=sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc - # via trio -sortedcontainers==2.4.0 \ - --hash=sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88 \ - --hash=sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0 - # via trio -trio==0.27.0 \ - --hash=sha256:1dcc95ab1726b2da054afea8fd761af74bad79bd52381b84eae408e983c76831 \ - --hash=sha256:68eabbcf8f457d925df62da780eff15ff5dc68fd6b367e2dde59f7aaf2a0b884 - # via - # selenium - # trio-websocket -trio-websocket==0.11.1 \ - --hash=sha256:18c11793647703c158b1f6e62de638acada927344d534e3c7628eedcb746839f \ - --hash=sha256:520d046b0d030cf970b8b2b2e00c4c2245b3807853ecd44214acd33d74581638 - # via selenium -typing-extensions==4.12.2 \ - --hash=sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d \ - --hash=sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8 - # via selenium -urllib3[socks]==2.2.3 \ +urllib3==2.2.3 \ --hash=sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac \ --hash=sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9 # via selenium -websocket-client==1.8.0 \ - --hash=sha256:17b44cc997f5c498e809b22cdf2d9c7a9e71c02c8cc2b6c56e7c2d1239bfa526 \ - --hash=sha256:3239df9f44da632f96012472805d40a23281a991027ce11d2f45a6f24ac4c3da - # via selenium -wsproto==1.2.0 \ - --hash=sha256:ad565f26ecb92588a3e43bc3d96164de84cd9902482b130d0ddbaa9664a85065 \ - --hash=sha256:b9acddd652b585d75b20477888c56642fdade28bdfd3579aa24a4d2c037dd736 - # via trio-websocket diff --git a/web_testing_python/requirements_lock_windows.txt b/web_testing_python/requirements_lock_windows.txt index e3e0a70f..9585b334 100644 --- a/web_testing_python/requirements_lock_windows.txt +++ b/web_testing_python/requirements_lock_windows.txt @@ -4,141 +4,11 @@ # # bazel run //:requirements.update # -attrs==24.2.0 \ - --hash=sha256:5cfb1b9148b5b086569baec03f20d7b6bf3bcacc9a42bebf87ffaaca362f6346 \ - --hash=sha256:81921eb96de3191c8258c199618104dd27ac608d9366f5e35d011eae1867ede2 - # via - # outcome - # trio -certifi==2024.8.30 \ - --hash=sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8 \ - --hash=sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9 - # via selenium -cffi==1.17.1 \ - --hash=sha256:045d61c734659cc045141be4bae381a41d89b741f795af1dd018bfb532fd0df8 \ - --hash=sha256:0984a4925a435b1da406122d4d7968dd861c1385afe3b45ba82b750f229811e2 \ - --hash=sha256:0e2b1fac190ae3ebfe37b979cc1ce69c81f4e4fe5746bb401dca63a9062cdaf1 \ - --hash=sha256:0f048dcf80db46f0098ccac01132761580d28e28bc0f78ae0d58048063317e15 \ - --hash=sha256:1257bdabf294dceb59f5e70c64a3e2f462c30c7ad68092d01bbbfb1c16b1ba36 \ - --hash=sha256:1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824 \ - --hash=sha256:1d599671f396c4723d016dbddb72fe8e0397082b0a77a4fab8028923bec050e8 \ - --hash=sha256:28b16024becceed8c6dfbc75629e27788d8a3f9030691a1dbf9821a128b22c36 \ - --hash=sha256:2bb1a08b8008b281856e5971307cc386a8e9c5b625ac297e853d36da6efe9c17 \ - --hash=sha256:30c5e0cb5ae493c04c8b42916e52ca38079f1b235c2f8ae5f4527b963c401caf \ - --hash=sha256:31000ec67d4221a71bd3f67df918b1f88f676f1c3b535a7eb473255fdc0b83fc \ - --hash=sha256:386c8bf53c502fff58903061338ce4f4950cbdcb23e2902d86c0f722b786bbe3 \ - --hash=sha256:3edc8d958eb099c634dace3c7e16560ae474aa3803a5df240542b305d14e14ed \ - --hash=sha256:45398b671ac6d70e67da8e4224a065cec6a93541bb7aebe1b198a61b58c7b702 \ - --hash=sha256:46bf43160c1a35f7ec506d254e5c890f3c03648a4dbac12d624e4490a7046cd1 \ - --hash=sha256:4ceb10419a9adf4460ea14cfd6bc43d08701f0835e979bf821052f1805850fe8 \ - --hash=sha256:51392eae71afec0d0c8fb1a53b204dbb3bcabcb3c9b807eedf3e1e6ccf2de903 \ - --hash=sha256:5da5719280082ac6bd9aa7becb3938dc9f9cbd57fac7d2871717b1feb0902ab6 \ - --hash=sha256:610faea79c43e44c71e1ec53a554553fa22321b65fae24889706c0a84d4ad86d \ - --hash=sha256:636062ea65bd0195bc012fea9321aca499c0504409f413dc88af450b57ffd03b \ - --hash=sha256:6883e737d7d9e4899a8a695e00ec36bd4e5e4f18fabe0aca0efe0a4b44cdb13e \ - --hash=sha256:6b8b4a92e1c65048ff98cfe1f735ef8f1ceb72e3d5f0c25fdb12087a23da22be \ - --hash=sha256:6f17be4345073b0a7b8ea599688f692ac3ef23ce28e5df79c04de519dbc4912c \ - --hash=sha256:706510fe141c86a69c8ddc029c7910003a17353970cff3b904ff0686a5927683 \ - --hash=sha256:72e72408cad3d5419375fc87d289076ee319835bdfa2caad331e377589aebba9 \ - --hash=sha256:733e99bc2df47476e3848417c5a4540522f234dfd4ef3ab7fafdf555b082ec0c \ - --hash=sha256:7596d6620d3fa590f677e9ee430df2958d2d6d6de2feeae5b20e82c00b76fbf8 \ - --hash=sha256:78122be759c3f8a014ce010908ae03364d00a1f81ab5c7f4a7a5120607ea56e1 \ - --hash=sha256:805b4371bf7197c329fcb3ead37e710d1bca9da5d583f5073b799d5c5bd1eee4 \ - --hash=sha256:85a950a4ac9c359340d5963966e3e0a94a676bd6245a4b55bc43949eee26a655 \ - --hash=sha256:8f2cdc858323644ab277e9bb925ad72ae0e67f69e804f4898c070998d50b1a67 \ - --hash=sha256:9755e4345d1ec879e3849e62222a18c7174d65a6a92d5b346b1863912168b595 \ - --hash=sha256:98e3969bcff97cae1b2def8ba499ea3d6f31ddfdb7635374834cf89a1a08ecf0 \ - --hash=sha256:a08d7e755f8ed21095a310a693525137cfe756ce62d066e53f502a83dc550f65 \ - --hash=sha256:a1ed2dd2972641495a3ec98445e09766f077aee98a1c896dcb4ad0d303628e41 \ - --hash=sha256:a24ed04c8ffd54b0729c07cee15a81d964e6fee0e3d4d342a27b020d22959dc6 \ - --hash=sha256:a45e3c6913c5b87b3ff120dcdc03f6131fa0065027d0ed7ee6190736a74cd401 \ - --hash=sha256:a9b15d491f3ad5d692e11f6b71f7857e7835eb677955c00cc0aefcd0669adaf6 \ - --hash=sha256:ad9413ccdeda48c5afdae7e4fa2192157e991ff761e7ab8fdd8926f40b160cc3 \ - --hash=sha256:b2ab587605f4ba0bf81dc0cb08a41bd1c0a5906bd59243d56bad7668a6fc6c16 \ - --hash=sha256:b62ce867176a75d03a665bad002af8e6d54644fad99a3c70905c543130e39d93 \ - --hash=sha256:c03e868a0b3bc35839ba98e74211ed2b05d2119be4e8a0f224fba9384f1fe02e \ - --hash=sha256:c59d6e989d07460165cc5ad3c61f9fd8f1b4796eacbd81cee78957842b834af4 \ - --hash=sha256:c7eac2ef9b63c79431bc4b25f1cd649d7f061a28808cbc6c47b534bd789ef964 \ - --hash=sha256:c9c3d058ebabb74db66e431095118094d06abf53284d9c81f27300d0e0d8bc7c \ - --hash=sha256:ca74b8dbe6e8e8263c0ffd60277de77dcee6c837a3d0881d8c1ead7268c9e576 \ - --hash=sha256:caaf0640ef5f5517f49bc275eca1406b0ffa6aa184892812030f04c2abf589a0 \ - --hash=sha256:cdf5ce3acdfd1661132f2a9c19cac174758dc2352bfe37d98aa7512c6b7178b3 \ - --hash=sha256:d016c76bdd850f3c626af19b0542c9677ba156e4ee4fccfdd7848803533ef662 \ - --hash=sha256:d01b12eeeb4427d3110de311e1774046ad344f5b1a7403101878976ecd7a10f3 \ - --hash=sha256:d63afe322132c194cf832bfec0dc69a99fb9bb6bbd550f161a49e9e855cc78ff \ - --hash=sha256:da95af8214998d77a98cc14e3a3bd00aa191526343078b530ceb0bd710fb48a5 \ - --hash=sha256:dd398dbc6773384a17fe0d3e7eeb8d1a21c2200473ee6806bb5e6a8e62bb73dd \ - --hash=sha256:de2ea4b5833625383e464549fec1bc395c1bdeeb5f25c4a3a82b5a8c756ec22f \ - --hash=sha256:de55b766c7aa2e2a3092c51e0483d700341182f08e67c63630d5b6f200bb28e5 \ - --hash=sha256:df8b1c11f177bc2313ec4b2d46baec87a5f3e71fc8b45dab2ee7cae86d9aba14 \ - --hash=sha256:e03eab0a8677fa80d646b5ddece1cbeaf556c313dcfac435ba11f107ba117b5d \ - --hash=sha256:e221cf152cff04059d011ee126477f0d9588303eb57e88923578ace7baad17f9 \ - --hash=sha256:e31ae45bc2e29f6b2abd0de1cc3b9d5205aa847cafaecb8af1476a609a2f6eb7 \ - --hash=sha256:edae79245293e15384b51f88b00613ba9f7198016a5948b5dddf4917d4d26382 \ - --hash=sha256:f1e22e8c4419538cb197e4dd60acc919d7696e5ef98ee4da4e01d3f8cfa4cc5a \ - --hash=sha256:f3a2b4222ce6b60e2e8b337bb9596923045681d71e5a082783484d845390938e \ - --hash=sha256:f6a16c31041f09ead72d69f583767292f750d24913dadacf5756b966aacb3f1a \ - --hash=sha256:f75c7ab1f9e4aca5414ed4d8e5c0e303a34f4421f8a0d47a4d019ceff0ab6af4 \ - --hash=sha256:f79fc4fc25f1c8698ff97788206bb3c2598949bfe0fef03d299eb1b5356ada99 \ - --hash=sha256:f7f5baafcc48261359e14bcd6d9bff6d4b28d9103847c9e136694cb0501aef87 \ - --hash=sha256:fc48c783f9c87e60831201f2cce7f3b2e4846bf4d8728eabe54d60700b318a0b - # via trio -h11==0.16.0 \ - --hash=sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1 \ - --hash=sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86 - # via wsproto -idna==3.10 \ - --hash=sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9 \ - --hash=sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3 - # via trio -outcome==1.3.0.post0 \ - --hash=sha256:9dcf02e65f2971b80047b377468e72a268e15c0af3cf1238e6ff14f7f91143b8 \ - --hash=sha256:e771c5ce06d1415e356078d3bdd68523f284b4ce5419828922b6871e65eda82b - # via trio -pycparser==2.22 \ - --hash=sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6 \ - --hash=sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc - # via cffi -pysocks==1.7.1 \ - --hash=sha256:08e69f092cc6dbe92a0fdd16eeb9b9ffbc13cadfe5ca4c7bd92ffb078b293299 \ - --hash=sha256:2725bd0a9925919b9b51739eea5f9e2bae91e83288108a9ad338b2e3a4435ee5 \ - --hash=sha256:3f8804571ebe159c380ac6de37643bb4685970655d3bba243530d6558b799aa0 - # via urllib3 -selenium==4.27.1 \ - --hash=sha256:5296c425a75ff1b44d0d5199042b36a6d1ef76c04fb775b97b40be739a9caae2 \ - --hash=sha256:b89b1f62b5cfe8025868556fe82360d6b649d464f75d2655cb966c8f8447ea18 +selenium==3.141.0 \ + --hash=sha256:2d7131d7bc5a5b99a2d9b04aaf2612c411b03b8ca1b1ee8d3de5845a9be2cb3c \ + --hash=sha256:deaf32b60ad91a4611b98d8002757f29e6f2c2d5fcaf202e1c9ad06d6772300d # via -r requirements.in -sniffio==1.3.1 \ - --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 \ - --hash=sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc - # via trio -sortedcontainers==2.4.0 \ - --hash=sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88 \ - --hash=sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0 - # via trio -trio==0.27.0 \ - --hash=sha256:1dcc95ab1726b2da054afea8fd761af74bad79bd52381b84eae408e983c76831 \ - --hash=sha256:68eabbcf8f457d925df62da780eff15ff5dc68fd6b367e2dde59f7aaf2a0b884 - # via - # selenium - # trio-websocket -trio-websocket==0.11.1 \ - --hash=sha256:18c11793647703c158b1f6e62de638acada927344d534e3c7628eedcb746839f \ - --hash=sha256:520d046b0d030cf970b8b2b2e00c4c2245b3807853ecd44214acd33d74581638 - # via selenium -typing-extensions==4.12.2 \ - --hash=sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d \ - --hash=sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8 - # via selenium -urllib3[socks]==2.2.3 \ +urllib3==2.2.3 \ --hash=sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac \ --hash=sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9 # via selenium -websocket-client==1.8.0 \ - --hash=sha256:17b44cc997f5c498e809b22cdf2d9c7a9e71c02c8cc2b6c56e7c2d1239bfa526 \ - --hash=sha256:3239df9f44da632f96012472805d40a23281a991027ce11d2f45a6f24ac4c3da - # via selenium -wsproto==1.2.0 \ - --hash=sha256:ad565f26ecb92588a3e43bc3d96164de84cd9902482b130d0ddbaa9664a85065 \ - --hash=sha256:b9acddd652b585d75b20477888c56642fdade28bdfd3579aa24a4d2c037dd736 - # via trio-websocket From e2f8a5f8b0214e744cdd7901e609b364f2094da4 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Thu, 8 May 2025 23:52:41 +0000 Subject: [PATCH 38/74] Upgrade gazelle --- web_testing_go/MODULE.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_testing_go/MODULE.bazel b/web_testing_go/MODULE.bazel index c50a63e8..ef80b9bf 100644 --- a/web_testing_go/MODULE.bazel +++ b/web_testing_go/MODULE.bazel @@ -23,7 +23,7 @@ bazel_dep( repo_name = "io_bazel_rules_go", ) -bazel_dep(name = "gazelle", version = "0.40.0", repo_name = "bazel_gazelle") +bazel_dep(name = "gazelle", version = "0.42.0", repo_name = "bazel_gazelle") go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") From 0fc24563836673b473dd7c7becdad2200049fe7b Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Fri, 9 May 2025 00:12:56 +0000 Subject: [PATCH 39/74] create test data symbollink to fix go test failures --- web_testing_go/testdata/BUILD | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 web_testing_go/testdata/BUILD diff --git a/web_testing_go/testdata/BUILD b/web_testing_go/testdata/BUILD new file mode 100644 index 00000000..e69de29b From 5fea819b912b04da99c5186ce9baef735939454e Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Fri, 9 May 2025 00:13:23 +0000 Subject: [PATCH 40/74] create test data symbollink to fix go test failures --- web_testing_go/MODULE.bazel | 2 +- web_testing_go/testdata/BUILD | 26 +++++++++++++++++++++++++ web_testing_go/testdata/all-fields.json | 1 + 3 files changed, 28 insertions(+), 1 deletion(-) create mode 120000 web_testing_go/testdata/all-fields.json diff --git a/web_testing_go/MODULE.bazel b/web_testing_go/MODULE.bazel index ef80b9bf..c50a63e8 100644 --- a/web_testing_go/MODULE.bazel +++ b/web_testing_go/MODULE.bazel @@ -23,7 +23,7 @@ bazel_dep( repo_name = "io_bazel_rules_go", ) -bazel_dep(name = "gazelle", version = "0.42.0", repo_name = "bazel_gazelle") +bazel_dep(name = "gazelle", version = "0.40.0", repo_name = "bazel_gazelle") go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") diff --git a/web_testing_go/testdata/BUILD b/web_testing_go/testdata/BUILD index e69de29b..2f4f055a 100644 --- a/web_testing_go/testdata/BUILD +++ b/web_testing_go/testdata/BUILD @@ -0,0 +1,26 @@ +# Copyright 2016 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +# + +package(default_testonly = True) + +licenses(["notice"]) # Apache 2.0 + +filegroup( + name = "testdata", + srcs = glob(["*"]), + visibility = ["//visibility:public"], +) diff --git a/web_testing_go/testdata/all-fields.json b/web_testing_go/testdata/all-fields.json new file mode 120000 index 00000000..1dd3b8eb --- /dev/null +++ b/web_testing_go/testdata/all-fields.json @@ -0,0 +1 @@ +../../testdata/all-fields.json \ No newline at end of file From 6cb6d1c1f3e7ba2a65af18053a080d3e27c8bc86 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Fri, 9 May 2025 00:54:14 +0000 Subject: [PATCH 41/74] Upgrade gazelle version --- web_testing_go/MODULE.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_testing_go/MODULE.bazel b/web_testing_go/MODULE.bazel index c50a63e8..ef80b9bf 100644 --- a/web_testing_go/MODULE.bazel +++ b/web_testing_go/MODULE.bazel @@ -23,7 +23,7 @@ bazel_dep( repo_name = "io_bazel_rules_go", ) -bazel_dep(name = "gazelle", version = "0.40.0", repo_name = "bazel_gazelle") +bazel_dep(name = "gazelle", version = "0.42.0", repo_name = "bazel_gazelle") go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") From 167dbf2bbe1c46de756c86d924bb9f77aba9b051 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Fri, 9 May 2025 01:24:44 +0000 Subject: [PATCH 42/74] Fix cannot find test data in TEST_SRCDIR or RUNFILES_MANIFEST_FILE --- web_testing_go/MODULE.bazel | 2 +- web_testing_go/webtest/BUILD.bazel | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web_testing_go/MODULE.bazel b/web_testing_go/MODULE.bazel index ef80b9bf..c50a63e8 100644 --- a/web_testing_go/MODULE.bazel +++ b/web_testing_go/MODULE.bazel @@ -23,7 +23,7 @@ bazel_dep( repo_name = "io_bazel_rules_go", ) -bazel_dep(name = "gazelle", version = "0.42.0", repo_name = "bazel_gazelle") +bazel_dep(name = "gazelle", version = "0.40.0", repo_name = "bazel_gazelle") go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") diff --git a/web_testing_go/webtest/BUILD.bazel b/web_testing_go/webtest/BUILD.bazel index 64f2aadd..ce882d9c 100644 --- a/web_testing_go/webtest/BUILD.bazel +++ b/web_testing_go/webtest/BUILD.bazel @@ -43,7 +43,7 @@ go_web_test_suite( "@rules_webtesting//browsers/sauce:chrome-win10", "@rules_webtesting//browsers/sauce:chrome-win10-connect", ], - data = ["@rules_webtesting//testdata"], + data = ["//testdata"], embed = [":go_default_library"], deps = ["@com_github_tebeka_selenium//:go_default_library"], ) From f4d3b1927127450e9ee096b6cd5318147f41a0fc Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Fri, 9 May 2025 01:53:32 +0000 Subject: [PATCH 43/74] Update yml to remove test for windows --- .bazelci/presubmit.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 9689b726..bb114343 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -37,16 +37,6 @@ tasks: build_targets: [ "..." ] test_targets: [ "..." ] working_directory: web_testing_go - web_testing_go_windows: - name: "rules_web_testing_go in windows" - platform: windows - test_flags: - - "--test_tag_filters=-noci,-sauce" - - "--test_timeout=60" - - "--enable_runfiles" - build_targets: [ "..." ] - test_targets: [ "..." ] - working_directory: web_testing_go web_testing_scala_ubuntu2004: name: "rules_web_testing_scala in ubuntu" platform: ubuntu2004 From e8ad6332487f6839ca2109991303ea791329e0aa Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Thu, 15 May 2025 19:32:49 +0000 Subject: [PATCH 44/74] Update the yml to include recent yml --- .bazelci/presubmit.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index bb114343..d280ddc2 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -3,15 +3,19 @@ tasks: web_testing_ubuntu2004: name: "rules_webtesting test in ubuntu" platform: ubuntu2004 + shell_commands: + - "sh ../setup.sh" test_flags: - - "--test_tag_filters=-noci,-external,-native,-sauce" + - "--test_tag_filters=-noci,-sauce" test_targets: - "//..." web_testing_macos: - name: "rules_webtesting test in ubuntu" + name: "rules_webtesting test in macos" platform: macos test_flags: - - "--test_tag_filters=-noci,-external,-native,-sauce" + - "--test_tag_filters=-noci,-sauce,-chromium-local,-firefox-local" + build_targets: + - "//..." test_targets: - "//..." web_testing_windows: @@ -22,10 +26,14 @@ tasks: build_targets: - "//..." test_flags: - - "--test_tag_filters=-noci,-sauce,-external,-native" + - "--test_tag_filters=-noci,-sauce" - "--enable_runfiles" test_targets: - "//..." + - "-//go/webdriver:go_default_test_chromium-local" # cannot find runfile "testdata/" in manifest + - "-//go/webtest:go_default_test_chromium-local" # cannot find runfile "testdata/" in manifest + - "-//go/wtl/proxy/driverhub/quithandler:go_default_test_chromium-local" # cannot find runfile "testdata/" in manifest + - "-//go/wtl/proxy/driverhub/scripttimeout:go_default_test_chromium-local" # cannot find runfile "testdata/" in manifest web_testing_go_ubuntu2004: name: "rules_web_testing_go in ubuntu" platform: ubuntu2004 From 9174b4e1ffd3457eb9d3cf1ad01dbf8b6c7f71d3 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Thu, 15 May 2025 19:38:33 +0000 Subject: [PATCH 45/74] Update yml file --- .bazelci/presubmit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index d280ddc2..e2f92385 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -4,7 +4,7 @@ tasks: name: "rules_webtesting test in ubuntu" platform: ubuntu2004 shell_commands: - - "sh ../setup.sh" + - "sh ./setup.sh" test_flags: - "--test_tag_filters=-noci,-sauce" test_targets: From 3eb0dc38aa3706828bf165a2e7deb72fe4d86d87 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Thu, 15 May 2025 21:07:34 +0000 Subject: [PATCH 46/74] fix webdriver test --- go/webdriver/webdriver_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/webdriver/webdriver_test.go b/go/webdriver/webdriver_test.go index 6c3f51b2..baa35ca6 100644 --- a/go/webdriver/webdriver_test.go +++ b/go/webdriver/webdriver_test.go @@ -43,7 +43,7 @@ func TestMain(m *testing.M) { // Note: We resolve to a testdata file first and then retrieve compute the directory. // This is necessary in order to support running this test on Windows. The runfile manifest // only contains mappings for files, so there is no mapping for just the `testdata/` directory. - resolved_file, err := bazel.Runfile("rules_webtesting/testdata/BUILD.bazel") + resolved_file, err := bazel.Runfile("testdata/BUILD.bazel") if err != nil { log.Fatal(err) } From a0db15cf3adcaa8640b7125d351fae450db3a601 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Fri, 16 May 2025 16:24:03 +0000 Subject: [PATCH 47/74] Update merge conflict --- .bazelci/presubmit.yml | 8 +++---- setup.sh | 50 ------------------------------------------ 2 files changed, 4 insertions(+), 54 deletions(-) delete mode 100644 setup.sh diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 2c9375b0..e81c2aa0 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -38,7 +38,7 @@ tasks: name: "rules_web_testing_go in ubuntu" platform: ubuntu2004 shell_commands: - - "sh ../setup.sh" + - "sh ../.bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" - "--test_timeout=60" @@ -49,7 +49,7 @@ tasks: name: "rules_web_testing_scala in ubuntu" platform: ubuntu2004 shell_commands: - - "sh ../setup.sh" + - "sh ../.bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" - "--test_timeout=60" @@ -69,7 +69,7 @@ tasks: name: "rules_web_testing_java in ubuntu" platform: ubuntu2004 shell_commands: - - "sh ../setup.sh" + - "sh ../.bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" - "--test_timeout=60" @@ -89,7 +89,7 @@ tasks: name: "rules_web_testing_python in ubuntu" platform: ubuntu2004 shell_commands: - - "sh ../setup.sh" + - "sh ../.bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" - "--test_timeout=60" diff --git a/setup.sh b/setup.sh deleted file mode 100644 index ec17453b..00000000 --- a/setup.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -# Copyright 2025 Google Inc. All Rights Reserved -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS-IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Script that can be used by CI server for testing j2cl builds. -set -ex -sudo apt -y update && sudo apt -y install libasound2 -sudo apt -y install libdbus-glib-1-2 -sudo apt -y install libatk-bridge2.0-0 -sudo apt -y install libatk1.0-0 -sudo apt -y install libc6 -sudo apt -y install libcairo2 -sudo apt -y install libcups2 -sudo apt -y install libdbus-1-3 -sudo apt -y install libexpat1 -sudo apt -y install libfontconfig1 -sudo apt -y install libgbm1 -sudo apt -y install libgcc1 -sudo apt -y install libglib2.0-0 -sudo apt -y install libgtk-3-0 -sudo apt -y install libnspr4 -sudo apt -y install libnss3 -sudo apt -y install libpango-1.0-0 -sudo apt -y install libpangocairo-1.0-0 -sudo apt -y install libstdc++6 -sudo apt -y install libx11-6 -sudo apt -y install libx11-xcb1 -sudo apt -y install libxcb1 -sudo apt -y install libxcomposite1 -sudo apt -y install libxcursor1 -sudo apt -y install libxdamage1 -sudo apt -y install libxext6 -sudo apt -y install libxfixes3 -sudo apt -y install libxi6 -sudo apt -y install libxrandr2 -sudo apt -y install libxrender1 -sudo apt -y install libxss1 -sudo apt -y install libxtst6 -sudo apt install libgtk-3-0 \ No newline at end of file From 1778b7d909754f1dce6a371a0fefa60fb69393f1 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Fri, 16 May 2025 21:00:00 +0000 Subject: [PATCH 48/74] modify yml --- .bazelci/presubmit.yml | 100 ++++++++++++++++++++++++++++------------- 1 file changed, 68 insertions(+), 32 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index e81c2aa0..01eb9def 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -34,6 +34,7 @@ tasks: - "-//go/webtest:go_default_test_chromium-local" # cannot find runfile "testdata/" in manifest - "-//go/wtl/proxy/driverhub/quithandler:go_default_test_chromium-local" # cannot find runfile "testdata/" in manifest - "-//go/wtl/proxy/driverhub/scripttimeout:go_default_test_chromium-local" # cannot find runfile "testdata/" in manifest + web_testing_go_ubuntu2004: name: "rules_web_testing_go in ubuntu" platform: ubuntu2004 @@ -41,30 +42,25 @@ tasks: - "sh ../.bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" - - "--test_timeout=60" - build_targets: [ "..." ] - test_targets: [ "..." ] + build_targets: [ "//..." ] + test_targets: [ "//..." ] working_directory: web_testing_go - web_testing_scala_ubuntu2004: - name: "rules_web_testing_scala in ubuntu" - platform: ubuntu2004 - shell_commands: - - "sh ../.bazelci/setup_ubuntu.sh" + web_testing_go_macos: + name: "rules_web_testing_go in macos" + platform: macos test_flags: - - "--test_tag_filters=-noci,-sauce" - - "--test_timeout=60" - build_targets: [ "..." ] - test_targets: [ "..." ] - working_directory: web_testing_scala - web_testing_scala_windows: - name: "rules_web_testing_scala in windows" + - "--test_tag_filters=-noci,-sauce,-chromium-local,-firefox-local" + build_targets: [ "//..." ] + test_targets: [ "//..." ] + working_directory: web_testing_go + web_testing_go_windows: + name: "rules_web_testing_go in windows" platform: windows test_flags: - "--test_tag_filters=-noci,-sauce" - - "--test_timeout=60" - build_targets: [ "..." ] - test_targets: [ "..." ] - working_directory: web_testing_scala + build_targets: [ "//..." ] + working_directory: web_testing_go + web_testing_java_ubuntu2004: name: "rules_web_testing_java in ubuntu" platform: ubuntu2004 @@ -72,19 +68,53 @@ tasks: - "sh ../.bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" - - "--test_timeout=60" - build_targets: [ "..." ] - test_targets: [ "..." ] + build_targets: [ "//..." ] + test_targets: [ "//..." ] + working_directory: web_testing_java + web_testing_java_macos: + name: "rules_web_testing_java in macos" + platform: macos + test_flags: + - "--test_tag_filters=-noci,-sauce,-chromium-local,-firefox-local" + build_targets: [ "//..." ] + test_targets: [ "//..." ] working_directory: web_testing_java web_testing_java_windows: name: "rules_web_testing_java in windows" platform: windows test_flags: - "--test_tag_filters=-noci,-sauce" - - "--test_timeout=60" - build_targets: [ "..." ] - test_targets: [ "..." ] + build_targets: [ "//..." ] + test_targets: [ "//..." ] working_directory: web_testing_java + + web_testing_scala_ubuntu2004: + name: "rules_web_testing_scala in ubuntu" + platform: ubuntu2004 + shell_commands: + - "sh ../.bazelci/setup_ubuntu.sh" + test_flags: + - "--test_tag_filters=-noci,-sauce" + build_targets: [ "//..." ] + test_targets: [ "//..." ] + working_directory: web_testing_scala + web_testing_scala_macos: + name: "rules_web_testing_scala in macos" + platform: macos + test_flags: + - "--test_tag_filters=-noci,-sauce,-chromium-local,-firefox-local" + build_targets: [ "//..." ] + test_targets: [ "//..." ] + working_directory: web_testing_scala + web_testing_scala_windows: + name: "rules_web_testing_scala in windows" + platform: windows + test_flags: + - "--test_tag_filters=-noci,-sauce" + build_targets: [ "//..." ] + test_targets: [ "//..." ] + working_directory: web_testing_scala + web_testing_python_ubuntu2004: name: "rules_web_testing_python in ubuntu" platform: ubuntu2004 @@ -92,16 +122,22 @@ tasks: - "sh ../.bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" - - "--test_timeout=60" - build_targets: [ "..." ] - test_targets: [ "..." ] + build_targets: [ "//..." ] + test_targets: [ "//..." ] + working_directory: web_testing_python + web_testing_python_macos: + name: "rules_web_testing_python in macos" + platform: macos + test_flags: + - "--test_tag_filters=-noci,-sauce,-chromium-local,-firefox-local" + build_targets: [ "//..." ] + test_targets: [ "//..." ] working_directory: web_testing_python web_testing_python_windows: name: "rules_web_testing_python in windows" platform: windows test_flags: - "--test_tag_filters=-noci,-sauce" - - "--test_timeout=60" - build_targets: [ "..." ] - test_targets: [ "..." ] - working_directory: web_testing_python + build_targets: [ "//..." ] + test_targets: [ "//..." ] + working_directory: web_testing_python \ No newline at end of file From cbc78c2fcc791f2473a86cd3eb51de0ab5f9b890 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Fri, 16 May 2025 21:12:32 +0000 Subject: [PATCH 49/74] modify yml --- .bazelci/presubmit.yml | 39 --------------------------------------- 1 file changed, 39 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 01eb9def..9086ebd1 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -45,21 +45,6 @@ tasks: build_targets: [ "//..." ] test_targets: [ "//..." ] working_directory: web_testing_go - web_testing_go_macos: - name: "rules_web_testing_go in macos" - platform: macos - test_flags: - - "--test_tag_filters=-noci,-sauce,-chromium-local,-firefox-local" - build_targets: [ "//..." ] - test_targets: [ "//..." ] - working_directory: web_testing_go - web_testing_go_windows: - name: "rules_web_testing_go in windows" - platform: windows - test_flags: - - "--test_tag_filters=-noci,-sauce" - build_targets: [ "//..." ] - working_directory: web_testing_go web_testing_java_ubuntu2004: name: "rules_web_testing_java in ubuntu" @@ -71,14 +56,6 @@ tasks: build_targets: [ "//..." ] test_targets: [ "//..." ] working_directory: web_testing_java - web_testing_java_macos: - name: "rules_web_testing_java in macos" - platform: macos - test_flags: - - "--test_tag_filters=-noci,-sauce,-chromium-local,-firefox-local" - build_targets: [ "//..." ] - test_targets: [ "//..." ] - working_directory: web_testing_java web_testing_java_windows: name: "rules_web_testing_java in windows" platform: windows @@ -98,14 +75,6 @@ tasks: build_targets: [ "//..." ] test_targets: [ "//..." ] working_directory: web_testing_scala - web_testing_scala_macos: - name: "rules_web_testing_scala in macos" - platform: macos - test_flags: - - "--test_tag_filters=-noci,-sauce,-chromium-local,-firefox-local" - build_targets: [ "//..." ] - test_targets: [ "//..." ] - working_directory: web_testing_scala web_testing_scala_windows: name: "rules_web_testing_scala in windows" platform: windows @@ -125,14 +94,6 @@ tasks: build_targets: [ "//..." ] test_targets: [ "//..." ] working_directory: web_testing_python - web_testing_python_macos: - name: "rules_web_testing_python in macos" - platform: macos - test_flags: - - "--test_tag_filters=-noci,-sauce,-chromium-local,-firefox-local" - build_targets: [ "//..." ] - test_targets: [ "//..." ] - working_directory: web_testing_python web_testing_python_windows: name: "rules_web_testing_python in windows" platform: windows From 1dd9d2942560e9caf2d3d7e2f3178b7b30892909 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Sat, 17 May 2025 00:03:14 +0000 Subject: [PATCH 50/74] Update readme --- web_testing_java/BUILD.bazel | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 web_testing_java/BUILD.bazel diff --git a/web_testing_java/BUILD.bazel b/web_testing_java/BUILD.bazel deleted file mode 100644 index e69de29b..00000000 From dbd249d693181c91a5d887ebc56825a8ac0a6856 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Sat, 17 May 2025 00:05:49 +0000 Subject: [PATCH 51/74] Rever browsers version --- README.md | 2 +- browsers/firefox-local.json | 1 - web/versioned/browsers-0.3.4.bzl | 15 +++++++++------ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c0e84d03..951c6066 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ WebDriver. ## Configure your Bazel project -For each language , you need to add the following to your MODULE.bazel file: +For each language that is used by your project, you need to add the corresponding sub module to your MODULE.bazel file: ```bzl bazel_dep(name = "rules_webtesting_${language}", version = "0.4.0") diff --git a/browsers/firefox-local.json b/browsers/firefox-local.json index c061a15c..86fbc276 100644 --- a/browsers/firefox-local.json +++ b/browsers/firefox-local.json @@ -13,7 +13,6 @@ "--port=%WSLPORT:WSL%", "--host=%WSL:HOST_IP%", "--marionette-port=%WSLPORT:MARIONETTE%", - "-vv" ], "env": { "HOME": "%ENV:TEST_TMPDIR%" diff --git a/web/versioned/browsers-0.3.4.bzl b/web/versioned/browsers-0.3.4.bzl index 91d0811e..6c5c5e43 100644 --- a/web/versioned/browsers-0.3.4.bzl +++ b/web/versioned/browsers-0.3.4.bzl @@ -174,10 +174,11 @@ def org_mozilla_firefox(): platform_archive( name = "org_mozilla_firefox_linux_x64", licenses = ["reciprocal"], # MPL 2.0 - sha256 = "878a042f49ee34314bde9ca70a0f93c0941c247c72f17b87d904024bef2b27ad", + sha256 = "3d0f74790fe6ff5e38324222ab0c47e10edb31970ed67c6dd7a1c84e7017d1a5", # Firefox v97.0 urls = [ - "https://ftp.mozilla.org/pub/firefox/releases/129.0/linux-x86_64/en-US/firefox-129.0.tar.bz2", + "https://ftp.mozilla.org/pub/firefox/releases/97.0/linux-x86_64/en-US/firefox-97.0.tar.bz2", + "https://storage.googleapis.com/dev-infra-mirror/firefox/97.0/linux_x64/browser-bin.tar.bz2", ], named_files = { "FIREFOX": "firefox/firefox", @@ -187,10 +188,11 @@ def org_mozilla_firefox(): platform_archive( name = "org_mozilla_firefox_macos_x64", licenses = ["reciprocal"], # MPL 2.0 - sha256 = "4b86e9de2b26339b30342a1ef3be1e3914d70921f81fd67bc9c63595823051f1", + sha256 = "c06c4e58179acaf55d05c3be41d0d4cdd68f811a75322a39557d91121aa2ef74", # Firefox v97.0 urls = [ - "https://ftp.mozilla.org/pub/firefox/releases/129.0/mac/en-US/Firefox%20129.0.dmg", + "https://ftp.mozilla.org/pub/firefox/releases/97.0/mac/en-US/Firefox%2097.0.dmg", + "https://storage.googleapis.com/dev-infra-mirror/firefox/97.0/mac_x64/browser-bin.dmg", ], named_files = { "FIREFOX": "Firefox.app/Contents/MacOS/firefox", @@ -203,10 +205,11 @@ def org_mozilla_firefox(): # repositories to allow for dedicated ARM/x64 binaries if needed in the future. name = "org_mozilla_firefox_macos_arm64", licenses = ["reciprocal"], # MPL 2.0 - sha256 = "4b86e9de2b26339b30342a1ef3be1e3914d70921f81fd67bc9c63595823051f1", + sha256 = "c06c4e58179acaf55d05c3be41d0d4cdd68f811a75322a39557d91121aa2ef74", # Firefox v97.0 urls = [ - "https://ftp.mozilla.org/pub/firefox/releases/129.0/mac/en-US/Firefox%20129.0.dmg", + "https://ftp.mozilla.org/pub/firefox/releases/97.0/mac/en-US/Firefox%2097.0.dmg", + "https://storage.googleapis.com/dev-infra-mirror/firefox/97.0/mac_x64/browser-bin.dmg", ], named_files = { "FIREFOX": "Firefox.app/Contents/MacOS/firefox", From 0bcbb52a8b576c7fded6ff99b3159c44fdb15e2f Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Sat, 17 May 2025 00:10:26 +0000 Subject: [PATCH 52/74] Update tests --- browsers/firefox-local.json | 2 +- go/metadata/BUILD.bazel | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/browsers/firefox-local.json b/browsers/firefox-local.json index 86fbc276..13f147ec 100644 --- a/browsers/firefox-local.json +++ b/browsers/firefox-local.json @@ -12,7 +12,7 @@ "args": [ "--port=%WSLPORT:WSL%", "--host=%WSL:HOST_IP%", - "--marionette-port=%WSLPORT:MARIONETTE%", + "--marionette-port=%WSLPORT:MARIONETTE%" ], "env": { "HOME": "%ENV:TEST_TMPDIR%" diff --git a/go/metadata/BUILD.bazel b/go/metadata/BUILD.bazel index 181da00e..a3b3c225 100644 --- a/go/metadata/BUILD.bazel +++ b/go/metadata/BUILD.bazel @@ -39,7 +39,7 @@ go_test( "extension_test.go", "metadata_test.go", ], - data = ["@rules_webtesting//testdata"], + data = ["//testdata"], embed = [":go_default_library"], deps = ["@rules_webtesting//go/bazel:go_default_library"], ) From 74e580fe3154778d6b2acd927fb8e03e1e02f921 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Sat, 17 May 2025 05:09:29 +0000 Subject: [PATCH 53/74] Update readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 951c6066..ad734035 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,9 @@ WebDriver. For each language that is used by your project, you need to add the corresponding sub module to your MODULE.bazel file: +```bzl +bazel_dep(name = "rules_webtesting", version = "0.4.0") +``` ```bzl bazel_dep(name = "rules_webtesting_${language}", version = "0.4.0") ``` From 147a367f7742ed1bce380c65820d88550cb572cc Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Mon, 19 May 2025 17:46:26 +0000 Subject: [PATCH 54/74] Add back native for chromium --- browsers/BUILD.bazel | 3 +++ 1 file changed, 3 insertions(+) diff --git a/browsers/BUILD.bazel b/browsers/BUILD.bazel index ada9253b..f8d5a280 100644 --- a/browsers/BUILD.bazel +++ b/browsers/BUILD.bazel @@ -50,6 +50,9 @@ browser( browser( name = "chromium-local", metadata = "chromium-local.json", + required_tags = [ + "native", + ], deps = [ "//go/wsl", "//third_party/chromedriver", From 250a0bb68fb5a0e020b591da062d3294088cde4a Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Mon, 19 May 2025 17:55:59 +0000 Subject: [PATCH 55/74] Add comments on yml file --- .bazelci/presubmit.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 9086ebd1..7e6b77ba 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -35,6 +35,7 @@ tasks: - "-//go/wtl/proxy/driverhub/quithandler:go_default_test_chromium-local" # cannot find runfile "testdata/" in manifest - "-//go/wtl/proxy/driverhub/scripttimeout:go_default_test_chromium-local" # cannot find runfile "testdata/" in manifest +#Only run web_testing_go tests on linux but not macos and windows web_testing_go_ubuntu2004: name: "rules_web_testing_go in ubuntu" platform: ubuntu2004 @@ -46,6 +47,7 @@ tasks: test_targets: [ "//..." ] working_directory: web_testing_go +#Run web_testing_java tests on linux and windows web_testing_java_ubuntu2004: name: "rules_web_testing_java in ubuntu" platform: ubuntu2004 @@ -65,6 +67,7 @@ tasks: test_targets: [ "//..." ] working_directory: web_testing_java +#Run web_testing_scala tests on linux and windows web_testing_scala_ubuntu2004: name: "rules_web_testing_scala in ubuntu" platform: ubuntu2004 @@ -84,6 +87,7 @@ tasks: test_targets: [ "//..." ] working_directory: web_testing_scala +#Run web_testing_python tests on linux and windows web_testing_python_ubuntu2004: name: "rules_web_testing_python in ubuntu" platform: ubuntu2004 From aa4dc665d728144bf3dcf5a836a182a2179121a1 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Tue, 20 May 2025 00:06:20 +0000 Subject: [PATCH 56/74] Format comments --- .bazelci/presubmit.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 7e6b77ba..d7a8e70f 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -35,7 +35,7 @@ tasks: - "-//go/wtl/proxy/driverhub/quithandler:go_default_test_chromium-local" # cannot find runfile "testdata/" in manifest - "-//go/wtl/proxy/driverhub/scripttimeout:go_default_test_chromium-local" # cannot find runfile "testdata/" in manifest -#Only run web_testing_go tests on linux but not macos and windows + # Only run web_testing_go tests on linux but not macos and windows web_testing_go_ubuntu2004: name: "rules_web_testing_go in ubuntu" platform: ubuntu2004 @@ -47,7 +47,7 @@ tasks: test_targets: [ "//..." ] working_directory: web_testing_go -#Run web_testing_java tests on linux and windows + # Run web_testing_java tests on linux and windows web_testing_java_ubuntu2004: name: "rules_web_testing_java in ubuntu" platform: ubuntu2004 @@ -67,7 +67,7 @@ tasks: test_targets: [ "//..." ] working_directory: web_testing_java -#Run web_testing_scala tests on linux and windows + # Run web_testing_scala tests on linux and windows web_testing_scala_ubuntu2004: name: "rules_web_testing_scala in ubuntu" platform: ubuntu2004 @@ -87,7 +87,7 @@ tasks: test_targets: [ "//..." ] working_directory: web_testing_scala -#Run web_testing_python tests on linux and windows + # Run web_testing_python tests on linux and windows web_testing_python_ubuntu2004: name: "rules_web_testing_python in ubuntu" platform: ubuntu2004 From d4ed9a511dfff98e211297ac1b42bcca718c8258 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Thu, 22 May 2025 20:18:02 +0000 Subject: [PATCH 57/74] Update the setup.sh as symlink --- .bazelci/presubmit.yml | 8 ++++---- web_testing_go/setup_ubuntu.sh | 1 + web_testing_java/setup_ubuntu.sh | 1 + web_testing_python/setup_ubuntu.sh | 1 + web_testing_scala/setup_ubuntu.sh | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) create mode 120000 web_testing_go/setup_ubuntu.sh create mode 120000 web_testing_java/setup_ubuntu.sh create mode 120000 web_testing_python/setup_ubuntu.sh create mode 120000 web_testing_scala/setup_ubuntu.sh diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index d7a8e70f..f1270785 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -40,7 +40,7 @@ tasks: name: "rules_web_testing_go in ubuntu" platform: ubuntu2004 shell_commands: - - "sh ../.bazelci/setup_ubuntu.sh" + - "sh setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] @@ -52,7 +52,7 @@ tasks: name: "rules_web_testing_java in ubuntu" platform: ubuntu2004 shell_commands: - - "sh ../.bazelci/setup_ubuntu.sh" + - "sh setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] @@ -72,7 +72,7 @@ tasks: name: "rules_web_testing_scala in ubuntu" platform: ubuntu2004 shell_commands: - - "sh ../.bazelci/setup_ubuntu.sh" + - "sh setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] @@ -92,7 +92,7 @@ tasks: name: "rules_web_testing_python in ubuntu" platform: ubuntu2004 shell_commands: - - "sh ../.bazelci/setup_ubuntu.sh" + - "sh setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] diff --git a/web_testing_go/setup_ubuntu.sh b/web_testing_go/setup_ubuntu.sh new file mode 120000 index 00000000..781ac94d --- /dev/null +++ b/web_testing_go/setup_ubuntu.sh @@ -0,0 +1 @@ +../.bazelci/setup_ubuntu.sh \ No newline at end of file diff --git a/web_testing_java/setup_ubuntu.sh b/web_testing_java/setup_ubuntu.sh new file mode 120000 index 00000000..781ac94d --- /dev/null +++ b/web_testing_java/setup_ubuntu.sh @@ -0,0 +1 @@ +../.bazelci/setup_ubuntu.sh \ No newline at end of file diff --git a/web_testing_python/setup_ubuntu.sh b/web_testing_python/setup_ubuntu.sh new file mode 120000 index 00000000..781ac94d --- /dev/null +++ b/web_testing_python/setup_ubuntu.sh @@ -0,0 +1 @@ +../.bazelci/setup_ubuntu.sh \ No newline at end of file diff --git a/web_testing_scala/setup_ubuntu.sh b/web_testing_scala/setup_ubuntu.sh new file mode 120000 index 00000000..781ac94d --- /dev/null +++ b/web_testing_scala/setup_ubuntu.sh @@ -0,0 +1 @@ +../.bazelci/setup_ubuntu.sh \ No newline at end of file From bc009991562e9f0c02b1d1ae10ce384f6f99167d Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Tue, 27 May 2025 22:35:24 +0000 Subject: [PATCH 58/74] Change symlinks to actual file --- web_testing_go/.bazelci/setup_ubuntu.sh | 52 +++++++++++++++++++++++ web_testing_java/.bazelci/setup_ubuntu.sh | 52 +++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 web_testing_go/.bazelci/setup_ubuntu.sh create mode 100644 web_testing_java/.bazelci/setup_ubuntu.sh diff --git a/web_testing_go/.bazelci/setup_ubuntu.sh b/web_testing_go/.bazelci/setup_ubuntu.sh new file mode 100644 index 00000000..0708f830 --- /dev/null +++ b/web_testing_go/.bazelci/setup_ubuntu.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# Copyright 2025 Google Inc. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Script that can be used by CI server for testing rules_webtesting builds. +set -ex + +sudo apt -y update +sudo apt -y install libasound2 \ + libdbus-glib-1-2 \ + libatk-bridge2.0-0 \ + libatk1.0-0 \ + libc6 \ + libcairo2 \ + libcups2 \ + libdbus-1-3 \ + libexpat1 \ + libfontconfig1 \ + libgbm1 \ + libgcc1 \ + libglib2.0-0 \ + libgtk-3-0 \ + libnspr4 \ + libnss3 \ + libpango-1.0-0 \ + libpangocairo-1.0-0 \ + libstdc++6 \ + libx11-6 \ + libx11-xcb1 \ + libxcb1 \ + libxcomposite1 \ + libxcursor1 \ + libxdamage1 \ + libxext6 \ + libxfixes3 \ + libxi6 \ + libxrandr2 \ + libxrender1 \ + libxss1 \ + libxtst6 \ + libgtk-3-0 diff --git a/web_testing_java/.bazelci/setup_ubuntu.sh b/web_testing_java/.bazelci/setup_ubuntu.sh new file mode 100644 index 00000000..0708f830 --- /dev/null +++ b/web_testing_java/.bazelci/setup_ubuntu.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# Copyright 2025 Google Inc. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Script that can be used by CI server for testing rules_webtesting builds. +set -ex + +sudo apt -y update +sudo apt -y install libasound2 \ + libdbus-glib-1-2 \ + libatk-bridge2.0-0 \ + libatk1.0-0 \ + libc6 \ + libcairo2 \ + libcups2 \ + libdbus-1-3 \ + libexpat1 \ + libfontconfig1 \ + libgbm1 \ + libgcc1 \ + libglib2.0-0 \ + libgtk-3-0 \ + libnspr4 \ + libnss3 \ + libpango-1.0-0 \ + libpangocairo-1.0-0 \ + libstdc++6 \ + libx11-6 \ + libx11-xcb1 \ + libxcb1 \ + libxcomposite1 \ + libxcursor1 \ + libxdamage1 \ + libxext6 \ + libxfixes3 \ + libxi6 \ + libxrandr2 \ + libxrender1 \ + libxss1 \ + libxtst6 \ + libgtk-3-0 From e2dd18db353666ec138c9f5917dd46098948d2ce Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Wed, 28 May 2025 18:17:37 +0000 Subject: [PATCH 59/74] Test bcr locally --- web_testing_python/.bazelci/setup_ubuntu.sh | 52 +++++++++++++++++++++ web_testing_python/setup_ubuntu.sh | 1 - web_testing_scala/.bazelci/setup_ubuntu.sh | 52 +++++++++++++++++++++ web_testing_scala/setup_ubuntu.sh | 1 - 4 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 web_testing_python/.bazelci/setup_ubuntu.sh delete mode 120000 web_testing_python/setup_ubuntu.sh create mode 100644 web_testing_scala/.bazelci/setup_ubuntu.sh delete mode 120000 web_testing_scala/setup_ubuntu.sh diff --git a/web_testing_python/.bazelci/setup_ubuntu.sh b/web_testing_python/.bazelci/setup_ubuntu.sh new file mode 100644 index 00000000..0708f830 --- /dev/null +++ b/web_testing_python/.bazelci/setup_ubuntu.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# Copyright 2025 Google Inc. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Script that can be used by CI server for testing rules_webtesting builds. +set -ex + +sudo apt -y update +sudo apt -y install libasound2 \ + libdbus-glib-1-2 \ + libatk-bridge2.0-0 \ + libatk1.0-0 \ + libc6 \ + libcairo2 \ + libcups2 \ + libdbus-1-3 \ + libexpat1 \ + libfontconfig1 \ + libgbm1 \ + libgcc1 \ + libglib2.0-0 \ + libgtk-3-0 \ + libnspr4 \ + libnss3 \ + libpango-1.0-0 \ + libpangocairo-1.0-0 \ + libstdc++6 \ + libx11-6 \ + libx11-xcb1 \ + libxcb1 \ + libxcomposite1 \ + libxcursor1 \ + libxdamage1 \ + libxext6 \ + libxfixes3 \ + libxi6 \ + libxrandr2 \ + libxrender1 \ + libxss1 \ + libxtst6 \ + libgtk-3-0 diff --git a/web_testing_python/setup_ubuntu.sh b/web_testing_python/setup_ubuntu.sh deleted file mode 120000 index 781ac94d..00000000 --- a/web_testing_python/setup_ubuntu.sh +++ /dev/null @@ -1 +0,0 @@ -../.bazelci/setup_ubuntu.sh \ No newline at end of file diff --git a/web_testing_scala/.bazelci/setup_ubuntu.sh b/web_testing_scala/.bazelci/setup_ubuntu.sh new file mode 100644 index 00000000..0708f830 --- /dev/null +++ b/web_testing_scala/.bazelci/setup_ubuntu.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# Copyright 2025 Google Inc. All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS-IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Script that can be used by CI server for testing rules_webtesting builds. +set -ex + +sudo apt -y update +sudo apt -y install libasound2 \ + libdbus-glib-1-2 \ + libatk-bridge2.0-0 \ + libatk1.0-0 \ + libc6 \ + libcairo2 \ + libcups2 \ + libdbus-1-3 \ + libexpat1 \ + libfontconfig1 \ + libgbm1 \ + libgcc1 \ + libglib2.0-0 \ + libgtk-3-0 \ + libnspr4 \ + libnss3 \ + libpango-1.0-0 \ + libpangocairo-1.0-0 \ + libstdc++6 \ + libx11-6 \ + libx11-xcb1 \ + libxcb1 \ + libxcomposite1 \ + libxcursor1 \ + libxdamage1 \ + libxext6 \ + libxfixes3 \ + libxi6 \ + libxrandr2 \ + libxrender1 \ + libxss1 \ + libxtst6 \ + libgtk-3-0 diff --git a/web_testing_scala/setup_ubuntu.sh b/web_testing_scala/setup_ubuntu.sh deleted file mode 120000 index 781ac94d..00000000 --- a/web_testing_scala/setup_ubuntu.sh +++ /dev/null @@ -1 +0,0 @@ -../.bazelci/setup_ubuntu.sh \ No newline at end of file From 234b0607567549acb0abb57600569f47de4fcd4b Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Wed, 28 May 2025 18:27:24 +0000 Subject: [PATCH 60/74] Register bcr and test in local branch --- .bcr/config.yml | 5 +++ .bcr/metadata.template.json | 20 +++++++++++ .bcr/presubmit.yml | 36 +++++++++++++++++++ .bcr/source.template.json | 5 +++ .bcr/web_testing_go/metadata.template.json | 15 ++++++++ .bcr/web_testing_go/presubmit.yml | 14 ++++++++ .bcr/web_testing_go/source.template.json | 5 +++ .bcr/web_testing_java/metadata.template.json | 15 ++++++++ .bcr/web_testing_java/presubmit.yml | 19 ++++++++++ .bcr/web_testing_java/source.template.json | 5 +++ .../web_testing_python/metadata.template.json | 15 ++++++++ .bcr/web_testing_python/presubmit.yml | 19 ++++++++++ .bcr/web_testing_python/source.template.json | 5 +++ .bcr/web_testing_scala/metadata.template.json | 15 ++++++++ .bcr/web_testing_scala/presubmit.yml | 19 ++++++++++ .bcr/web_testing_scala/source.template.json | 5 +++ 16 files changed, 217 insertions(+) create mode 100644 .bcr/config.yml create mode 100644 .bcr/metadata.template.json create mode 100644 .bcr/presubmit.yml create mode 100644 .bcr/source.template.json create mode 100644 .bcr/web_testing_go/metadata.template.json create mode 100644 .bcr/web_testing_go/presubmit.yml create mode 100644 .bcr/web_testing_go/source.template.json create mode 100644 .bcr/web_testing_java/metadata.template.json create mode 100644 .bcr/web_testing_java/presubmit.yml create mode 100644 .bcr/web_testing_java/source.template.json create mode 100644 .bcr/web_testing_python/metadata.template.json create mode 100644 .bcr/web_testing_python/presubmit.yml create mode 100644 .bcr/web_testing_python/source.template.json create mode 100644 .bcr/web_testing_scala/metadata.template.json create mode 100644 .bcr/web_testing_scala/presubmit.yml create mode 100644 .bcr/web_testing_scala/source.template.json diff --git a/.bcr/config.yml b/.bcr/config.yml new file mode 100644 index 00000000..0ffec7f8 --- /dev/null +++ b/.bcr/config.yml @@ -0,0 +1,5 @@ +# See https://github.com/bazel-contrib/publish-to-bcr#a-note-on-release-automation +fixedReleaser: + login: mollyibot + email: mollyibot@google.com +moduleRoots: [".", "web_testing_go", "web_testing_java", "web_testing_python", "web_testing_scala"] \ No newline at end of file diff --git a/.bcr/metadata.template.json b/.bcr/metadata.template.json new file mode 100644 index 00000000..43746139 --- /dev/null +++ b/.bcr/metadata.template.json @@ -0,0 +1,20 @@ +{ + "homepage": "https://github.com/bazelbuild/rules_webtesting", + "maintainers": [ + { + "name": "Michael Rea", + "email": "mtrea@google.com", + "github": "mtrea" + }, + { + "name": "Yuan Tian", + "email": "mollyibot@google.com", + "github": "mollyibot" + } + ], + "repository": [ + "github:bazelbuild/rules_webtesting" + ], + "versions": [], + "yanked_versions": {} +} \ No newline at end of file diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml new file mode 100644 index 00000000..05d3629d --- /dev/null +++ b/.bcr/presubmit.yml @@ -0,0 +1,36 @@ +bcr_test_module: + tasks: + web_testing_ubuntu2004: + name: "rules_webtesting test in ubuntu" + platform: ubuntu2004 + shell_commands: + - "sh ./.bazelci/setup_ubuntu.sh" + test_flags: + - "--test_tag_filters=-noci,-sauce" + test_targets: + - "//..." + web_testing_macos: + name: "rules_webtesting test in macos" + platform: macos + test_flags: + - "--test_tag_filters=-noci,-sauce,-chromium-local,-firefox-local" + build_targets: + - "//..." + test_targets: + - "//..." + web_testing_windows: + name: "rules_webtesting test in windows" + platform: windows + build_flags: + - "--enable_runfiles" + build_targets: + - "//..." + test_flags: + - "--test_tag_filters=-noci,-sauce" + - "--enable_runfiles" + test_targets: + - "//..." + - "-//go/webdriver:go_default_test_chromium-local" # cannot find runfile "testdata/" in manifest + - "-//go/webtest:go_default_test_chromium-local" # cannot find runfile "testdata/" in manifest + - "-//go/wtl/proxy/driverhub/quithandler:go_default_test_chromium-local" # cannot find runfile "testdata/" in manifest + - "-//go/wtl/proxy/driverhub/scripttimeout:go_default_test_chromium-local" # cannot find runfile "testdata/" in manifest diff --git a/.bcr/source.template.json b/.bcr/source.template.json new file mode 100644 index 00000000..606aa3a0 --- /dev/null +++ b/.bcr/source.template.json @@ -0,0 +1,5 @@ +{ + "integrity": "", + "strip_prefix": "{REPO}-{VERSION}", + "url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/rules_webtesting-{TAG}.tar.gz" +} \ No newline at end of file diff --git a/.bcr/web_testing_go/metadata.template.json b/.bcr/web_testing_go/metadata.template.json new file mode 100644 index 00000000..6fd918ee --- /dev/null +++ b/.bcr/web_testing_go/metadata.template.json @@ -0,0 +1,15 @@ +{ + "homepage": "https://github.com/bazelbuild/rules_webtesting", + "maintainers": [ + { + "name": "Michael Rea", + "email": "mtrea@google.com", + "github": "mtrea" + } + ], + "repository": [ + "github:bazelbuild/rules_webtesting" + ], + "versions": [], + "yanked_versions": {} +} \ No newline at end of file diff --git a/.bcr/web_testing_go/presubmit.yml b/.bcr/web_testing_go/presubmit.yml new file mode 100644 index 00000000..1ea7ec71 --- /dev/null +++ b/.bcr/web_testing_go/presubmit.yml @@ -0,0 +1,14 @@ +bcr_test_module: + module_path: "." + tasks: + # Only run web_testing_go tests on linux but not macos and windows + web_testing_go_ubuntu2004: + name: "rules_web_testing_go in ubuntu" + platform: ubuntu2004 + shell_commands: + - "sh setup_ubuntu.sh" + test_flags: + - "--test_tag_filters=-noci,-sauce" + build_targets: [ "//..." ] + test_targets: [ "//..." ] + diff --git a/.bcr/web_testing_go/source.template.json b/.bcr/web_testing_go/source.template.json new file mode 100644 index 00000000..8cc4b4bf --- /dev/null +++ b/.bcr/web_testing_go/source.template.json @@ -0,0 +1,5 @@ +{ + "integrity": "", + "strip_prefix": "{REPO}-{VERSION}/web_testing_go", + "url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/rules_webtesting-{TAG}.tar.gz" +} \ No newline at end of file diff --git a/.bcr/web_testing_java/metadata.template.json b/.bcr/web_testing_java/metadata.template.json new file mode 100644 index 00000000..6fd918ee --- /dev/null +++ b/.bcr/web_testing_java/metadata.template.json @@ -0,0 +1,15 @@ +{ + "homepage": "https://github.com/bazelbuild/rules_webtesting", + "maintainers": [ + { + "name": "Michael Rea", + "email": "mtrea@google.com", + "github": "mtrea" + } + ], + "repository": [ + "github:bazelbuild/rules_webtesting" + ], + "versions": [], + "yanked_versions": {} +} \ No newline at end of file diff --git a/.bcr/web_testing_java/presubmit.yml b/.bcr/web_testing_java/presubmit.yml new file mode 100644 index 00000000..845e0e43 --- /dev/null +++ b/.bcr/web_testing_java/presubmit.yml @@ -0,0 +1,19 @@ +bcr_test_module: + module_path: "." + tasks: + web_testing_java_ubuntu2004: + name: "rules_web_testing_java in ubuntu" + platform: ubuntu2004 + shell_commands: + - "sh setup_ubuntu.sh" + test_flags: + - "--test_tag_filters=-noci,-sauce" + build_targets: [ "//..." ] + test_targets: [ "//..." ] + web_testing_java_windows: + name: "rules_web_testing_java in windows" + platform: windows + test_flags: + - "--test_tag_filters=-noci,-sauce" + build_targets: [ "//..." ] + test_targets: [ "//..." ] diff --git a/.bcr/web_testing_java/source.template.json b/.bcr/web_testing_java/source.template.json new file mode 100644 index 00000000..6d63c7fa --- /dev/null +++ b/.bcr/web_testing_java/source.template.json @@ -0,0 +1,5 @@ +{ + "integrity": "", + "strip_prefix": "{REPO}-{VERSION}/web_testing_java", + "url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/rules_webtesting-{TAG}.tar.gz" +} \ No newline at end of file diff --git a/.bcr/web_testing_python/metadata.template.json b/.bcr/web_testing_python/metadata.template.json new file mode 100644 index 00000000..6fd918ee --- /dev/null +++ b/.bcr/web_testing_python/metadata.template.json @@ -0,0 +1,15 @@ +{ + "homepage": "https://github.com/bazelbuild/rules_webtesting", + "maintainers": [ + { + "name": "Michael Rea", + "email": "mtrea@google.com", + "github": "mtrea" + } + ], + "repository": [ + "github:bazelbuild/rules_webtesting" + ], + "versions": [], + "yanked_versions": {} +} \ No newline at end of file diff --git a/.bcr/web_testing_python/presubmit.yml b/.bcr/web_testing_python/presubmit.yml new file mode 100644 index 00000000..fac9de92 --- /dev/null +++ b/.bcr/web_testing_python/presubmit.yml @@ -0,0 +1,19 @@ +bcr_test_module: + module_path: "." + tasks: + web_testing_python_ubuntu2004: + name: "rules_web_testing_python in ubuntu" + platform: ubuntu2004 + shell_commands: + - "sh setup_ubuntu.sh" + test_flags: + - "--test_tag_filters=-noci,-sauce" + build_targets: [ "//..." ] + test_targets: [ "//..." ] + web_testing_python_windows: + name: "rules_web_testing_python in windows" + platform: windows + test_flags: + - "--test_tag_filters=-noci,-sauce" + build_targets: [ "//..." ] + test_targets: [ "//..." ] \ No newline at end of file diff --git a/.bcr/web_testing_python/source.template.json b/.bcr/web_testing_python/source.template.json new file mode 100644 index 00000000..85107163 --- /dev/null +++ b/.bcr/web_testing_python/source.template.json @@ -0,0 +1,5 @@ +{ + "integrity": "", + "strip_prefix": "{REPO}-{VERSION}/web_testing_python", + "url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/rules_webtesting-{TAG}.tar.gz" +} \ No newline at end of file diff --git a/.bcr/web_testing_scala/metadata.template.json b/.bcr/web_testing_scala/metadata.template.json new file mode 100644 index 00000000..6fd918ee --- /dev/null +++ b/.bcr/web_testing_scala/metadata.template.json @@ -0,0 +1,15 @@ +{ + "homepage": "https://github.com/bazelbuild/rules_webtesting", + "maintainers": [ + { + "name": "Michael Rea", + "email": "mtrea@google.com", + "github": "mtrea" + } + ], + "repository": [ + "github:bazelbuild/rules_webtesting" + ], + "versions": [], + "yanked_versions": {} +} \ No newline at end of file diff --git a/.bcr/web_testing_scala/presubmit.yml b/.bcr/web_testing_scala/presubmit.yml new file mode 100644 index 00000000..fb84926f --- /dev/null +++ b/.bcr/web_testing_scala/presubmit.yml @@ -0,0 +1,19 @@ +bcr_test_module: + module_path: "." + tasks: + web_testing_scala_ubuntu2004: + name: "rules_web_testing_scala in ubuntu" + platform: ubuntu2004 + shell_commands: + - "sh setup_ubuntu.sh" + test_flags: + - "--test_tag_filters=-noci,-sauce" + build_targets: [ "//..." ] + test_targets: [ "//..." ] + web_testing_scala_windows: + name: "rules_web_testing_scala in windows" + platform: windows + test_flags: + - "--test_tag_filters=-noci,-sauce" + build_targets: [ "//..." ] + test_targets: [ "//..." ] diff --git a/.bcr/web_testing_scala/source.template.json b/.bcr/web_testing_scala/source.template.json new file mode 100644 index 00000000..a3232715 --- /dev/null +++ b/.bcr/web_testing_scala/source.template.json @@ -0,0 +1,5 @@ +{ + "integrity": "", + "strip_prefix": "{REPO}-{VERSION}/web_testing_scala", + "url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/rules_webtesting-{TAG}.tar.gz" +} \ No newline at end of file From d3fd1d6c20a9675acd02c43e8e1b4e93a7308140 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Wed, 28 May 2025 19:58:21 +0000 Subject: [PATCH 61/74] update yml --- .bazelci/presubmit.yml | 8 ++++---- .bcr/web_testing_go/presubmit.yml | 2 +- .bcr/web_testing_java/presubmit.yml | 2 +- .bcr/web_testing_python/presubmit.yml | 2 +- .bcr/web_testing_scala/presubmit.yml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index f1270785..72906eab 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -40,7 +40,7 @@ tasks: name: "rules_web_testing_go in ubuntu" platform: ubuntu2004 shell_commands: - - "sh setup_ubuntu.sh" + - "sh ./bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] @@ -52,7 +52,7 @@ tasks: name: "rules_web_testing_java in ubuntu" platform: ubuntu2004 shell_commands: - - "sh setup_ubuntu.sh" + - "sh ./bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] @@ -72,7 +72,7 @@ tasks: name: "rules_web_testing_scala in ubuntu" platform: ubuntu2004 shell_commands: - - "sh setup_ubuntu.sh" + - "sh ./bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] @@ -92,7 +92,7 @@ tasks: name: "rules_web_testing_python in ubuntu" platform: ubuntu2004 shell_commands: - - "sh setup_ubuntu.sh" + - "sh ./bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] diff --git a/.bcr/web_testing_go/presubmit.yml b/.bcr/web_testing_go/presubmit.yml index 1ea7ec71..cc9d4fa3 100644 --- a/.bcr/web_testing_go/presubmit.yml +++ b/.bcr/web_testing_go/presubmit.yml @@ -6,7 +6,7 @@ bcr_test_module: name: "rules_web_testing_go in ubuntu" platform: ubuntu2004 shell_commands: - - "sh setup_ubuntu.sh" + - "sh ./bazelci/gsetup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] diff --git a/.bcr/web_testing_java/presubmit.yml b/.bcr/web_testing_java/presubmit.yml index 845e0e43..1f895bb8 100644 --- a/.bcr/web_testing_java/presubmit.yml +++ b/.bcr/web_testing_java/presubmit.yml @@ -5,7 +5,7 @@ bcr_test_module: name: "rules_web_testing_java in ubuntu" platform: ubuntu2004 shell_commands: - - "sh setup_ubuntu.sh" + - "sh ./bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] diff --git a/.bcr/web_testing_python/presubmit.yml b/.bcr/web_testing_python/presubmit.yml index fac9de92..b2576d6e 100644 --- a/.bcr/web_testing_python/presubmit.yml +++ b/.bcr/web_testing_python/presubmit.yml @@ -5,7 +5,7 @@ bcr_test_module: name: "rules_web_testing_python in ubuntu" platform: ubuntu2004 shell_commands: - - "sh setup_ubuntu.sh" + - "sh ./bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] diff --git a/.bcr/web_testing_scala/presubmit.yml b/.bcr/web_testing_scala/presubmit.yml index fb84926f..ec336f25 100644 --- a/.bcr/web_testing_scala/presubmit.yml +++ b/.bcr/web_testing_scala/presubmit.yml @@ -5,7 +5,7 @@ bcr_test_module: name: "rules_web_testing_scala in ubuntu" platform: ubuntu2004 shell_commands: - - "sh setup_ubuntu.sh" + - "sh ./bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] From abcdf9811a6a452f8fca3bcc7391fcea0dc105d0 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Wed, 28 May 2025 22:15:21 +0000 Subject: [PATCH 62/74] Update module file --- .bcr/web_testing_go/presubmit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bcr/web_testing_go/presubmit.yml b/.bcr/web_testing_go/presubmit.yml index cc9d4fa3..863b66ce 100644 --- a/.bcr/web_testing_go/presubmit.yml +++ b/.bcr/web_testing_go/presubmit.yml @@ -6,7 +6,7 @@ bcr_test_module: name: "rules_web_testing_go in ubuntu" platform: ubuntu2004 shell_commands: - - "sh ./bazelci/gsetup_ubuntu.sh" + - "sh ./bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] From 57c698203731ee420c59d63d0f1b77a56f20974b Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Wed, 28 May 2025 22:15:21 +0000 Subject: [PATCH 63/74] Update module file --- .bcr/web_testing_go/presubmit.yml | 2 +- .bcr/web_testing_java/presubmit.yml | 2 +- .bcr/web_testing_python/presubmit.yml | 2 +- .bcr/web_testing_scala/presubmit.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.bcr/web_testing_go/presubmit.yml b/.bcr/web_testing_go/presubmit.yml index 863b66ce..8faef136 100644 --- a/.bcr/web_testing_go/presubmit.yml +++ b/.bcr/web_testing_go/presubmit.yml @@ -1,5 +1,5 @@ bcr_test_module: - module_path: "." + module_path: "" tasks: # Only run web_testing_go tests on linux but not macos and windows web_testing_go_ubuntu2004: diff --git a/.bcr/web_testing_java/presubmit.yml b/.bcr/web_testing_java/presubmit.yml index 1f895bb8..def375bb 100644 --- a/.bcr/web_testing_java/presubmit.yml +++ b/.bcr/web_testing_java/presubmit.yml @@ -1,5 +1,5 @@ bcr_test_module: - module_path: "." + module_path: "" tasks: web_testing_java_ubuntu2004: name: "rules_web_testing_java in ubuntu" diff --git a/.bcr/web_testing_python/presubmit.yml b/.bcr/web_testing_python/presubmit.yml index b2576d6e..22bb58d7 100644 --- a/.bcr/web_testing_python/presubmit.yml +++ b/.bcr/web_testing_python/presubmit.yml @@ -1,5 +1,5 @@ bcr_test_module: - module_path: "." + module_path: "" tasks: web_testing_python_ubuntu2004: name: "rules_web_testing_python in ubuntu" diff --git a/.bcr/web_testing_scala/presubmit.yml b/.bcr/web_testing_scala/presubmit.yml index ec336f25..908a8cb0 100644 --- a/.bcr/web_testing_scala/presubmit.yml +++ b/.bcr/web_testing_scala/presubmit.yml @@ -1,5 +1,5 @@ bcr_test_module: - module_path: "." + module_path: "" tasks: web_testing_scala_ubuntu2004: name: "rules_web_testing_scala in ubuntu" From 723e49cf8bf3cd72b621d2187dcda5188c995a0b Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Thu, 29 May 2025 03:47:25 +0000 Subject: [PATCH 64/74] Update presubmit yml --- .bazelci/presubmit.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 72906eab..814aefc6 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -40,7 +40,7 @@ tasks: name: "rules_web_testing_go in ubuntu" platform: ubuntu2004 shell_commands: - - "sh ./bazelci/setup_ubuntu.sh" + - "sh ../bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] @@ -52,7 +52,7 @@ tasks: name: "rules_web_testing_java in ubuntu" platform: ubuntu2004 shell_commands: - - "sh ./bazelci/setup_ubuntu.sh" + - "sh ../bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] @@ -72,7 +72,7 @@ tasks: name: "rules_web_testing_scala in ubuntu" platform: ubuntu2004 shell_commands: - - "sh ./bazelci/setup_ubuntu.sh" + - "sh ../bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] @@ -92,7 +92,7 @@ tasks: name: "rules_web_testing_python in ubuntu" platform: ubuntu2004 shell_commands: - - "sh ./bazelci/setup_ubuntu.sh" + - "sh ../bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] From 46c62b6a9c7ccef131e2637a00ea8fecb275b8d8 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Thu, 29 May 2025 03:54:37 +0000 Subject: [PATCH 65/74] Update the presubmit file --- .bazelci/presubmit.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 814aefc6..8b2b1567 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -40,7 +40,7 @@ tasks: name: "rules_web_testing_go in ubuntu" platform: ubuntu2004 shell_commands: - - "sh ../bazelci/setup_ubuntu.sh" + - "sh ./.bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] @@ -52,7 +52,7 @@ tasks: name: "rules_web_testing_java in ubuntu" platform: ubuntu2004 shell_commands: - - "sh ../bazelci/setup_ubuntu.sh" + - "sh ./.bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] @@ -72,7 +72,7 @@ tasks: name: "rules_web_testing_scala in ubuntu" platform: ubuntu2004 shell_commands: - - "sh ../bazelci/setup_ubuntu.sh" + - "sh ./.bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] @@ -92,7 +92,7 @@ tasks: name: "rules_web_testing_python in ubuntu" platform: ubuntu2004 shell_commands: - - "sh ../bazelci/setup_ubuntu.sh" + - "sh ./.bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] From 09066e1ecb43cc30a348d375d702ee460b21f48b Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Thu, 29 May 2025 03:54:50 +0000 Subject: [PATCH 66/74] Update the presubmit file --- .bazelci/presubmit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 8b2b1567..000dd122 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -95,7 +95,7 @@ tasks: - "sh ./.bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" - build_targets: [ "//..." ] + build_targets: [ "//gi..." ] test_targets: [ "//..." ] working_directory: web_testing_python web_testing_python_windows: From 3faec57548f25278f5835c90efbdb5eb07a36960 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Thu, 29 May 2025 06:30:14 +0000 Subject: [PATCH 67/74] Remove unused files --- .bazelci/presubmit.yml | 2 +- web_testing_go/setup_ubuntu.sh | 1 - web_testing_java/setup_ubuntu.sh | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) delete mode 120000 web_testing_go/setup_ubuntu.sh delete mode 120000 web_testing_java/setup_ubuntu.sh diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 000dd122..8b2b1567 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -95,7 +95,7 @@ tasks: - "sh ./.bazelci/setup_ubuntu.sh" test_flags: - "--test_tag_filters=-noci,-sauce" - build_targets: [ "//gi..." ] + build_targets: [ "//..." ] test_targets: [ "//..." ] working_directory: web_testing_python web_testing_python_windows: diff --git a/web_testing_go/setup_ubuntu.sh b/web_testing_go/setup_ubuntu.sh deleted file mode 120000 index 781ac94d..00000000 --- a/web_testing_go/setup_ubuntu.sh +++ /dev/null @@ -1 +0,0 @@ -../.bazelci/setup_ubuntu.sh \ No newline at end of file diff --git a/web_testing_java/setup_ubuntu.sh b/web_testing_java/setup_ubuntu.sh deleted file mode 120000 index 781ac94d..00000000 --- a/web_testing_java/setup_ubuntu.sh +++ /dev/null @@ -1 +0,0 @@ -../.bazelci/setup_ubuntu.sh \ No newline at end of file From c638c7c6587bee1c80c817515130e70b66064ff0 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Thu, 29 May 2025 23:08:05 +0000 Subject: [PATCH 68/74] Update presubmit --- .bcr/presubmit.yml | 1 + .bcr/web_testing_go/presubmit.yml | 1 + .bcr/web_testing_java/presubmit.yml | 1 + .bcr/web_testing_python/presubmit.yml | 1 + .bcr/web_testing_scala/presubmit.yml | 1 + 5 files changed, 5 insertions(+) diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml index 05d3629d..aa8dee5f 100644 --- a/.bcr/presubmit.yml +++ b/.bcr/presubmit.yml @@ -1,4 +1,5 @@ bcr_test_module: + bazel: [7.x, 8.x] tasks: web_testing_ubuntu2004: name: "rules_webtesting test in ubuntu" diff --git a/.bcr/web_testing_go/presubmit.yml b/.bcr/web_testing_go/presubmit.yml index 8faef136..e658d479 100644 --- a/.bcr/web_testing_go/presubmit.yml +++ b/.bcr/web_testing_go/presubmit.yml @@ -1,4 +1,5 @@ bcr_test_module: + bazel: [7.x, 8.x] module_path: "" tasks: # Only run web_testing_go tests on linux but not macos and windows diff --git a/.bcr/web_testing_java/presubmit.yml b/.bcr/web_testing_java/presubmit.yml index def375bb..43d07ccc 100644 --- a/.bcr/web_testing_java/presubmit.yml +++ b/.bcr/web_testing_java/presubmit.yml @@ -1,5 +1,6 @@ bcr_test_module: module_path: "" + bazel: [7.x, 8.x] tasks: web_testing_java_ubuntu2004: name: "rules_web_testing_java in ubuntu" diff --git a/.bcr/web_testing_python/presubmit.yml b/.bcr/web_testing_python/presubmit.yml index 22bb58d7..82ed84d0 100644 --- a/.bcr/web_testing_python/presubmit.yml +++ b/.bcr/web_testing_python/presubmit.yml @@ -1,5 +1,6 @@ bcr_test_module: module_path: "" + bazel: [7.x, 8.x] tasks: web_testing_python_ubuntu2004: name: "rules_web_testing_python in ubuntu" diff --git a/.bcr/web_testing_scala/presubmit.yml b/.bcr/web_testing_scala/presubmit.yml index 908a8cb0..61387f3a 100644 --- a/.bcr/web_testing_scala/presubmit.yml +++ b/.bcr/web_testing_scala/presubmit.yml @@ -1,5 +1,6 @@ bcr_test_module: module_path: "" + bazel: [7.x, 8.x] tasks: web_testing_scala_ubuntu2004: name: "rules_web_testing_scala in ubuntu" From b1ca3c900cd957a842985192ae1f30bd013f78aa Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Fri, 30 May 2025 00:22:41 +0000 Subject: [PATCH 69/74] Update yml --- .bcr/presubmit.yml | 6 +++++- .bcr/web_testing_go/presubmit.yml | 4 +++- .bcr/web_testing_java/presubmit.yml | 5 ++++- .bcr/web_testing_python/presubmit.yml | 5 ++++- .bcr/web_testing_scala/presubmit.yml | 5 ++++- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml index aa8dee5f..6c813411 100644 --- a/.bcr/presubmit.yml +++ b/.bcr/presubmit.yml @@ -1,9 +1,11 @@ bcr_test_module: - bazel: [7.x, 8.x] + matrix: + bazel: [ 7.x, 8.x ] tasks: web_testing_ubuntu2004: name: "rules_webtesting test in ubuntu" platform: ubuntu2004 + bazel: ${{ bazel }} shell_commands: - "sh ./.bazelci/setup_ubuntu.sh" test_flags: @@ -13,6 +15,7 @@ bcr_test_module: web_testing_macos: name: "rules_webtesting test in macos" platform: macos + bazel: ${{ bazel }} test_flags: - "--test_tag_filters=-noci,-sauce,-chromium-local,-firefox-local" build_targets: @@ -22,6 +25,7 @@ bcr_test_module: web_testing_windows: name: "rules_webtesting test in windows" platform: windows + bazel: ${{ bazel }} build_flags: - "--enable_runfiles" build_targets: diff --git a/.bcr/web_testing_go/presubmit.yml b/.bcr/web_testing_go/presubmit.yml index e658d479..a7320e15 100644 --- a/.bcr/web_testing_go/presubmit.yml +++ b/.bcr/web_testing_go/presubmit.yml @@ -1,11 +1,13 @@ bcr_test_module: - bazel: [7.x, 8.x] module_path: "" + matrix: + bazel: [ 7.x, 8.x ] tasks: # Only run web_testing_go tests on linux but not macos and windows web_testing_go_ubuntu2004: name: "rules_web_testing_go in ubuntu" platform: ubuntu2004 + bazel: ${{ bazel }} shell_commands: - "sh ./bazelci/setup_ubuntu.sh" test_flags: diff --git a/.bcr/web_testing_java/presubmit.yml b/.bcr/web_testing_java/presubmit.yml index 43d07ccc..7e07b8bb 100644 --- a/.bcr/web_testing_java/presubmit.yml +++ b/.bcr/web_testing_java/presubmit.yml @@ -1,10 +1,12 @@ bcr_test_module: module_path: "" - bazel: [7.x, 8.x] + matrix: + bazel: [ 7.x, 8.x ] tasks: web_testing_java_ubuntu2004: name: "rules_web_testing_java in ubuntu" platform: ubuntu2004 + bazel: ${{ bazel }} shell_commands: - "sh ./bazelci/setup_ubuntu.sh" test_flags: @@ -14,6 +16,7 @@ bcr_test_module: web_testing_java_windows: name: "rules_web_testing_java in windows" platform: windows + bazel: ${{ bazel }} test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] diff --git a/.bcr/web_testing_python/presubmit.yml b/.bcr/web_testing_python/presubmit.yml index 82ed84d0..cf253261 100644 --- a/.bcr/web_testing_python/presubmit.yml +++ b/.bcr/web_testing_python/presubmit.yml @@ -1,10 +1,12 @@ bcr_test_module: module_path: "" - bazel: [7.x, 8.x] + matrix: + bazel: [ 7.x, 8.x ] tasks: web_testing_python_ubuntu2004: name: "rules_web_testing_python in ubuntu" platform: ubuntu2004 + bazel: ${{ bazel }} shell_commands: - "sh ./bazelci/setup_ubuntu.sh" test_flags: @@ -14,6 +16,7 @@ bcr_test_module: web_testing_python_windows: name: "rules_web_testing_python in windows" platform: windows + bazel: ${{ bazel }} test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] diff --git a/.bcr/web_testing_scala/presubmit.yml b/.bcr/web_testing_scala/presubmit.yml index 61387f3a..38c498e5 100644 --- a/.bcr/web_testing_scala/presubmit.yml +++ b/.bcr/web_testing_scala/presubmit.yml @@ -1,10 +1,12 @@ bcr_test_module: module_path: "" - bazel: [7.x, 8.x] + matrix: + bazel: [7.x, 8.x] tasks: web_testing_scala_ubuntu2004: name: "rules_web_testing_scala in ubuntu" platform: ubuntu2004 + bazel: ${{ bazel }} shell_commands: - "sh ./bazelci/setup_ubuntu.sh" test_flags: @@ -14,6 +16,7 @@ bcr_test_module: web_testing_scala_windows: name: "rules_web_testing_scala in windows" platform: windows + bazel: ${{ bazel }} test_flags: - "--test_tag_filters=-noci,-sauce" build_targets: [ "//..." ] From 3be71e3a92b29e073edcb8369e035533d59a1c66 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Fri, 30 May 2025 01:07:09 +0000 Subject: [PATCH 70/74] Test for mollyibot org --- .bcr/metadata.template.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bcr/metadata.template.json b/.bcr/metadata.template.json index 43746139..640cf633 100644 --- a/.bcr/metadata.template.json +++ b/.bcr/metadata.template.json @@ -13,7 +13,7 @@ } ], "repository": [ - "github:bazelbuild/rules_webtesting" + "github:mollyibot/rules_webtesting" ], "versions": [], "yanked_versions": {} From e72768fe80561cbb5f206d2247695c9577bb57d2 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Fri, 30 May 2025 01:07:31 +0000 Subject: [PATCH 71/74] Test for mollyibot org --- .bcr/metadata.template.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bcr/metadata.template.json b/.bcr/metadata.template.json index 640cf633..eece6253 100644 --- a/.bcr/metadata.template.json +++ b/.bcr/metadata.template.json @@ -1,5 +1,5 @@ { - "homepage": "https://github.com/bazelbuild/rules_webtesting", + "homepage": "https://github.com/mollyibot/rules_webtesting", "maintainers": [ { "name": "Michael Rea", From c7d4251e011ac928da96eab98bbf0825bba24fec Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Fri, 30 May 2025 02:46:50 +0000 Subject: [PATCH 72/74] Modify json --- .bcr/web_testing_go/metadata.template.json | 9 +++++++-- .bcr/web_testing_java/metadata.template.json | 9 +++++++-- .bcr/web_testing_python/metadata.template.json | 9 +++++++-- .bcr/web_testing_scala/metadata.template.json | 9 +++++++-- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/.bcr/web_testing_go/metadata.template.json b/.bcr/web_testing_go/metadata.template.json index 6fd918ee..eece6253 100644 --- a/.bcr/web_testing_go/metadata.template.json +++ b/.bcr/web_testing_go/metadata.template.json @@ -1,14 +1,19 @@ { - "homepage": "https://github.com/bazelbuild/rules_webtesting", + "homepage": "https://github.com/mollyibot/rules_webtesting", "maintainers": [ { "name": "Michael Rea", "email": "mtrea@google.com", "github": "mtrea" + }, + { + "name": "Yuan Tian", + "email": "mollyibot@google.com", + "github": "mollyibot" } ], "repository": [ - "github:bazelbuild/rules_webtesting" + "github:mollyibot/rules_webtesting" ], "versions": [], "yanked_versions": {} diff --git a/.bcr/web_testing_java/metadata.template.json b/.bcr/web_testing_java/metadata.template.json index 6fd918ee..eece6253 100644 --- a/.bcr/web_testing_java/metadata.template.json +++ b/.bcr/web_testing_java/metadata.template.json @@ -1,14 +1,19 @@ { - "homepage": "https://github.com/bazelbuild/rules_webtesting", + "homepage": "https://github.com/mollyibot/rules_webtesting", "maintainers": [ { "name": "Michael Rea", "email": "mtrea@google.com", "github": "mtrea" + }, + { + "name": "Yuan Tian", + "email": "mollyibot@google.com", + "github": "mollyibot" } ], "repository": [ - "github:bazelbuild/rules_webtesting" + "github:mollyibot/rules_webtesting" ], "versions": [], "yanked_versions": {} diff --git a/.bcr/web_testing_python/metadata.template.json b/.bcr/web_testing_python/metadata.template.json index 6fd918ee..eece6253 100644 --- a/.bcr/web_testing_python/metadata.template.json +++ b/.bcr/web_testing_python/metadata.template.json @@ -1,14 +1,19 @@ { - "homepage": "https://github.com/bazelbuild/rules_webtesting", + "homepage": "https://github.com/mollyibot/rules_webtesting", "maintainers": [ { "name": "Michael Rea", "email": "mtrea@google.com", "github": "mtrea" + }, + { + "name": "Yuan Tian", + "email": "mollyibot@google.com", + "github": "mollyibot" } ], "repository": [ - "github:bazelbuild/rules_webtesting" + "github:mollyibot/rules_webtesting" ], "versions": [], "yanked_versions": {} diff --git a/.bcr/web_testing_scala/metadata.template.json b/.bcr/web_testing_scala/metadata.template.json index 6fd918ee..eece6253 100644 --- a/.bcr/web_testing_scala/metadata.template.json +++ b/.bcr/web_testing_scala/metadata.template.json @@ -1,14 +1,19 @@ { - "homepage": "https://github.com/bazelbuild/rules_webtesting", + "homepage": "https://github.com/mollyibot/rules_webtesting", "maintainers": [ { "name": "Michael Rea", "email": "mtrea@google.com", "github": "mtrea" + }, + { + "name": "Yuan Tian", + "email": "mollyibot@google.com", + "github": "mollyibot" } ], "repository": [ - "github:bazelbuild/rules_webtesting" + "github:mollyibot/rules_webtesting" ], "versions": [], "yanked_versions": {} From 4b19b751bc9bda993206306083bb865e5b23afeb Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Fri, 30 May 2025 22:09:32 +0000 Subject: [PATCH 73/74] Load java_library py_library sh_test from corresponding module --- MODULE.bazel | 2 ++ go/metadata/main/BUILD.bazel | 1 + web_testing_java/java/com/google/testing/bazel/BUILD.bazel | 2 ++ web_testing_java/java/com/google/testing/web/BUILD.bazel | 3 +++ web_testing_python/testing/web/BUILD.bazel | 1 + web_testing_python/testing/web/debugger/BUILD | 2 ++ 6 files changed, 11 insertions(+) diff --git a/MODULE.bazel b/MODULE.bazel index ac865778..c33d7fa2 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -7,6 +7,8 @@ bazel_dep(name = "bazel_skylib", version = "1.7.1") bazel_dep(name = "platforms", version = "0.0.10") +bazel_dep(name = "rules_shell", version = "0.4.0") + ##### Go dependencies ##### bazel_dep(name = "rules_go", version = "0.51.0-rc1", repo_name = "io_bazel_rules_go") diff --git a/go/metadata/main/BUILD.bazel b/go/metadata/main/BUILD.bazel index 992836e6..ba27b457 100644 --- a/go/metadata/main/BUILD.bazel +++ b/go/metadata/main/BUILD.bazel @@ -15,6 +15,7 @@ ################################################################################ # load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") +load("@rules_shell//shell:sh_test.bzl", "sh_test") load("//web/internal:executable_name.bzl", "get_platform_executable_name") licenses(["notice"]) # Apache 2.0 diff --git a/web_testing_java/java/com/google/testing/bazel/BUILD.bazel b/web_testing_java/java/com/google/testing/bazel/BUILD.bazel index bfe0d8e1..05972e0b 100644 --- a/web_testing_java/java/com/google/testing/bazel/BUILD.bazel +++ b/web_testing_java/java/com/google/testing/bazel/BUILD.bazel @@ -14,6 +14,8 @@ # ################################################################################ # +load("@rules_java//java:defs.bzl", "java_library") + licenses(["notice"]) # Apache 2.0 java_library( diff --git a/web_testing_java/java/com/google/testing/web/BUILD.bazel b/web_testing_java/java/com/google/testing/web/BUILD.bazel index 5b9dc2bc..640fed3e 100644 --- a/web_testing_java/java/com/google/testing/web/BUILD.bazel +++ b/web_testing_java/java/com/google/testing/web/BUILD.bazel @@ -14,6 +14,9 @@ # ################################################################################ # + +load("@rules_java//java:defs.bzl", "java_library") + licenses(["notice"]) # Apache 2.0 java_library( diff --git a/web_testing_python/testing/web/BUILD.bazel b/web_testing_python/testing/web/BUILD.bazel index d56e049b..294cc58f 100644 --- a/web_testing_python/testing/web/BUILD.bazel +++ b/web_testing_python/testing/web/BUILD.bazel @@ -15,6 +15,7 @@ ################################################################################ # load("//web:py.bzl", "py_web_test_suite") +load("@rules_python//python:defs.bzl", "py_library") licenses(["notice"]) # Apache 2.0 diff --git a/web_testing_python/testing/web/debugger/BUILD b/web_testing_python/testing/web/debugger/BUILD index 16cfb1f0..86c5ec70 100644 --- a/web_testing_python/testing/web/debugger/BUILD +++ b/web_testing_python/testing/web/debugger/BUILD @@ -16,6 +16,8 @@ # licenses(["notice"]) # Apache 2.0 +load("@rules_python//python:defs.bzl", "py_binary") + py_binary( name = "debugger", srcs = glob(["*.py"]), From fedde52e33224d369db69cf3c014ea2a6e71dec7 Mon Sep 17 00:00:00 2001 From: Yuan Tian Date: Fri, 30 May 2025 22:52:55 +0000 Subject: [PATCH 74/74] Add rules_java --- web_testing_java/MODULE.bazel | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web_testing_java/MODULE.bazel b/web_testing_java/MODULE.bazel index 8e7f6b39..a8647f58 100644 --- a/web_testing_java/MODULE.bazel +++ b/web_testing_java/MODULE.bazel @@ -17,6 +17,8 @@ bazel_dep( version = "1.7.1", ) +bazel_dep(name = "rules_java", version = "7.2.0") + bazel_dep( name = "rules_jvm_external", version = "6.6",