Skip to content

Commit 6be8d7b

Browse files
authored
Merge branch 'trunk' into java-session-status-test-fix
2 parents 9a9b489 + 0c0d458 commit 6be8d7b

File tree

145 files changed

+2207
-12839
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+2207
-12839
lines changed

.bazelrc.remote

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ build:remote --disk_cache=
3131
build:remote --incompatible_enable_cc_toolchain_resolution
3232
build:remote --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
3333
test:remote --test_env=DISPLAY=:99.0
34-
test:remote --test_tag_filters=-skip-remote,-remote
34+
test:remote --test_tag_filters=-exclusive-if-local,-skip-remote,-remote
3535

3636
# Env vars we can hard code
3737
build:remote --action_env=HOME=/home/dev

.github/workflows/ci-ruby.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
browser: ${{ matrix.browser }}
112112
cache-key: rb-remote-${{ matrix.browser }}-${{ matrix.os }}-test
113113
os: ${{ matrix.os }}
114-
java-version: 11
114+
java-version: 17
115115
run: >
116116
bazel test
117117
--keep_going

MODULE.bazel

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -172,55 +172,56 @@ maven.install(
172172
artifacts = [
173173
"com.beust:jcommander:1.82",
174174
"com.github.javaparser:javaparser-core:3.26.3",
175-
"com.github.spotbugs:spotbugs:4.9.1",
175+
"com.github.spotbugs:spotbugs:4.9.3",
176176
"com.github.stephenc.jcip:jcip-annotations:1.0-1",
177+
"com.google.code.findbugs:jsr305:3.0.2",
177178
"com.google.code.gson:gson:2.12.1",
178179
"com.google.guava:guava:33.4.0-jre",
179180
"com.google.auto:auto-common:1.2.2",
180181
"com.google.auto.service:auto-service:1.1.1",
181182
"com.google.auto.service:auto-service-annotations:1.1.1",
182-
"com.google.googlejavaformat:google-java-format:jar:1.25.2",
183+
"com.google.googlejavaformat:google-java-format:1.25.2",
183184
"com.graphql-java:graphql-java:22.3",
184185
"dev.failsafe:failsafe:3.3.2",
185-
"io.grpc:grpc-context:1.70.0",
186-
"io.lettuce:lettuce-core:6.5.4.RELEASE",
187-
"io.netty:netty-buffer",
188-
"io.netty:netty-codec-http",
189-
"io.netty:netty-codec-http2",
190-
"io.netty:netty-common",
191-
"io.netty:netty-handler",
192-
"io.netty:netty-handler-proxy",
193-
"io.netty:netty-transport",
194-
"io.opentelemetry:opentelemetry-api",
195-
"io.opentelemetry:opentelemetry-context",
196-
"io.opentelemetry:opentelemetry-exporter-logging",
197-
"io.opentelemetry:opentelemetry-sdk",
198-
"io.opentelemetry:opentelemetry-sdk-common",
199-
"io.opentelemetry:opentelemetry-sdk-extension-autoconfigure",
200-
"io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi",
201-
"io.opentelemetry:opentelemetry-sdk-testing",
202-
"io.opentelemetry:opentelemetry-sdk-trace",
186+
"io.grpc:grpc-context:1.71.0",
187+
"io.lettuce:lettuce-core:6.5.5.RELEASE",
188+
"io.netty:netty-buffer:4.1.119.Final",
189+
"io.netty:netty-codec-http:4.1.119.Final",
190+
"io.netty:netty-codec-http2:4.1.119.Final",
191+
"io.netty:netty-common:4.1.119.Final",
192+
"io.netty:netty-handler:4.1.119.Final",
193+
"io.netty:netty-handler-proxy:4.1.119.Final",
194+
"io.netty:netty-transport:4.1.119.Final",
195+
"io.opentelemetry:opentelemetry-api:1.48.0",
196+
"io.opentelemetry:opentelemetry-context:1.48.0",
197+
"io.opentelemetry:opentelemetry-exporter-logging:1.48.0",
198+
"io.opentelemetry:opentelemetry-sdk:1.48.0",
199+
"io.opentelemetry:opentelemetry-sdk-common:1.48.0",
200+
"io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:1.48.0",
201+
"io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi:1.48.0",
202+
"io.opentelemetry:opentelemetry-sdk-testing:1.48.0",
203+
"io.opentelemetry:opentelemetry-sdk-trace:1.48.0",
203204
"it.ozimov:embedded-redis:0.7.3",
204-
"net.bytebuddy:byte-buddy:1.15.11",
205-
"org.htmlunit:htmlunit-core-js:4.7.0",
205+
"net.bytebuddy:byte-buddy:1.17.2",
206+
"org.htmlunit:htmlunit-core-js:4.10.0",
206207
"org.apache.commons:commons-exec:1.4.0",
207208
"org.apache.logging.log4j:log4j-core:2.24.3",
208-
"org.assertj:assertj-core:3.27.2",
209-
"org.bouncycastle:bcpkix-jdk18on:1.79",
209+
"org.assertj:assertj-core:3.27.3",
210+
"org.bouncycastle:bcpkix-jdk18on:1.80",
210211
"org.eclipse.mylyn.github:org.eclipse.egit.github.core:2.1.5",
211212
"org.hsqldb:hsqldb:2.7.4",
212213
"org.jspecify:jspecify:1.0.0",
213-
"org.junit.jupiter:junit-jupiter-api",
214-
"org.junit.jupiter:junit-jupiter-engine",
215-
"org.junit.jupiter:junit-jupiter-params",
216-
"org.junit.platform:junit-platform-launcher",
217-
"org.junit.platform:junit-platform-reporting",
218-
"org.junit.platform:junit-platform-commons",
219-
"org.junit.platform:junit-platform-engine",
220-
"org.mockito:mockito-core:5.15.2",
221-
"org.redisson:redisson:3.41.0",
222-
"org.slf4j:slf4j-api:2.0.16",
223-
"org.slf4j:slf4j-jdk14:2.0.16",
214+
"org.junit.jupiter:junit-jupiter-api:5.12.1",
215+
"org.junit.jupiter:junit-jupiter-engine:5.12.1",
216+
"org.junit.jupiter:junit-jupiter-params:5.12.1",
217+
"org.junit.platform:junit-platform-launcher:1.12.1",
218+
"org.junit.platform:junit-platform-reporting:1.12.1",
219+
"org.junit.platform:junit-platform-commons:1.12.1",
220+
"org.junit.platform:junit-platform-engine:1.12.1",
221+
"org.mockito:mockito-core:5.16.1",
222+
"org.redisson:redisson:3.45.0",
223+
"org.slf4j:slf4j-api:2.0.17",
224+
"org.slf4j:slf4j-jdk14:2.0.17",
224225
"org.tomlj:tomlj:1.1.1",
225226
"org.zeromq:jeromq:0.6.0",
226227
],

README.md

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,16 +210,47 @@ To automatically update and pin new dependencies, run:
210210

211211
### Python
212212

213-
You can run Python code locally by updating generated files in the python directory using:
213+
#### Linting
214+
215+
We follow the [PEP8 Style Guide for Python Code](https://peps.python.org/pep-0008) (except we use a 120 character line length).
216+
This is checked and enforced with several linting tools, including
217+
[black](https://pypi.org/project/black),
218+
[docformatter](https://pypi.org/project/docformatter),
219+
[flake8](https://flake8.pycqa.org),
220+
and [isort](https://pycqa.github.io/isort).
221+
222+
To run all of the linting tools:
223+
```shell
224+
./go py:lint
225+
```
226+
227+
You need `tox` installed to run the linting tools (`pip install tox`).
228+
229+
#### Local Installation
230+
231+
To run Python code locally without building/installing the package, you must first install the dependencies:
232+
```shell
233+
pip install -r py/requirements.txt
234+
```
235+
236+
Then, build the generated files and copy them into your local source tree:
214237
```shell
215-
./go py:update
238+
./go py:local_dev
216239
```
217240

218-
To install Selenium locally based on a specific commit, you can use:
241+
After that, you can import the selenium package directly from source from the `py` directory.
242+
243+
Instead of running from source, you can build and install the selenium package (wheel) locally:
219244
```shell
220245
./go py:install
221246
```
222247

248+
This will attempt to install into the global Python `site-packages` directory,
249+
which might not be writable. To avoid this, you should create and activate a
250+
[virtual environment](https://packaging.python.org/en/latest/tutorials/installing-packages/#creating-virtual-environments)
251+
before installing.
252+
253+
223254
### Ruby
224255

225256
Instead of using `irb`, you can create an interactive REPL with all gems loaded using: `bazel run //rb:console`
@@ -283,6 +314,9 @@ Tests can also be filtered by tag like:
283314
bazel test //<language>/... --test_tag_filters=this,-not-this
284315
```
285316

317+
If there are multiple `--test_tag_filters`, only the last one is considered,
318+
so be careful if also using an inherited config
319+
286320
### Java
287321

288322
<details>

Rakefile

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,13 @@ task '//java/test/org/openqa/selenium/environment/webserver:webserver:uber' => [
9292
'//java/test/org/openqa/selenium/environment:webserver'
9393
]
9494

95-
# Java targets required for release. These should all be java_export targets.
96-
# Generated from: bazel query 'kind(maven_publish, set(//java/... //third_party/...))' | sort
95+
# use #java_release_targets to access this list
9796
JAVA_RELEASE_TARGETS = %w[
9897
//java/src/org/openqa/selenium/chrome:chrome.publish
9998
//java/src/org/openqa/selenium/chromium:chromium.publish
100-
//java/src/org/openqa/selenium/devtools/v131:v131.publish
99+
//java/src/org/openqa/selenium/devtools/v134:v134.publish
101100
//java/src/org/openqa/selenium/devtools/v132:v132.publish
102101
//java/src/org/openqa/selenium/devtools/v133:v133.publish
103-
//java/src/org/openqa/selenium/devtools/v85:v85.publish
104102
//java/src/org/openqa/selenium/edge:edge.publish
105103
//java/src/org/openqa/selenium/firefox:firefox.publish
106104
//java/src/org/openqa/selenium/grid/sessionmap/jdbc:jdbc.publish
@@ -120,6 +118,34 @@ JAVA_RELEASE_TARGETS = %w[
120118
//java/src/org/openqa/selenium:core.publish
121119
].freeze
122120

121+
def java_release_targets
122+
@targets_verified ||= verify_java_release_targets
123+
124+
JAVA_RELEASE_TARGETS
125+
end
126+
127+
def verify_java_release_targets
128+
query = 'kind(maven_publish, set(//java/... //third_party/...))'
129+
current_targets = []
130+
131+
Bazel.execute('query', [], query) do |output|
132+
current_targets = output.lines.map(&:strip).reject(&:empty?)
133+
end
134+
135+
missing_targets = current_targets - JAVA_RELEASE_TARGETS
136+
extra_targets = JAVA_RELEASE_TARGETS - current_targets
137+
138+
return if missing_targets.empty? && extra_targets.empty?
139+
140+
error_message = 'Java release targets are out of sync with Bazel query results.'
141+
142+
error_message += "\nMissing targets: #{missing_targets.join(', ')}" unless missing_targets.empty?
143+
144+
error_message += "\nObsolete targets: #{extra_targets.join(', ')}" unless extra_targets.empty?
145+
146+
raise error_message
147+
end
148+
123149
# Notice that because we're using rake, anything you can do in a normal rake
124150
# build can also be done here. For example, here we set the default task
125151
task default: [:grid]
@@ -364,7 +390,7 @@ end
364390

365391
desc 'Install jars to local m2 directory'
366392
task :'maven-install' do
367-
JAVA_RELEASE_TARGETS.each do |p|
393+
java_release_targets.each do |p|
368394
Bazel.execute('run',
369395
['--stamp',
370396
'--define',
@@ -826,7 +852,7 @@ namespace :java do
826852
desc 'Build Java Client Jars'
827853
task :build do |_task, arguments|
828854
args = arguments.to_a.compact
829-
JAVA_RELEASE_TARGETS.each { |target| Bazel.execute('build', args, target) }
855+
java_release_targets.each { |target| Bazel.execute('build', args, target) }
830856
end
831857

832858
desc 'Build Grid Server'
@@ -873,7 +899,7 @@ namespace :java do
873899
Rake::Task['java:package'].invoke('--config=release')
874900
Rake::Task['java:build'].invoke('--config=release')
875901
# Because we want to `run` things, we can't use the `release` config
876-
JAVA_RELEASE_TARGETS.each { |target| Bazel.execute('run', ['--config=release'], target) }
902+
java_release_targets.each { |target| Bazel.execute('run', ['--config=release'], target) }
877903
end
878904

879905
desc 'Install jars to local m2 directory'
@@ -894,22 +920,19 @@ namespace :java do
894920

895921
file_path = 'MODULE.bazel'
896922
content = File.read(file_path)
897-
# For some reason ./go wrapper is not outputting from Open3, so cannot use Bazel class directly
898-
output = `bazel run @maven//:outdated`
899-
900-
output.scan(/\S+ \[\S+-alpha\]/).each do |match|
901-
puts "WARNING — Cannot automatically update alpha version of: #{match}"
923+
output = nil
924+
Bazel.execute('run', [], '@maven//:outdated') do |out|
925+
output = out
902926
end
903927

904928
versions = output.scan(/(\S+) \[\S+ -> (\S+)\]/).to_h
905929
versions.each do |artifact, version|
906930
if artifact.match?('graphql')
931+
# https://github.com/graphql-java/graphql-java/discussions/3187
907932
puts 'WARNING — Cannot automatically update graphql'
908933
next
909934
end
910-
911-
replacement = artifact.include?('googlejavaformat') ? "#{artifact}:jar:#{version}" : "#{artifact}:#{version}"
912-
content.gsub!(/#{artifact}:(jar:)?\d+\.\d+[^\\"]+/, replacement)
935+
content.sub!(/#{Regexp.escape(artifact)}:([\d.-]+(?:[-.]?[A-Za-z0-9]+)*)/, "#{artifact}:#{version}")
913936
end
914937
File.write(file_path, content)
915938

0 commit comments

Comments
 (0)