Skip to content

Commit f8386f5

Browse files
authored
Merge branch 'trunk' into make_bazel_pytests_more_robust
2 parents 9044cac + c97f791 commit f8386f5

File tree

17 files changed

+72
-27
lines changed

17 files changed

+72
-27
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ py/selenium/webdriver/remote/getAttribute.js
7575
py/selenium/webdriver/remote/isDisplayed.js
7676
py/docs/build/
7777
py/docs/source/**/*
78+
!py/docs/source/conf.py
7879
py/build/
7980
py/LICENSE
8081
py/pytestdebug.log

MODULE.bazel

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module(name = "selenium")
22

33
bazel_dep(name = "apple_rules_lint", version = "0.4.0")
4-
bazel_dep(name = "aspect_rules_lint", version = "1.4.2")
54
bazel_dep(name = "aspect_bazel_lib", version = "2.13.0")
65
bazel_dep(name = "aspect_rules_esbuild", version = "0.21.0")
76
bazel_dep(name = "aspect_rules_js", version = "2.3.7")
@@ -21,6 +20,7 @@ bazel_dep(name = "rules_cc", version = "0.1.1", dev_dependency = True)
2120
bazel_dep(name = "rules_dotnet", version = "0.17.5")
2221
bazel_dep(name = "rules_java", version = "8.7.1")
2322
bazel_dep(name = "rules_jvm_external", version = "6.6")
23+
bazel_dep(name = "rules_multitool", version = "1.3.0")
2424
bazel_dep(name = "rules_nodejs", version = "6.3.2")
2525
bazel_dep(name = "rules_oci", version = "1.8.0")
2626
bazel_dep(name = "rules_pkg", version = "1.0.1")
@@ -37,6 +37,10 @@ git_override(
3737
remote = "https://github.com/bazel-contrib/rules_jvm_external.git",
3838
)
3939

