Skip to content

Commit 8d23277

Browse files
authored
Remove duplicate node_modules from protractor_test. (#26)
These cause issues when not using Bzlmod. Sadly, we do need module local modules when using Bzlmod, so the test module specifies them manually now.
1 parent 69c8855 commit 8d23277

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

protractor_test/index.bzl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ def protractor_test(name, server, deps, extra_config = {}, data = [], enable_per
1616
":%s_protractor_extra_config" % name,
1717
"@rules_browsers//browsers/chromium",
1818
"@rules_browsers//protractor_test:config",
19-
# Depend on both the node modules from the calling module and the one's from the
20-
# macro-defining module (rules_browsers). Without these, running Protractor tests fails
21-
# when using Bzlmod.
22-
"//:node_modules/protractor",
23-
"//:node_modules/tinyglobby",
2419
Label("//:node_modules/protractor"),
2520
Label("//:node_modules/tinyglobby"),
2621
],

test/protractor_test/BUILD.bazel

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,14 @@ js_library(
1414
protractor_test(
1515
name = "test",
1616
server = ":server_bin",
17-
deps = [":tests"],
17+
deps = [
18+
":tests",
19+
# Need to add these manually because the `Label` references in the `protractor_test`
20+
# implementation mean it uses `rules_browsers` local node modules. These end up in a
21+
# directory in `external/` under the execroot (because they're in a module). Since module
22+
# resolution in Node looks for a `node_modules` directory in the ancestors, any
23+
# `node_modules` in a subdirectory of the execroot won't be found.
24+
"//:node_modules/protractor",
25+
"//:node_modules/tinyglobby",
26+
],
1827
)

0 commit comments

Comments
 (0)