Skip to content

Commit 9546dba

Browse files
[build] Move bazel version to 5
1 parent a695b91 commit 9546dba

12 files changed

Lines changed: 12014 additions & 16677 deletions

File tree

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.2.1
1+
5.1.1

WORKSPACE

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,18 +137,17 @@ selenium_register_dotnet()
137137

138138
http_archive(
139139
name = "build_bazel_rules_nodejs",
140-
sha256 = "ad3e5afa52ef9aac4da426f61e339c054ecbc0e6665cec2109f8846b4c8339e3",
141-
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.6.3/rules_nodejs-4.6.3.tar.gz"],
140+
sha256 = "e328cb2c9401be495fa7d79c306f5ee3040e8a03b2ebb79b022e15ca03770096",
141+
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.4.2/rules_nodejs-5.4.2.tar.gz"],
142142
)
143+
load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies")
144+
145+
build_bazel_rules_nodejs_dependencies()
143146

144147
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "npm_install")
145148

146149
node_repositories(
147150
node_version = "16.4.2",
148-
package_json = [
149-
"//:package.json",
150-
"//javascript/grid-ui:package.json",
151-
],
152151
)
153152

154153
npm_install(

java/private/module.bzl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def _java_module_aspect_impl(target, ctx):
5858
derived = "unknown"
5959
if JavaModuleInfo in target:
6060
module_path = target[JavaModuleInfo].module_path
61-
jars = target[JavaInfo].runtime_output_jars
61+
jars = depset(target[JavaInfo].runtime_output_jars)
6262
source_jars = target[JavaInfo].source_jars
6363
java_info = target[JavaInfo]
6464
elif name:
@@ -97,7 +97,7 @@ def _java_module_impl(ctx):
9797

9898
all_infos = [dep[_GatheredModuleInfo] for dep in ctx.attr.deps] + [dep[_GatheredModuleInfo] for dep in ctx.attr.exports]
9999

100-
included_jars = depset([ctx.file.target], transitive = [depset(info.jars) for info in all_infos])
100+
included_jars = depset(direct = [ctx.file.target], transitive = [info.jars for info in all_infos])
101101

102102
# Now that we have a single jar, derive the module info.
103103
all_jars = depset(transitive = [info.module_path for info in all_infos]).to_list()
@@ -152,11 +152,10 @@ def _java_module_impl(ctx):
152152
actions = ctx.actions,
153153
output_source_jar = ctx.actions.declare_file("lib%s-src.jar" % ctx.attr.name),
154154
source_jars = depset(
155-
items = ctx.attr.target[JavaInfo].source_jars,
155+
direct = ctx.attr.target[JavaInfo].source_jars,
156156
transitive = [info.source_jars for info in all_infos if not info.name],
157157
).to_list(),
158158
java_toolchain = ctx.attr._java_toolchain[java_common.JavaToolchainInfo],
159-
host_javabase = ctx.attr._javabase[java_common.JavaRuntimeInfo],
160159
)
161160

162161
# TODO: This JavaInfo needs to have the JavaInfos of all jars included in module stripped

