From b6269ed557bb8118d715d323c0c8894c2a778755 Mon Sep 17 00:00:00 2001 From: Jason Bedard Date: Wed, 13 Mar 2024 11:41:16 -0700 Subject: [PATCH] test: add node20 toolchain tests (#1500) --- MODULE.bazel | 11 +++++++++++ WORKSPACE | 5 +++++ js/private/test/node-patches/BUILD.bazel | 6 ++++++ js/private/test/node-patches_legacy/BUILD.bazel | 6 ++++++ 4 files changed, 28 insertions(+) diff --git a/MODULE.bazel b/MODULE.bazel index 8a4ce166a..d1165a184 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -73,6 +73,13 @@ node_dev = use_extension( dev_dependency = True, ) use_repo(node_dev, "nodejs_toolchains") +use_repo(node_dev, "node20_linux_amd64") +use_repo(node_dev, "node20_darwin_arm64") +use_repo(node_dev, "node20_darwin_amd64") +use_repo(node_dev, "node20_linux_arm64") +use_repo(node_dev, "node20_linux_s390x") +use_repo(node_dev, "node20_linux_ppc64le") +use_repo(node_dev, "node20_windows_amd64") use_repo(node_dev, "node18_linux_amd64") use_repo(node_dev, "node18_darwin_arm64") use_repo(node_dev, "node18_darwin_amd64") @@ -96,6 +103,10 @@ node_dev.toolchain( name = "node18", node_version = "18.13.0", ) +node_dev.toolchain( + name = "node20", + node_version = "20.11.1", +) ############################################ # npm dependencies used by examples diff --git a/WORKSPACE b/WORKSPACE index 4c1a7776d..2cca60fee 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -49,6 +49,11 @@ nodejs_register_toolchains( node_version = "18.13.0", ) +nodejs_register_toolchains( + name = "node20", + node_version = "20.11.1", +) + load("@bazel_skylib//lib:unittest.bzl", "register_unittest_toolchains") register_unittest_toolchains() diff --git a/js/private/test/node-patches/BUILD.bazel b/js/private/test/node-patches/BUILD.bazel index 61c9a07b3..16c9b58cd 100644 --- a/js/private/test/node-patches/BUILD.bazel +++ b/js/private/test/node-patches/BUILD.bazel @@ -14,6 +14,7 @@ TESTS = [ TOOLCHAINS_NAMES = [ "node16", "node18", + "node20", ] TOOLCHAINS_VERSIONS = [ @@ -27,6 +28,11 @@ TOOLCHAINS_VERSIONS = [ "@bazel_tools//src/conditions:darwin": "@node18_darwin_amd64//:node_toolchain", "@bazel_tools//src/conditions:windows": "@node18_windows_amd64//:node_toolchain", }), + select({ + "@bazel_tools//src/conditions:linux_x86_64": "@node20_linux_amd64//:node_toolchain", + "@bazel_tools//src/conditions:darwin": "@node20_darwin_amd64//:node_toolchain", + "@bazel_tools//src/conditions:windows": "@node20_windows_amd64//:node_toolchain", + }), ] # We need to copy the entry points to the bin so that the tests below don't follow the execroot diff --git a/js/private/test/node-patches_legacy/BUILD.bazel b/js/private/test/node-patches_legacy/BUILD.bazel index 1a8d57da6..586331673 100644 --- a/js/private/test/node-patches_legacy/BUILD.bazel +++ b/js/private/test/node-patches_legacy/BUILD.bazel @@ -14,6 +14,7 @@ TESTS = [ TOOLCHAINS_NAMES = [ "node16", "node18", + "node20", ] TOOLCHAINS_VERSIONS = [ @@ -27,6 +28,11 @@ TOOLCHAINS_VERSIONS = [ "@bazel_tools//src/conditions:darwin": "@node18_darwin_amd64//:node_toolchain", "@bazel_tools//src/conditions:windows": "@node18_windows_amd64//:node_toolchain", }), + select({ + "@bazel_tools//src/conditions:linux_x86_64": "@node20_linux_amd64//:node_toolchain", + "@bazel_tools//src/conditions:darwin": "@node20_darwin_amd64//:node_toolchain", + "@bazel_tools//src/conditions:windows": "@node20_windows_amd64//:node_toolchain", + }), ] # We need to copy the entry points to the bin so that the tests below don't follow the execroot