From 9ed51d2f829fd107b96f26aba3c6668f41a8988c Mon Sep 17 00:00:00 2001 From: Dan Hensby Date: Tue, 23 Jun 2026 11:08:57 +0100 Subject: [PATCH] feat: test msnodesqlv8 against v2-v5 across supported Node versions Exercise the optional msnodesqlv8 driver against every supported major on each Node version that ships a prebuilt win32-x64 binary for it, rather than only v2 (Node 18/20) and v4 (Node 22/24): v2: Node 18 v3: Node 18, 20 v4: Node 18-24 v5: Node 20, 22, 24 v2 ships no prebuilt binary for Node 20+, so it fell back to a node-gyp source build that broke once windows-2025 moved to Visual Studio 2026 (which the bundled node-gyp cannot detect). Gating each major to its prebuilt-binary range removes the source build entirely and broadens coverage to v3 and v5. Also drops an always-false condition (node == '22.x' && node == '24.x') that silently skipped the driver tests on Node 22 and 24. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/nodejs.yml | 34 ++++++++++++++++++++++++++-------- README.md | 2 +- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index e4c0d969..993f9530 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -145,17 +145,35 @@ jobs: run: npm run test-tedious - name: Run cli tests run: npm run test-cli - - name: Install msnodesqlv8 - if: ${{ matrix.node != '22.x' && matrix.node != '24.x' }} + # msnodesqlv8 is exercised across its supported major versions. Each major + # is gated to the Node versions it ships prebuilt win32-x64 binaries for — + # a combo without a prebuild falls back to a node-gyp source build, which is + # brittle on the GitHub Windows images (e.g. the VS 2026 rollout on + # windows-2025 that node-gyp cannot detect). Coverage: + # v2: Node 18 v3: Node 18-20 v4: Node 18-24 v5: Node 20-24 + - name: Install msnodesqlv8 v2 + if: ${{ matrix.node == '18.x' }} run: npm install --no-save msnodesqlv8@^2 - - name: Run msnodesqlv8 tests - if: ${{ matrix.node != '22.x' && matrix.node != '24.x' }} + - name: Run msnodesqlv8 v2 tests + if: ${{ matrix.node == '18.x' }} run: npm run test-msnodesqlv8 - - name: Install msnodesqlv8 - if: ${{ matrix.node == '22.x' || matrix.node == '24.x' }} + - name: Install msnodesqlv8 v3 + if: ${{ matrix.node == '18.x' || matrix.node == '20.x' }} + run: npm install --no-save msnodesqlv8@^3 + - name: Run msnodesqlv8 v3 tests + if: ${{ matrix.node == '18.x' || matrix.node == '20.x' }} + run: npm run test-msnodesqlv8 + - name: Install msnodesqlv8 v4 + if: ${{ matrix.node == '18.x' || matrix.node == '20.x' || matrix.node == '22.x' || matrix.node == '24.x' }} run: npm install --no-save msnodesqlv8@^4 - - name: Run msnodesqlv8 tests - if: ${{ matrix.node == '22.x' && matrix.node == '24.x' }} + - name: Run msnodesqlv8 v4 tests + if: ${{ matrix.node == '18.x' || matrix.node == '20.x' || matrix.node == '22.x' || matrix.node == '24.x' }} + run: npm run test-msnodesqlv8 + - name: Install msnodesqlv8 v5 + if: ${{ matrix.node == '20.x' || matrix.node == '22.x' || matrix.node == '24.x' }} + run: npm install --no-save msnodesqlv8@^5 + - name: Run msnodesqlv8 v5 tests + if: ${{ matrix.node == '20.x' || matrix.node == '22.x' || matrix.node == '24.x' }} run: npm run test-msnodesqlv8 release: name: Release diff --git a/README.md b/README.md index 51152ce4..f8632428 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Supported TDS drivers: - [Tedious][tedious-url] (pure JavaScript - Windows/macOS/Linux, default) -- [MSNodeSQLv8][msnodesqlv8-url] (Microsoft / Contributors Node V8 Driver for Node.js for SQL Server, v2 native - Windows or Linux/macOS 64 bits only) +- [MSNodeSQLv8][msnodesqlv8-url] (Microsoft / Contributors Node V8 Driver for Node.js for SQL Server, v2-v5 native - Windows or Linux/macOS 64 bits only) ## Installation