From c91a595b6a278289191f92e47019deb2b56b4cd5 Mon Sep 17 00:00:00 2001 From: Isaac Parker <128327439+isaacparker0@users.noreply.github.com> Date: Fri, 21 Aug 2026 09:35:25 -0400 Subject: [PATCH] Test Node from downstream Bzlmod module --- .github/workflows/ci.yml | 3 ++- tests/integration/BUILD.bazel | 27 +++++++++++++++++++++++++++ tests/integration/node_test.sh | 16 ++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100755 tests/integration/node_test.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a6019e..76c39d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: 'deps(@v8//:icu/d8) + deps(@nodejs_icu_26_3_1//:icu) + deps(@nodejs_crates_26_3_1//:cargo_files)' >/dev/null - - name: Test consumer source contract + - name: Test downstream consumer working-directory: tests/integration run: | bazel test \ @@ -34,6 +34,7 @@ jobs: --config=remote \ --jobs=64 \ --lockfile_mode=error \ + //:node_test \ //:source_contract_test - name: Build bundled ICU diff --git a/tests/integration/BUILD.bazel b/tests/integration/BUILD.bazel index 13ae8d7..8acfef8 100644 --- a/tests/integration/BUILD.bazel +++ b/tests/integration/BUILD.bazel @@ -1,5 +1,32 @@ load("@rules_shell//shell:sh_test.bzl", "sh_test") +sh_test( + name = "node_test", + srcs = ["node_test.sh"], + args = ["$(rootpath @nodejs_26_3_1//:node)"] + select( + { + "@nodejs_26_3_1//:target_linux_arm64": [ + "arm64", + "linux", + ], + "@nodejs_26_3_1//:target_linux_x86_64": [ + "x64", + "linux", + ], + "@nodejs_26_3_1//:target_macos_arm64": [ + "arm64", + "darwin", + ], + "@nodejs_26_3_1//:target_macos_x86_64": [ + "x64", + "darwin", + ], + }, + no_match_error = "node_test currently supports Linux and macOS x86_64 and arm64 targets", + ), + data = ["@nodejs_26_3_1//:node"], +) + sh_test( name = "source_contract_test", srcs = ["source_contract_test.sh"], diff --git a/tests/integration/node_test.sh b/tests/integration/node_test.sh new file mode 100755 index 0000000..7649571 --- /dev/null +++ b/tests/integration/node_test.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -euo pipefail + +node="$1" +arch="$2" +platform="$3" + +"$node" - "$arch" "$platform" <<'JS' +'use strict'; + +const assert = require('node:assert/strict'); + +assert.equal(process.version, 'v26.3.1'); +assert.equal(process.arch, process.argv[2]); +assert.equal(process.platform, process.argv[3]); +JS