Skip to content

Commit 85eedb8

Browse files
committed
test: use rules_nodejs@HEAD for testing of more recent node versions
1 parent 002f6d7 commit 85eedb8

File tree

2 files changed

+46
-18
lines changed

2 files changed

+46
-18
lines changed

MODULE.bazel

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ bazel_dep(name = "bazelrc-preset.bzl", version = "1.3.0", dev_dependency = True)
5454
bazel_dep(name = "aspect_rules_lint", version = "1.1.0", dev_dependency = True)
5555
bazel_dep(name = "buildifier_prebuilt", version = "8.0.1", dev_dependency = True)
5656

57+
# Overrides of non-dev deps for local testing using recent versions
58+
archive_override(
59+
module_name = "rules_nodejs",
60+
integrity = "sha256-OY23vNcf28WAxvjReCrpn1JQeRFypf/jHS+dgTjzOC4=",
61+
strip_prefix = "rules_nodejs-7cbb1fb5378fb4739e4d9698a14abd9eada900f0",
62+
urls = [
63+
"https://github.com/bazel-contrib/rules_nodejs/archive/7cbb1fb5378fb4739e4d9698a14abd9eada900f0.tar.gz",
64+
],
65+
)
66+
5767
host = use_extension(
5868
"@aspect_bazel_lib//lib:extensions.bzl",
5969
"host",
@@ -67,20 +77,34 @@ node_dev = use_extension(
6777
"node",
6878
dev_dependency = True,
6979
)
70-
use_repo(node_dev, "node20_linux_amd64")
71-
use_repo(node_dev, "node20_darwin_arm64")
72-
use_repo(node_dev, "node20_darwin_amd64")
73-
use_repo(node_dev, "node20_linux_arm64")
74-
use_repo(node_dev, "node20_linux_s390x")
75-
use_repo(node_dev, "node20_linux_ppc64le")
76-
use_repo(node_dev, "node20_windows_amd64")
7780
use_repo(node_dev, "node18_linux_amd64")
7881
use_repo(node_dev, "node18_darwin_arm64")
7982
use_repo(node_dev, "node18_darwin_amd64")
8083
use_repo(node_dev, "node18_linux_arm64")
8184
use_repo(node_dev, "node18_linux_s390x")
8285
use_repo(node_dev, "node18_linux_ppc64le")
8386
use_repo(node_dev, "node18_windows_amd64")
87+
use_repo(node_dev, "node20_linux_amd64")
88+
use_repo(node_dev, "node20_darwin_arm64")
89+
use_repo(node_dev, "node20_darwin_amd64")
90+
use_repo(node_dev, "node20_linux_arm64")
91+
use_repo(node_dev, "node20_linux_s390x")
92+
use_repo(node_dev, "node20_linux_ppc64le")
93+
use_repo(node_dev, "node20_windows_amd64")
94+
use_repo(node_dev, "node22_linux_amd64")
95+
use_repo(node_dev, "node22_darwin_arm64")
96+
use_repo(node_dev, "node22_darwin_amd64")
97+
use_repo(node_dev, "node22_linux_arm64")
98+
use_repo(node_dev, "node22_linux_s390x")
99+
use_repo(node_dev, "node22_linux_ppc64le")
100+
use_repo(node_dev, "node22_windows_amd64")
101+
use_repo(node_dev, "node24_linux_amd64")
102+
use_repo(node_dev, "node24_darwin_arm64")
103+
use_repo(node_dev, "node24_darwin_amd64")
104+
use_repo(node_dev, "node24_linux_arm64")
105+
use_repo(node_dev, "node24_linux_s390x")
106+
use_repo(node_dev, "node24_linux_ppc64le")
107+
use_repo(node_dev, "node24_windows_amd64")
84108
node_dev.toolchain(node_version = "18.20.4")
85109
node_dev.toolchain(
86110
name = "node18",
@@ -90,6 +114,14 @@ node_dev.toolchain(
90114
name = "node20",
91115
node_version = "20.17.0",
92116
)
117+
node_dev.toolchain(
118+
name = "node22",
119+
node_version = "22.20.0",
120+
)
121+
node_dev.toolchain(
122+
name = "node24",
123+
node_version = "24.9.0",
124+
)
93125

94126
############################################
95127
# npm dependencies used by examples

js/private/test/node-patches/BUILD.bazel

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,17 @@ TESTS = [
1414
TOOLCHAINS_NAMES = [
1515
"node18",
1616
"node20",
17-
18-
# TODO: add newer LTS when rules_nodejs upgraded
17+
"node22",
18+
"node24",
1919
]
2020

2121
TOOLCHAINS_VERSIONS = [
2222
select({
23-
"@bazel_tools//src/conditions:linux_x86_64": "@node18_linux_amd64//:node_toolchain",
24-
"@bazel_tools//src/conditions:darwin": "@node18_darwin_amd64//:node_toolchain",
25-
"@bazel_tools//src/conditions:windows": "@node18_windows_amd64//:node_toolchain",
26-
}),
27-
select({
28-
"@bazel_tools//src/conditions:linux_x86_64": "@node20_linux_amd64//:node_toolchain",
29-
"@bazel_tools//src/conditions:darwin": "@node20_darwin_amd64//:node_toolchain",
30-
"@bazel_tools//src/conditions:windows": "@node20_windows_amd64//:node_toolchain",
31-
}),
23+
"@bazel_tools//src/conditions:linux_x86_64": "@%s_linux_amd64//:node_toolchain" % n,
24+
"@bazel_tools//src/conditions:darwin": "@%s_darwin_amd64//:node_toolchain" % n,
25+
"@bazel_tools//src/conditions:windows": "@%s_windows_amd64//:node_toolchain" % n,
26+
})
27+
for n in TOOLCHAINS_NAMES
3228
]
3329

3430
# We need to copy the entry points to the bin so that the tests below don't follow the execroot

0 commit comments

Comments
 (0)