java/src/org/openqa/selenium/grid/BUILD.bazel

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@ java_export(
9393
"org.openqa.selenium.json",
9494
],
9595
pom_template = "//java/src/org/openqa/selenium:template-pom",
96-
resource_jars = [
97-
"//javascript/grid-ui:react_jar",
98-
],
9996
uses = [
10097
"org.openqa.selenium.WebDriverInfo",
10198
"org.openqa.selenium.cli.CliCommand",
@@ -122,6 +119,7 @@ java_export(
122119
"//java/src/org/openqa/selenium/grid/session",
123120
"//java/src/org/openqa/selenium/grid/sessionmap/httpd",
124121
"//java/src/org/openqa/selenium/grid/sessionqueue/httpd",
122+
"//javascript/grid-ui:react_jar",
125123
] + CDP_DEPS,
126124
deps = [
127125
":base-command",

java/src/org/openqa/selenium/grid/node/config/NodeOptions.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,11 +464,14 @@ private void addSpecificDrivers(
464464
})
465465
.collect(Collectors.toList());
466466

467-
allDrivers.entrySet().stream()
467+
Optional<Map.Entry<WebDriverInfo, Collection<SessionFactory>>> first = allDrivers.entrySet().stream()
468468
.filter(entry -> drivers.contains(entry.getKey().getDisplayName().toLowerCase()))
469-
.findFirst()
470-
.orElseThrow(() ->
471-
new ConfigException("No drivers were found for %s", drivers.toString()));
469+
.findFirst();
470+
471+
if (!first.isPresent()) {
472+
throw new ConfigException("No drivers were found for %s", drivers.toString());
473+
}
474+
472475

473476
allDrivers.entrySet().stream()
474477
.filter(entry -> drivers.contains(entry.getKey().getDisplayName().toLowerCase()))

java/src/org/openqa/selenium/lift/Finders.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ public Collection<WebElement> findFrom(WebDriver context) {
130130
Collection<WebElement> collection = super.findFrom(context);
131131
if (!collection.isEmpty()) {
132132
Iterator<WebElement> iter = collection.iterator();
133-
iter.hasNext();
134133
return Collections.singletonList(iter.next());
135134
}
136135
return collection;

java/test/org/openqa/selenium/grid/node/config/NodeOptionsTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
@SuppressWarnings("DuplicatedCode")
6262
public class NodeOptionsTest {
6363

64+
@SuppressWarnings("ReturnValueIgnored")
6465
@Test
6566
public void canConfigureNodeWithDriverDetection() {
6667
assumeFalse("We don't have driver servers in PATH when we run unit tests",

javascript/grid-ui/BUILD.bazel

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,16 @@ react_scripts(
6464
)
6565

6666
zip_file(
67-
name = "react_jar",
67+
name = "react_zip",
6868
srcs = [
6969
":build",
7070
],
7171
extension = "jar",
72+
)
73+
74+
java_import(
75+
name = "react_jar",
76+
jars = ["react_zip"],
7277
visibility = [
7378
"//java/src/org/openqa/selenium/grid:__pkg__",
7479
],

javascript/node/selenium-webdriver/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ nodejs_binary(
6363
"//javascript/node/selenium-webdriver/lib/atoms:find-elements",
6464
"//javascript/node/selenium-webdriver/lib/atoms:mutation-listener",
6565
],
66-
entry_point = "lib/test/fileserver.ts",
66+
entry_point = "lib/test/fileserver.js",
6767
)
6868

6969
jasmine_node_test(

javascript/node/selenium-webdriver/testing/index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const { Builder } = require('../index')
4646
* Describes a browser targeted by a {@linkplain suite test suite}.
4747
* @record
4848
*/
49-
function TargetBrowser() {}
49+
function TargetBrowser() { }
5050

5151
/**
5252
* The {@linkplain Browser name} of the targeted browser.
@@ -208,16 +208,16 @@ function init(force = false) {
208208
if (seleniumJar && seleniumUrl) {
209209
throw Error(
210210
'Ambiguous test configuration: both SELENIUM_REMOTE_URL' +
211-
' && SELENIUM_SERVER_JAR environment variables are set'
211+
' && SELENIUM_SERVER_JAR environment variables are set'
212212
)
213213
}
214214

215215
const envBrowsers = getBrowsersToTestFromEnv()
216216
if ((seleniumJar || seleniumUrl) && envBrowsers.length === 0) {
217217
throw Error(
218218
'Ambiguous test configuration: when either the SELENIUM_REMOTE_URL or' +
219-
' SELENIUM_SERVER_JAR environment variable is set, the' +
220-
' SELENIUM_BROWSER variable must also be set.'
219+
' SELENIUM_SERVER_JAR environment variable is set, the' +
220+
' SELENIUM_BROWSER variable must also be set.'
221221
)
222222
}
223223

@@ -295,7 +295,7 @@ class Environment {
295295
builder.getCapabilities().merge(browser.capabilities);
296296
}
297297

298-
if(browser.name === 'firefox') {
298+
if (browser.name === 'firefox') {
299299
builder.setCapability('moz:debuggerAddress', true);
300300
}
301301

@@ -315,7 +315,7 @@ class Environment {
315315
* Configuration options for a {@linkplain ./index.suite test suite}.
316316
* @record
317317
*/
318-
function SuiteOptions() {}
318+
function SuiteOptions() { }
319319

320320
/**
321321
* The browsers to run the test suite against.
@@ -490,8 +490,8 @@ function getTestHook(name) {
490490
if (type !== 'function') {
491491
throw TypeError(
492492
`Expected global.${name} to be a function, but is ${type}.` +
493-
' This can happen if you try using this module when running with' +
494-
' node directly instead of using jasmine or mocha'
493+
' This can happen if you try using this module when running with' +
494+
' node directly instead of using jasmine or mocha'
495495
)
496496
}
497497
return fn

0 commit comments

Comments
 (0)