40+
multitool = use_extension("@rules_multitool//multitool:extension.bzl", "multitool")
41+
multitool.hub(lockfile = "//:multitool.lock.json")
42+
use_repo(multitool, "multitool")
43+
4044
linter = use_extension("@apple_rules_lint//lint:extensions.bzl", "linter")
4145
linter.configure(
4246
name = "java-spotbugs",

common/repositories.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ js_library(
5050

5151
http_archive(
5252
name = "linux_beta_firefox",
53-
url = "https://ftp.mozilla.org/pub/firefox/releases/140.0b1/linux-x86_64/en-US/firefox-140.0b1.tar.xz",
54-
sha256 = "816e57b7a46883b9fad4be62161a070dbd57ce23e01403207d941384b644c80d",
53+
url = "https://ftp.mozilla.org/pub/firefox/releases/140.0b2/linux-x86_64/en-US/firefox-140.0b2.tar.xz",
54+
sha256 = "828cac8a8d7e83fd82c13c979fce4a77262be2d8bf6639612664ca1f10c96ec1",
5555
build_file_content = """
5656
load("@aspect_rules_js//js:defs.bzl", "js_library")
5757
package(default_visibility = ["//visibility:public"])
@@ -72,8 +72,8 @@ js_library(
7272

7373
dmg_archive(
7474
name = "mac_beta_firefox",
75-
url = "https://ftp.mozilla.org/pub/firefox/releases/140.0b1/mac/en-US/Firefox%20140.0b1.dmg",
76-
sha256 = "1233059971a4fa9ee221872c05ba85ebd3fa4707a08a13e5771c387729eccbc0",
75+
url = "https://ftp.mozilla.org/pub/firefox/releases/140.0b2/mac/en-US/Firefox%20140.0b2.dmg",
76+
sha256 = "e60b906321e4e8f6479d87e02314fdf804e3b461028f8d70552d88911a693a0e",
7777
build_file_content = """
7878
load("@aspect_rules_js//js:defs.bzl", "js_library")
7979
package(default_visibility = ["//visibility:public"])

java/src/org/openqa/selenium/virtualauthenticator/Credential.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public static Credential fromMap(Map<String, Object> map) {
6666
Object credentialId = Require.nonNull("credentialId", map.get("credentialId"));
6767
Object isResidentCredential =
6868
Require.nonNull("isResidentCredential", map.get("isResidentCredential"));
69-
Object rpId = Require.nonNull("rpId", map.get("rpId"));
69+
Object rpId = map.get("rpId");
7070
Object privateKey = Require.nonNull("privateKey", map.get("privateKey"));
7171
Object userHandle = map.get("userHandle");
7272
Object signCount = Require.nonNull("signCount", map.get("signCount"));

java/test/org/openqa/selenium/virtualauthenticator/VirtualAuthenticatorTest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,10 @@ void testAddNonResidentCredential() {
190190
credentialId, "localhost", privateKey, /* signCount= */ 0);
191191
authenticator.addCredential(credential);
192192

193-
// Attempt to use the credential to generate an assertion.
194-
Object response = getAssertionFor(Arrays.asList(1, 2, 3, 4));
195-
assertThat(response).asInstanceOf(MAP).containsEntry("status", "OK");
193+
List<Credential> credentialList = authenticator.getCredentials();
194+
assertThat(credentialList.size()).isEqualTo(1);
195+
Credential retrievedCredential = credentialList.get(0);
196+
assertThat(retrievedCredential.getId()).isEqualTo(credentialId);
196197
}
197198

198199
@Test
@@ -201,7 +202,7 @@ void testAddNonResidentCredentialWhenAuthenticatorUsesU2FProtocol() {
201202

202203
createRKDisabledU2FAuthenticator();
203204

204-
/** A pkcs#8 encoded unencrypted EC256 private key as a base64url string. */
205+
// A pkcs#8 encoded unencrypted EC256 private key as a base64url string.
205206
String base64EncodedPK =
206207
"MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg8_zMDQDYAxlU-Q"
207208
+ "hk1Dwkf0v18GZca1DMF3SaJ9HPdmShRANCAASNYX5lyVCOZLzFZzrIKmeZ2jwU"

javascript/private/gen_file.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def write_atom_literal(out, name, contents, lang, utf8):
4848
name = get_atom_name(name)
4949

5050
if "cc" == lang or "hh" == lang:
51-
string_type = "std::string" if utf8 else "std::wstring"
5251
char_type = "char" if utf8 else "wchar_t"
5352
out.write("const %s* const %s[] = {\n" % (char_type, name))
5453
elif "java" == lang:

multitool.lock.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/theoremlp/rules_multitool/main/lockfile.schema.json",
3+
"ruff": {
4+
"binaries": [
5+
{
6+
"kind": "archive",
7+
"url": "https://github.com/astral-sh/ruff/releases/download/0.11.11/ruff-aarch64-unknown-linux-musl.tar.gz",
8+
"file": "ruff-aarch64-unknown-linux-musl/ruff",
9+
"sha256": "3ca33d9b68b8b0bc7e3673b7638910ac2f7c5399303b37bec4d13c005481a78a",
10+
"os": "linux",
11+
"cpu": "arm64"
12+
},
13+
{
14+
"kind": "archive",
15+
"url": "https://github.com/astral-sh/ruff/releases/download/0.11.11/ruff-x86_64-unknown-linux-musl.tar.gz",
16+
"file": "ruff-x86_64-unknown-linux-musl/ruff",
17+
"sha256": "bb64b083767a5fd0a62e10e9a35614974ad53025e2878cf14a0c698680e6c30c",
18+
"os": "linux",
19+
"cpu": "x86_64"
20+
},
21+
{
22+
"kind": "archive",
23+
"url": "https://github.com/astral-sh/ruff/releases/download/0.11.11/ruff-aarch64-apple-darwin.tar.gz",
24+
"file": "ruff-aarch64-apple-darwin/ruff",
25+
"sha256": "814ccb26bed9c027bfc20ac88d33494ab0be62721757c73be70e26c23efbb3f7",
26+
"os": "macos",
27+
"cpu": "arm64"
28+
},
29+
{
30+
"kind": "archive",
31+
"url": "https://github.com/astral-sh/ruff/releases/download/0.11.11/ruff-x86_64-apple-darwin.tar.gz",
32+
"file": "ruff-x86_64-apple-darwin/ruff",
33+
"sha256": "8bef00e82bc07ea26b45adcffc3d55b2d0821f3a3e4d5f441f4dd4ad608fc1be",
34+
"os": "macos",
35+
"cpu": "x86_64"
36+
},
37+
{
38+
"kind": "archive",
39+
"url": "https://github.com/astral-sh/ruff/releases/download/0.11.11/ruff-x86_64-pc-windows-msvc.zip",
40+
"file": "ruff-x86_64-pc-windows-msvc/ruff.exe",
41+
"sha256": "b7619ff27098a4d7f37c52fb8fc61ccfe677aaade7722a385b40f8d5273ebddd",
42+
"os": "windows",
43+
"cpu": "x86_64"
44+
}
45+
]
46+
}
47+
}

py/BUILD.bazel

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
load("@aspect_bazel_lib//lib:copy_directory.bzl", "copy_directory")
2-
load("@aspect_rules_lint//format:defs.bzl", "format_multirun")
32
load("@bazel_skylib//rules:select_file.bzl", "select_file")
43
load("@py_dev_requirements//:requirements.bzl", "requirement")
54
load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix")
@@ -12,11 +11,6 @@ load("//py:defs.bzl", "generate_devtools", "py_test_suite")
1211
load("//py/private:browsers.bzl", "BROWSERS")
1312
load("//py/private:import.bzl", "py_import")
1413

15-
format_multirun(
16-
name = "format",
17-
python = "@aspect_rules_lint//format:ruff",
18-
)
19-
2014
py_binary(
2115
name = "selenium-release",
2216
srcs = [

py/docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
# under the License.
1717

1818

19-
import sys
2019
import os
2120
import os.path
21+
import sys
2222

2323
# If extensions (or modules to document with autodoc) are in another directory,
2424
# add these directories to sys.path here. If the directory is relative to the

py/release-selenium.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818

1919
import sys
20+
2021
from twine import cli
2122

2223

py/selenium/webdriver/common/bidi/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17+
from typing import Generator, Optional
1718

1819

19-
def command_builder(method: str, params: dict = None) -> dict:
20+
def command_builder(method: str, params: Optional[dict] = None) -> Generator[dict, dict, dict]:
2021
"""Build a command iterator to send to the BiDi protocol.
2122
2223
Parameters:

py/test/selenium/webdriver/common/bidi_tests.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
import pytest
1918

2019
from selenium.webdriver.common.bidi.log import LogLevel
2120
from selenium.webdriver.common.by import By

py/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ commands = mypy --install-types {posargs}
3535
[testenv:linting]
3636
skip_install = true
3737
deps =
38-
ruff==0.11.10
38+
ruff==0.11.11
3939
commands =
4040
ruff check --fix --show-fixes --exit-non-zero-on-fix selenium/ test/ conftest.py
4141
ruff format --exit-non-zero-on-format selenium/ test/ conftest.py

scripts/format.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ bazel run @rules_rust//:rustfmt
3333

3434
section "Python"
3535
echo " python - ruff" >&2
36-
bazel run //py:format
36+
bazel run @multitool//tools/ruff:cwd -- check --fix --show-fixes
37+
bazel run @multitool//tools/ruff:cwd -- format
3738

3839
section "Copyright"
3940
bazel run //scripts:update_copyright

scripts/pinned_browsers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ def edge():
205205
linux_hash = None
206206
mac = None
207207
mac_hash = None
208-
version = None
209208

210209
for data in all_data:
211210
if not "Stable" == data.get("product"):

scripts/selenium_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
def get_url():
1616
r = http.request(
1717
"GET",
18-
f"https://github.com/SeleniumHQ/selenium_manager_artifacts/releases/latest",
18+
"https://github.com/SeleniumHQ/selenium_manager_artifacts/releases/latest",
1919
)
2020
return r.url.replace("tag", "download")
2121

2222

2323
def get_sha_json():
2424
r = http.request(
2525
"GET",
26-
f"https://raw.githubusercontent.com/SeleniumHQ/selenium_manager_artifacts/trunk/latest.json",
26+
"https://raw.githubusercontent.com/SeleniumHQ/selenium_manager_artifacts/trunk/latest.json",
2727
)
2828
return json.loads(r.data)
2929

scripts/update_cdp.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
#!/usr/bin/env python
22

33
import argparse
4-
import hashlib
54
import json
65
import os
76
import re
87
import shutil
98
import subprocess
10-
import sys
119
from pathlib import Path
1210

1311
import urllib3

0 commit comments

Comments
 (0)