From d6511c6263055ca3b0b653257803a25c062537eb Mon Sep 17 00:00:00 2001 From: janehe Date: Wed, 4 Feb 2026 14:51:13 -0800 Subject: [PATCH 01/16] init ASF CI on GA --- .github/workflows/test.yml | 85 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..82aa124c --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,85 @@ +name: Unit and Integration Tests for Apache Cassandra NodeJS Driver + +on: + push: + pull_request: + workflow_dispatch: # allow manual trigger from Actions page +permissions: + contents: read + actions: read + checks: write +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + + env: + CCM_VERSION: 3.11.4 + steps: + - name: Checkout + uses: actions/checkout@v4 + + # ---- Python for ccm ---- + - name: Set up Python 3.9.16 + uses: actions/setup-python@v5 + with: + python-version: '3.9.16' + + - name: Install ccm + run: | + python -m pip install --upgrade pip + git clone --depth 1 --single-branch -b cassandra-test https://github.com/apache/cassandra-ccm.git + cd cassandra-ccm + pip install -r requirements.txt + ./setup.py install + + # ---- Install required Zulu JDKs (8/11/17) and capture their homes ---- + - name: Install Zulu 8 + id: z8 + uses: actions/setup-java@v5 + with: + distribution: zulu + java-version: '8' + cache: maven + - name: Install Zulu 11 + id: z11 + uses: actions/setup-java@v5 + with: + distribution: zulu + java-version: '11' + - name: Install Zulu 17 + id: z17 + uses: actions/setup-java@v5 + with: + distribution: zulu + java-version: '17' + + - name: Export JAVA*_HOME variables + run: | + echo "JAVA8_HOME=${{ steps.z8.outputs.path }}" >> "$GITHUB_ENV" + echo "JAVA11_HOME=${{ steps.z11.outputs.path }}" >> "$GITHUB_ENV" + echo "JAVA17_HOME=${{ steps.z17.outputs.path }}" >> "$GITHUB_ENV" + echo "JAVA_HOME=${{ steps.z8.outputs.path }}" >> "$GITHUB_ENV" + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + # ---- Print env vars before build ---- + - name: Print environment + run: printenv | sort + + - name: Run tests + run: | + npm install + npx mocha test/unit test/integration/short --recursive --exit --reporter json --reporter-option output=test-results.json + + - name: Test Report + uses: dorny/test-reporter@v2 + if: ${{ !cancelled() }} # run this step even if previous step failed + with: + name: Mocha Tests # Name of the check run which will be created + path: test-results.json # Path to test results + reporter: mocha-json # Format of test results From 71e9605b9300194869f9a93b3340ea8c9639e0e4 Mon Sep 17 00:00:00 2001 From: janehe Date: Wed, 4 Feb 2026 14:53:07 -0800 Subject: [PATCH 02/16] no cache mvn --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 82aa124c..161052ce 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,13 +41,14 @@ jobs: with: distribution: zulu java-version: '8' - cache: maven + - name: Install Zulu 11 id: z11 uses: actions/setup-java@v5 with: distribution: zulu java-version: '11' + - name: Install Zulu 17 id: z17 uses: actions/setup-java@v5 From 4c598474b37d589df088a121b4380037843b3a35 Mon Sep 17 00:00:00 2001 From: janehe Date: Wed, 4 Feb 2026 14:57:14 -0800 Subject: [PATCH 03/16] install java 8 after 11 and 17 --- .github/workflows/test.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 161052ce..15538aa7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,20 +35,13 @@ jobs: ./setup.py install # ---- Install required Zulu JDKs (8/11/17) and capture their homes ---- - - name: Install Zulu 8 - id: z8 - uses: actions/setup-java@v5 - with: - distribution: zulu - java-version: '8' - - name: Install Zulu 11 id: z11 uses: actions/setup-java@v5 with: distribution: zulu java-version: '11' - + - name: Install Zulu 17 id: z17 uses: actions/setup-java@v5 @@ -56,6 +49,13 @@ jobs: distribution: zulu java-version: '17' + - name: Install Zulu 8 + id: z8 + uses: actions/setup-java@v5 + with: + distribution: zulu + java-version: '8' + - name: Export JAVA*_HOME variables run: | echo "JAVA8_HOME=${{ steps.z8.outputs.path }}" >> "$GITHUB_ENV" From 0eaf196ca909407469273fc8a6aa768b5d66f4b1 Mon Sep 17 00:00:00 2001 From: janehe Date: Wed, 4 Feb 2026 15:26:42 -0800 Subject: [PATCH 04/16] fix license header regrex --- test/unit/license-tests.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/test/unit/license-tests.js b/test/unit/license-tests.js index 79445b3e..968ebafc 100644 --- a/test/unit/license-tests.js +++ b/test/unit/license-tests.js @@ -20,25 +20,23 @@ const assert = require("assert"); const path = require("path"); const fs = require("fs"); -const licenseHeaderRegex = new RegExp( - `/\\* - \\* Licensed to the Apache Software Foundation (ASF) under one +const licenseHeaderRegex = new RegExp(`\\\/\\* + \\* Licensed to the Apache Software Foundation \\(ASF\\) under one \\* or more contributor license agreements\\. See the NOTICE file \\* distributed with this work for additional information \\* regarding copyright ownership\\. The ASF licenses this file - \\* to you under the Apache License, Version 2\\.0 (the - \\* "License"); you may not use this file except in compliance + \\* to you under the Apache License, Version 2\\.0 \\(the + \\* "License"\\); you may not use this file except in compliance \\* with the License\\. You may obtain a copy of the License at \\* - \\* http://www\\.apache\\.org/licenses/LICENSE-2\\.0 + \\* http:\\\/\\\/www\\.apache\\.org\\\/licenses\\\/LICENSE-2\\.0 \\* \\* Unless required by applicable law or agreed to in writing, software \\* distributed under the License is distributed on an "AS IS" BASIS, \\* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\\. \\* See the License for the specific language governing permissions and \\* limitations under the License\\. - \\*/` -); + \\*\\\/`); describe('All source files', function() { this.timeout(5000); From a78d2da7916d2b4d2bec224cd91c749e27cd8bbc Mon Sep 17 00:00:00 2001 From: janehe Date: Wed, 4 Feb 2026 15:54:33 -0800 Subject: [PATCH 05/16] install simulacron jar --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 15538aa7..30a142f5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -63,6 +63,10 @@ jobs: echo "JAVA17_HOME=${{ steps.z17.outputs.path }}" >> "$GITHUB_ENV" echo "JAVA_HOME=${{ steps.z8.outputs.path }}" >> "$GITHUB_ENV" + - name: Install Simulacron + run: | + wget https://github.com/datastax/simulacron/releases/download/0.12.0/simulacron-standalone-0.12.0.jar -O /home/runner/simulacron.jar + - name: Set up Node.js uses: actions/setup-node@v4 with: From 9d51855cf1b9bbcc5ce54dda94821afd81c1bfce Mon Sep 17 00:00:00 2001 From: janehe Date: Mon, 9 Feb 2026 22:28:12 -0800 Subject: [PATCH 06/16] generate ssl artifacts and fmt --- .github/workflows/test.yml | 77 ++++++++++++++++++++++++++++++-------- 1 file changed, 62 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 30a142f5..1911d279 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,7 @@ name: Unit and Integration Tests for Apache Cassandra NodeJS Driver on: push: pull_request: - workflow_dispatch: # allow manual trigger from Actions page + workflow_dispatch: # allow manual trigger from Actions page permissions: contents: read actions: read @@ -24,7 +24,7 @@ jobs: - name: Set up Python 3.9.16 uses: actions/setup-python@v5 with: - python-version: '3.9.16' + python-version: "3.9.16" - name: Install ccm run: | @@ -33,28 +33,28 @@ jobs: cd cassandra-ccm pip install -r requirements.txt ./setup.py install - + # ---- Install required Zulu JDKs (8/11/17) and capture their homes ---- - name: Install Zulu 11 id: z11 uses: actions/setup-java@v5 with: distribution: zulu - java-version: '11' + java-version: "11" - name: Install Zulu 17 id: z17 uses: actions/setup-java@v5 with: distribution: zulu - java-version: '17' + java-version: "17" - name: Install Zulu 8 id: z8 uses: actions/setup-java@v5 with: distribution: zulu - java-version: '8' + java-version: "8" - name: Export JAVA*_HOME variables run: | @@ -63,6 +63,53 @@ jobs: echo "JAVA17_HOME=${{ steps.z17.outputs.path }}" >> "$GITHUB_ENV" echo "JAVA_HOME=${{ steps.z8.outputs.path }}" >> "$GITHUB_ENV" + - name: Generate SSL certificates + run: | + mkdir -p /home/runner/workspace/tools/ccm/ssl/ + cd /home/runner/workspace/tools/ccm/ssl/ + keytool -genkey \ + -keyalg RSA \ + -alias cassandra \ + -keystore keystore.jks \ + -storepass cassandra \ + -keypass cassandra \ + -validity 364635 \ + -dname "CN=Philip Thompson, OU=TE, O=DataStax, L=Santa Clara, ST=CA, C=TE" + keytool -export \ + -alias cassandra \ + -file cassandra.crt \ + -keystore keystore.jks \ + -storepass cassandra + openssl x509 \ + -inform der \ + -in cassandra.crt \ + -out cassandra.pem + keytool -genkeypair \ + -keyalg RSA \ + -alias client \ + -keystore truststore.jks \ + -storepass cassandra \ + -keypass cassandra \ + -validity 364635 \ + -dname "CN=Philip Thompson, OU=TE, O=DataStax, L=Santa Clara, ST=CA, C=TE" + keytool -importkeystore \ + -srckeystore truststore.jks \ + -destkeystore client.p12 \ + -srcstorepass cassandra \ + -deststorepass cassandra \ + -deststoretype PKCS12 + openssl pkcs12 \ + -in client.p12 \ + -passin pass:cassandra \ + -nokeys \ + -out client_cert.pem -legacy + openssl pkcs12 \ + -in client.p12 \ + -passin pass:cassandra \ + -nodes \ + -nocerts \ + -out client_key.pem -legacy + - name: Install Simulacron run: | wget https://github.com/datastax/simulacron/releases/download/0.12.0/simulacron-standalone-0.12.0.jar -O /home/runner/simulacron.jar @@ -70,21 +117,21 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: '20' - cache: 'npm' - # ---- Print env vars before build ---- + node-version: "20" + cache: "npm" + - name: Print environment run: printenv | sort - name: Run tests run: | npm install - npx mocha test/unit test/integration/short --recursive --exit --reporter json --reporter-option output=test-results.json - + npx mocha test/unit test/integration/short --recursive --exit --reporter json --reporter-option output=test-results.json + - name: Test Report uses: dorny/test-reporter@v2 - if: ${{ !cancelled() }} # run this step even if previous step failed + if: ${{ !cancelled() }} with: - name: Mocha Tests # Name of the check run which will be created - path: test-results.json # Path to test results - reporter: mocha-json # Format of test results + name: Mocha Tests + path: test-results.json + reporter: mocha-json From b89c8aafa2a46b8d4d133da05d6db2ef99c70a94 Mon Sep 17 00:00:00 2001 From: janehe Date: Mon, 9 Feb 2026 23:10:29 -0800 Subject: [PATCH 07/16] add matrix --- .github/workflows/test.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1911d279..a0fe3d45 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,10 +12,11 @@ jobs: test: runs-on: ubuntu-latest strategy: + matrix: + NODE_VERSION: ["20", "22", "24"] # JDK used for TEST phase + SERVER_VERSION: ["3.11", "4.0", "4.1", "5.0"] # Cassandra minor versions fail-fast: false - env: - CCM_VERSION: 3.11.4 steps: - name: Checkout uses: actions/checkout@v4 @@ -117,9 +118,23 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: "20" + node-version: ${{ matrix.NODE_VERSION }} cache: "npm" + - name: Resolve Cassandra latest patch version + env: + SERVER_VERSION: ${{ matrix.SERVER_VERSION }} + run: | + PATCH_SERVER_VERSION=$( + curl -s https://downloads.apache.org/cassandra/ \ + | grep -oP '(?<=href=")[0-9]+\.[0-9]+\.[0-9]+(?=)' \ + | sort -rV \ + | uniq -w 3 \ + | grep "^${SERVER_VERSION}\." + ) + echo "Resolved Cassandra ${SERVER_VERSION}.x -> ${PATCH_SERVER_VERSION}" + echo "CCM_VERSION=$PATCH_SERVER_VERSION" >> "$GITHUB_ENV" + - name: Print environment run: printenv | sort From 2631b0ce7879f5b146b03d9c50b2d1f91e662959 Mon Sep 17 00:00:00 2001 From: janehe Date: Tue, 10 Feb 2026 15:28:30 -0800 Subject: [PATCH 08/16] upload and download test results for matrix --- .github/workflows/test.yml | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a0fe3d45..dc3db094 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,7 @@ name: Unit and Integration Tests for Apache Cassandra NodeJS Driver on: push: pull_request: - workflow_dispatch: # allow manual trigger from Actions page + workflow_dispatch: # allow manual trigger from Actions page permissions: contents: read actions: read @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - NODE_VERSION: ["20", "22", "24"] # JDK used for TEST phase + NODE_VERSION: ["20", "22", "24"] SERVER_VERSION: ["3.11", "4.0", "4.1", "5.0"] # Cassandra minor versions fail-fast: false @@ -143,10 +143,30 @@ jobs: npm install npx mocha test/unit test/integration/short --recursive --exit --reporter json --reporter-option output=test-results.json - - name: Test Report - uses: dorny/test-reporter@v2 - if: ${{ !cancelled() }} + - name: Upload Test Results + if: (!cancelled()) + uses: actions/upload-artifact@v4 with: - name: Mocha Tests + name: Test Results (Node.js ${{ matrix.NODE_VERSION }}, Cassandra ${{ matrix.SERVER_VERSION }}) path: test-results.json - reporter: mocha-json + + publish-test-results: + name: "Publish Tests Results" + needs: test + runs-on: ubuntu-latest + permissions: + checks: write + pull-requests: write + + if: (!cancelled()) + + steps: + - name: Download Artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + with: + files: "artifacts/**/*.json" From 033ba9e27c95ead722174f59b15972228c64ecfd Mon Sep 17 00:00:00 2001 From: janehe Date: Tue, 10 Feb 2026 16:47:12 -0800 Subject: [PATCH 09/16] git reset --hard 5aba922ac24354cbafbdb6ad7244cabfaf7685f1 --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dc3db094..03cacde1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,6 +32,7 @@ jobs: python -m pip install --upgrade pip git clone --depth 1 --single-branch -b cassandra-test https://github.com/apache/cassandra-ccm.git cd cassandra-ccm + git reset --hard 5aba922ac24354cbafbdb6ad7244cabfaf7685f1 pip install -r requirements.txt ./setup.py install From a596250fbae34276944988cbd722a8ab476f3977 Mon Sep 17 00:00:00 2001 From: janehe Date: Thu, 12 Feb 2026 14:32:24 -0800 Subject: [PATCH 10/16] SELECT tokens --- test/integration/short/metadata-tests.js | 36 ++++++++++++++++-------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/test/integration/short/metadata-tests.js b/test/integration/short/metadata-tests.js index eb86a757..4ef8323a 100644 --- a/test/integration/short/metadata-tests.js +++ b/test/integration/short/metadata-tests.js @@ -184,14 +184,20 @@ describe('metadata @SERVER_API', function () { }); }); describe('#getTokenRanges()', function () { - it('should return 512 ranges', function (done) { - // as vnodes are enabled and there are 2 nodes, expect 512 (2* 256) ranges. + it('should return the correct number of ranges', function (done) { const client = newInstance(); utils.series([ client.connect.bind(client), - function getRanges(next) { + async function getRanges(next) { + // Query system tables to get actual tokens + const localRs = await client.execute('SELECT tokens FROM system.local'); + let tokenCount = localRs.rows[0].tokens.length; + const peersRs = await client.execute('SELECT tokens FROM system.peers'); + peersRs.rows.forEach(row => { + if (row.tokens) tokenCount += row.tokens.length; + }); const ranges = client.metadata.getTokenRanges(); - assert.strictEqual(ranges.size, 512); + assert.strictEqual(ranges.size, tokenCount); next(); }, client.shutdown.bind(client) @@ -206,18 +212,24 @@ describe('metadata @SERVER_API', function () { helper.toTask(client.execute, client, "CREATE KEYSPACE ksrf1 WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 1}"), helper.toTask(client.execute, client, "CREATE KEYSPACE ksrf2 WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 2}"), helper.toTask(client.execute, client, "CREATE KEYSPACE ksntsrf2 WITH replication = {'class': 'NetworkTopologyStrategy', 'dc1' : 2}"), - function getRanges(next) { + async function getRanges(next) { + // Query system tables to get actual tokens + const localRs = await client.execute('SELECT tokens FROM system.local'); + let tokenCount = localRs.rows[0].tokens.length; + const peersRs = await client.execute('SELECT tokens FROM system.peers'); + peersRs.rows.forEach(row => { + if (row.tokens) tokenCount += row.tokens.length; + }); const host1 = helper.findHost(client, 1); const host2 = helper.findHost(client, 2); // the sum of ranges between host1 and host2 should be the total number of tokens. - // we can't make an exact assertion here because token assignment is not exact. const rf1Ranges = client.metadata.getTokenRangesForHost('ksrf1', host1).size + client.metadata.getTokenRangesForHost('ksrf1', host2).size; - assert.strictEqual(rf1Ranges, 512); - // expect 512 ranges for each host (2 replica = 512 tokens) - assert.strictEqual(client.metadata.getTokenRangesForHost('ksrf2', host1).size, 512); - assert.strictEqual(client.metadata.getTokenRangesForHost('ksrf2', host2).size, 512); - assert.strictEqual(client.metadata.getTokenRangesForHost('ksntsrf2', host1).size, 512); - assert.strictEqual(client.metadata.getTokenRangesForHost('ksntsrf2', host2).size, 512); + assert.strictEqual(rf1Ranges, tokenCount); + // expect tokenCount ranges for each host (2 replica = tokenCount tokens) + assert.strictEqual(client.metadata.getTokenRangesForHost('ksrf2', host1).size, tokenCount); + assert.strictEqual(client.metadata.getTokenRangesForHost('ksrf2', host2).size, tokenCount); + assert.strictEqual(client.metadata.getTokenRangesForHost('ksntsrf2', host1).size, tokenCount); + assert.strictEqual(client.metadata.getTokenRangesForHost('ksntsrf2', host2).size, tokenCount); next(); }, client.shutdown.bind(client) From c2d7458b6962aa96589a305698cfb8900caee430 Mon Sep 17 00:00:00 2001 From: janehe Date: Mon, 16 Feb 2026 16:05:25 -0800 Subject: [PATCH 11/16] revert ccm reset --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 03cacde1..dc3db094 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,7 +32,6 @@ jobs: python -m pip install --upgrade pip git clone --depth 1 --single-branch -b cassandra-test https://github.com/apache/cassandra-ccm.git cd cassandra-ccm - git reset --hard 5aba922ac24354cbafbdb6ad7244cabfaf7685f1 pip install -r requirements.txt ./setup.py install From cc4432700a105693cc8c997cc3543265cb64e525 Mon Sep 17 00:00:00 2001 From: janehe Date: Mon, 16 Feb 2026 19:30:01 -0800 Subject: [PATCH 12/16] try dorny GA instead --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dc3db094..2f8784ae 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -167,6 +167,8 @@ jobs: path: artifacts - name: Publish Test Results - uses: EnricoMi/publish-unit-test-result-action@v2 + uses: dorny/test-reporter@v2 with: - files: "artifacts/**/*.json" + name: Node.js Driver Tests + path: "artifacts/**/*.json" + reporter: mocha-json From 7961c0fbd11eb2d95ceb41dfc1c88830209a08d7 Mon Sep 17 00:00:00 2001 From: janehe Date: Mon, 16 Feb 2026 20:45:39 -0800 Subject: [PATCH 13/16] artifact? --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2f8784ae..a1a0b1ca 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -170,5 +170,5 @@ jobs: uses: dorny/test-reporter@v2 with: name: Node.js Driver Tests - path: "artifacts/**/*.json" + artifact: artifacts/**/*.json reporter: mocha-json From 23688f38adbd24acab2c970b37d88ed1d3012fe5 Mon Sep 17 00:00:00 2001 From: janehe Date: Mon, 16 Feb 2026 21:19:19 -0800 Subject: [PATCH 14/16] enrico, xunit --- .github/workflows/test.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a1a0b1ca..aac71bd2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -141,14 +141,14 @@ jobs: - name: Run tests run: | npm install - npx mocha test/unit test/integration/short --recursive --exit --reporter json --reporter-option output=test-results.json + npx mocha test/unit test/integration/short --recursive --exit --reporter xunit --reporter-options output=test-results/results.xml - name: Upload Test Results if: (!cancelled()) uses: actions/upload-artifact@v4 with: name: Test Results (Node.js ${{ matrix.NODE_VERSION }}, Cassandra ${{ matrix.SERVER_VERSION }}) - path: test-results.json + path: test-results/results.xml publish-test-results: name: "Publish Tests Results" @@ -167,8 +167,6 @@ jobs: path: artifacts - name: Publish Test Results - uses: dorny/test-reporter@v2 + uses: EnricoMi/publish-unit-test-result-action@v2 with: - name: Node.js Driver Tests - artifact: artifacts/**/*.json - reporter: mocha-json + files: artifacts/**/*.xml From 6052c00f79a14a36247cd53abc94b35dd2cdccd4 Mon Sep 17 00:00:00 2001 From: janehe Date: Mon, 16 Feb 2026 21:24:46 -0800 Subject: [PATCH 15/16] multi reporter --- .github/workflows/test.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aac71bd2..cdc9ff82 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -141,14 +141,22 @@ jobs: - name: Run tests run: | npm install - npx mocha test/unit test/integration/short --recursive --exit --reporter xunit --reporter-options output=test-results/results.xml + npm install --no-save mocha-multi-reporters mocha-junit-reporter mochawesome + npx mocha test/unit test/integration/short --recursive --exit --reporter mocha-multi-reporters \ + --reporter-options \ + reporterEnabled=spec,mocha-junit-reporter,mochawesome,\ + mochaJunitReporterReporterOptions.mochaFile=test-results/results.xml,\ + mochawesomeReporterOptions.reportDir=test-results/html,\ + mochawesomeReporterOptions.overwrite=false - name: Upload Test Results if: (!cancelled()) uses: actions/upload-artifact@v4 with: name: Test Results (Node.js ${{ matrix.NODE_VERSION }}, Cassandra ${{ matrix.SERVER_VERSION }}) - path: test-results/results.xml + path: | + test-results/results.xml + test-results/html publish-test-results: name: "Publish Tests Results" From 292025a9fad39c7886b9d8c69757ce2e973fb84f Mon Sep 17 00:00:00 2001 From: janehe Date: Tue, 17 Feb 2026 00:02:45 -0800 Subject: [PATCH 16/16] multi reporter --- .github/workflows/test.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cdc9ff82..bf678374 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -141,22 +141,23 @@ jobs: - name: Run tests run: | npm install - npm install --no-save mocha-multi-reporters mocha-junit-reporter mochawesome + npm install --no-save mocha-multi-reporters mocha-junit-reporter + echo '{ + "reporterEnabled": "spec, mocha-junit-reporter", + "mochaJunitReporterReporterOptions": { + "mochaFile": "test-results/results.xml" + } + }' > config.json + npx mocha test/unit test/integration/short --recursive --exit --reporter mocha-multi-reporters \ - --reporter-options \ - reporterEnabled=spec,mocha-junit-reporter,mochawesome,\ - mochaJunitReporterReporterOptions.mochaFile=test-results/results.xml,\ - mochawesomeReporterOptions.reportDir=test-results/html,\ - mochawesomeReporterOptions.overwrite=false + --reporter-options configFile=config.json - name: Upload Test Results if: (!cancelled()) uses: actions/upload-artifact@v4 with: name: Test Results (Node.js ${{ matrix.NODE_VERSION }}, Cassandra ${{ matrix.SERVER_VERSION }}) - path: | - test-results/results.xml - test-results/html + path: test-results/**/* publish-test-results: name: "Publish Tests Results"