From 3955121a63ba7fca0f883edb6be385aa5545ae30 Mon Sep 17 00:00:00 2001 From: yankos Date: Wed, 8 Jan 2025 20:30:20 +0200 Subject: [PATCH 01/17] feat: add debug info like in the longpoll transport. --- packages/autobahn/lib/transport/rawsocket.js | 2 ++ packages/autobahn/lib/transport/websocket.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/autobahn/lib/transport/rawsocket.js b/packages/autobahn/lib/transport/rawsocket.js index 4f6256b30..08b5e2c78 100644 --- a/packages/autobahn/lib/transport/rawsocket.js +++ b/packages/autobahn/lib/transport/rawsocket.js @@ -41,6 +41,8 @@ Factory.prototype.create = function () { var self = this; + log.debug("rawsocket.Factory.create"); + // the WAMP transport we create var transport = {}; diff --git a/packages/autobahn/lib/transport/websocket.js b/packages/autobahn/lib/transport/websocket.js index 7dc7cbd0f..a6a08b6fb 100644 --- a/packages/autobahn/lib/transport/websocket.js +++ b/packages/autobahn/lib/transport/websocket.js @@ -71,6 +71,8 @@ Factory.prototype.create = function () { var self = this; + log.debug("websocket.Factory.create"); + // the WAMP transport we create var transport = {}; From 4bbf681837929bd46b1662cd4cd7abb724c10862 Mon Sep 17 00:00:00 2001 From: yankos Date: Wed, 8 Jan 2025 20:37:52 +0200 Subject: [PATCH 02/17] feat: removed the trash. --- packages/autobahn/lib/log.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/autobahn/lib/log.js b/packages/autobahn/lib/log.js index b48ccbbbf..6650cf5bd 100644 --- a/packages/autobahn/lib/log.js +++ b/packages/autobahn/lib/log.js @@ -28,8 +28,6 @@ if ('console' in global) { } } -console.log('Sdfsdf'); - // write debug messages to tracefile if AUTOBAHN_TRACE is set as environment variable - only works on NodeJS if ('process' in global && process.env.AUTOBAHN_TRACE) { debug = function () { From f7318718bead1c3dcaa2edd8fa70408a748f63e2 Mon Sep 17 00:00:00 2001 From: yankos Date: Wed, 8 Jan 2025 20:39:31 +0200 Subject: [PATCH 03/17] feat: The ID of the serializer should be a string. --- packages/autobahn/lib/transport/websocket.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/autobahn/lib/transport/websocket.js b/packages/autobahn/lib/transport/websocket.js index a6a08b6fb..73f1748db 100644 --- a/packages/autobahn/lib/transport/websocket.js +++ b/packages/autobahn/lib/transport/websocket.js @@ -35,6 +35,7 @@ function Factory (options) { if (!options.protocols) { options.protocols = []; options.serializers.forEach(function (ser) { + util.assert(typeof ser.SERIALIZER_ID === "string", "options.serializers[].SERIALIZER_ID must be a string"); options.protocols.push("wamp.2." + ser.SERIALIZER_ID); }); } else { From 9bb784b60e46209fa4b7b80ad7185105c948ba11 Mon Sep 17 00:00:00 2001 From: yankos Date: Wed, 8 Jan 2025 20:48:20 +0200 Subject: [PATCH 04/17] test: failed test - order of arguments is incorect. --- packages/autobahn/test/test_binary.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/autobahn/test/test_binary.js b/packages/autobahn/test/test_binary.js index 8deace9ec..9b9f9efbd 100644 --- a/packages/autobahn/test/test_binary.js +++ b/packages/autobahn/test/test_binary.js @@ -192,7 +192,7 @@ exports.testBinaryJSON = function (testcase) { var dl = []; - dl.push(run_test(testcase, test, new autobahn.serializer.JSONSerializer())); + dl.push(run_test(test, new autobahn.serializer.JSONSerializer())); autobahn.when.all(dl).then(function () { var chk = test.check(); From bf42c342f46424ac56b8911a4de824a3cae501dd Mon Sep 17 00:00:00 2001 From: yankos Date: Wed, 8 Jan 2025 20:52:02 +0200 Subject: [PATCH 05/17] test: added an example of using Docker for testing. --- packages/autobahn/test/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/autobahn/test/README.md b/packages/autobahn/test/README.md index 733d3d01e..b3c579a44 100644 --- a/packages/autobahn/test/README.md +++ b/packages/autobahn/test/README.md @@ -4,7 +4,12 @@ Tests run using NodeJS and the nodeunit package. First, ensure that a Crossbar.io instance is running with the default configuration (use `crossbar init` if needed). This will run a WAMP-over-WebSocket transport at `ws://localhost:8080/ws`. -> You should be able to use any compliant WAMP router (on `ws://localhost:8080/ws`) - your mileage may vary though. +> You should be able to use any compliant WAMP router (on `ws://localhost:8080/ws`) - your mileage may vary though. + +The easiest way is to use Docker (in the root directory of the repository): +```console +docker run -it -v $PWD/.crossbar:/node -p 8080:8080 -p 8090:8090 -u $UID crossbario/crossbar --cbdir /node +``` Then, open a terminal and run `npm test` in the `package` directory. From 1684185187643506e7a91522162d0956b95216d4 Mon Sep 17 00:00:00 2001 From: yankos Date: Sun, 12 Jan 2025 13:06:38 +0200 Subject: [PATCH 06/17] test: the test gets stuck if an error occurs. --- packages/autobahn/test/test_binary.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/autobahn/test/test_binary.js b/packages/autobahn/test/test_binary.js index 9b9f9efbd..292bbf9f5 100644 --- a/packages/autobahn/test/test_binary.js +++ b/packages/autobahn/test/test_binary.js @@ -144,7 +144,11 @@ function run_test (test, ser) { function () { test.log("Registration failed!", arguments); } - ); + ) + .catch(function (error) { + connection.close(); + done.reject(error); + }); }; connection.open(); From 6c08e5118cbbb9e2a6a5ae9c5272a6e4ed0e7fae Mon Sep 17 00:00:00 2001 From: yankos Date: Sun, 12 Jan 2025 17:28:43 +0200 Subject: [PATCH 07/17] test: remove test cases for non cross-language types: BigInt, Buffer, UIntArray. --- packages/autobahn/test/test.js | 4 +-- packages/autobahn/test/test_binary.js | 8 ----- packages/autobahn/test/test_binary_cbor.txt | 36 ++++++------------- packages/autobahn/test/test_binary_json.txt | 22 ++++++++++++ .../autobahn/test/test_binary_msgpack.txt | 22 ++++++++++++ 5 files changed, 56 insertions(+), 36 deletions(-) create mode 100644 packages/autobahn/test/test_binary_json.txt create mode 100644 packages/autobahn/test/test_binary_msgpack.txt diff --git a/packages/autobahn/test/test.js b/packages/autobahn/test/test.js index 964f21375..b51364823 100644 --- a/packages/autobahn/test/test.js +++ b/packages/autobahn/test/test.js @@ -63,8 +63,8 @@ exports.testCBORSerialization = serialization_cbor.testCBORSerialization; exports.testCBORLargePayload = serialization_cbor.testCBORLargePayload; exports.testBinaryCBOR = binary.testBinaryCBOR; -// exports.testBinaryMsgPack = binary.testBinaryMsgPack; -// exports.testBinaryJSON = binary.testBinaryJSON; +exports.testBinaryMsgPack = binary.testBinaryMsgPack; +exports.testBinaryJSON = binary.testBinaryJSON; exports.testRawSocketTransport = rawsocket_transport.testRawSocketTransport; diff --git a/packages/autobahn/test/test_binary.js b/packages/autobahn/test/test_binary.js index 292bbf9f5..3346bbda0 100644 --- a/packages/autobahn/test/test_binary.js +++ b/packages/autobahn/test/test_binary.js @@ -71,14 +71,6 @@ function run_test (test, ser) { {a: 5, b: "hello2", c: [1, 2, 3]}, [-9007199254740991, 9007199254740991], null, - // UTC of today - BigInt('1558266424841951553'), - // 2**255-1 : NotImplementedError TODO: TAG BIGNUM for bigger bignum bytes_info=24, len(ull)=8 - // BigInt('57896044618658097711785492504343953926634992332820282019728792003956564819967'), - BigInt('340282366920938463463374607431768211455'), - Uint8Array.from([0, 1, 2, 3, 4, 5, 6, 7]), - randomBytes(32), - {a: 5, b: "hello2", c: randomBytes(32)} ]; for (var i = 0; i < vals1.length; ++i) { diff --git a/packages/autobahn/test/test_binary_cbor.txt b/packages/autobahn/test/test_binary_cbor.txt index d7a1a9920..443dc9b0c 100644 --- a/packages/autobahn/test/test_binary_cbor.txt +++ b/packages/autobahn/test/test_binary_cbor.txt @@ -10,29 +10,13 @@ 9 " c, 1,2,3" 10 "Result [com.myapp.echo]: -9007199254740991,9007199254740991" 11 "Result [com.myapp.echo]: null" -12 "Result [com.myapp.echo]: 1558266424841951553" -13 "Result [com.myapp.echo]: 340282366920938463463374607431768211455" -14 "Result [com.myapp.echo]: 0,1,2,3,4,5,6,7" -15 "Result [com.myapp.echo]: 8f44d509e0492acec4fc109a030a5c751f063fb743cc388f0ed722bacc3bc66c" -16 "Result [com.myapp.echo]:" -17 " a, 5" -18 " b, hello2" -19 " c, 035e7711c8da2e9434aab5039dc3d72046dee4e57af0e957e948fbbad15e48f8" -20 "Result [any.echo]: 1.7" -21 "Result [any.echo]: hello" -22 "Result [any.echo]: 1,2,-3" -23 "Result [any.echo]:" -24 " a, 5" -25 " b, hello2" -26 " c, 1,2,3" -27 "Result [any.echo]: -9007199254740991,9007199254740991" -28 "Result [any.echo]: null" -29 "Result [any.echo]: 1558266424841951553" -30 "Result [any.echo]: 340282366920938463463374607431768211455" -31 "Result [any.echo]: 0,1,2,3,4,5,6,7" -32 "Result [any.echo]: 8f44d509e0492acec4fc109a030a5c751f063fb743cc388f0ed722bacc3bc66c" -33 "Result [any.echo]:" -34 " a, 5" -35 " b, hello2" -36 " c, 035e7711c8da2e9434aab5039dc3d72046dee4e57af0e957e948fbbad15e48f8" -37 "All finished." +12 "Result [any.echo]: 1.7" +13 "Result [any.echo]: hello" +14 "Result [any.echo]: 1,2,-3" +15 "Result [any.echo]:" +16 " a, 5" +17 " b, hello2" +18 " c, 1,2,3" +19 "Result [any.echo]: -9007199254740991,9007199254740991" +20 "Result [any.echo]: null" +21 "All finished." diff --git a/packages/autobahn/test/test_binary_json.txt b/packages/autobahn/test/test_binary_json.txt new file mode 100644 index 000000000..7fb80b301 --- /dev/null +++ b/packages/autobahn/test/test_binary_json.txt @@ -0,0 +1,22 @@ +0 "Connected: wamp.2.json" +1 "All registered." +2 "Serializer ID: json" +3 "Result [com.myapp.echo]: 1.7" +4 "Result [com.myapp.echo]: hello" +5 "Result [com.myapp.echo]: 1,2,-3" +6 "Result [com.myapp.echo]:" +7 " a, 5" +8 " b, hello2" +9 " c, 1,2,3" +10 "Result [com.myapp.echo]: -9007199254740991,9007199254740991" +11 "Result [com.myapp.echo]: null" +12 "Result [any.echo]: 1.7" +13 "Result [any.echo]: hello" +14 "Result [any.echo]: 1,2,-3" +15 "Result [any.echo]:" +16 " a, 5" +17 " b, hello2" +18 " c, 1,2,3" +19 "Result [any.echo]: -9007199254740991,9007199254740991" +20 "Result [any.echo]: null" +21 "All finished." diff --git a/packages/autobahn/test/test_binary_msgpack.txt b/packages/autobahn/test/test_binary_msgpack.txt new file mode 100644 index 000000000..e4a4663c6 --- /dev/null +++ b/packages/autobahn/test/test_binary_msgpack.txt @@ -0,0 +1,22 @@ +0 "Connected: wamp.2.msgpack" +1 "All registered." +2 "Serializer ID: msgpack" +3 "Result [com.myapp.echo]: 1.7" +4 "Result [com.myapp.echo]: hello" +5 "Result [com.myapp.echo]: 1,2,-3" +6 "Result [com.myapp.echo]:" +7 " a, 5" +8 " b, hello2" +9 " c, 1,2,3" +10 "Result [com.myapp.echo]: -9007199254740991,9007199254740991" +11 "Result [com.myapp.echo]: null" +12 "Result [any.echo]: 1.7" +13 "Result [any.echo]: hello" +14 "Result [any.echo]: 1,2,-3" +15 "Result [any.echo]:" +16 " a, 5" +17 " b, hello2" +18 " c, 1,2,3" +19 "Result [any.echo]: -9007199254740991,9007199254740991" +20 "Result [any.echo]: null" +21 "All finished." From 7eb9603544a0351ba027cda3e0a6c30ba1a745a1 Mon Sep 17 00:00:00 2001 From: yankos Date: Sun, 12 Jan 2025 17:30:21 +0200 Subject: [PATCH 08/17] test: use a default router. --- packages/autobahn/test/test_binary.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/autobahn/test/test_binary.js b/packages/autobahn/test/test_binary.js index 3346bbda0..05e5a4f68 100644 --- a/packages/autobahn/test/test_binary.js +++ b/packages/autobahn/test/test_binary.js @@ -32,8 +32,7 @@ function run_test (test, ser) { var done = autobahn.when.defer(); var config = { - //url: testutil.config.url, - url: "ws://127.0.0.1:8090", + url: testutil.config.url, realm: testutil.config.realm, serializers: [ser] }; From 852c73065b43dc31c2c703e485095f63f3f58b51 Mon Sep 17 00:00:00 2001 From: yankos Date: Tue, 14 Jan 2025 20:22:38 +0200 Subject: [PATCH 09/17] test: improve github action --- .crossbar/key.priv | 11 ----------- .crossbar/key.pub | 9 --------- .github/workflows/main.yml | 24 ++++++++++++------------ 3 files changed, 12 insertions(+), 32 deletions(-) delete mode 100644 .crossbar/key.priv delete mode 100644 .crossbar/key.pub diff --git a/.crossbar/key.priv b/.crossbar/key.priv deleted file mode 100644 index 074572828..000000000 --- a/.crossbar/key.priv +++ /dev/null @@ -1,11 +0,0 @@ -Crossbar.io node private key - KEEP THIS SAFE! - -creator: oberstet@intel-nuci7 -created-at: 2023-01-16T10:13:47.153Z -machine-id: 816b4b901e774fc1ad59cbf2719806b7 -node-authid: intel-nuci7 -node-cluster-ip: 127.0.0.1 -public-key-ed25519: 04ffa62e526aa0ff648cd61be4cc9d92f80e973485473647f76e96bef0d84dfe -public-adr-eth: 0x62E7Af2CF452e820051210D237723E5914fB53F4 -private-key-ed25519: 39e3c34e472b6b5e6b93f73690584471f5c717b7320ea393d90d4f15a9747338 -private-key-eth: 3dcf36bafeb82d1b3927389847c68f1920c33c5f3607fffb4b2561da24351849 diff --git a/.crossbar/key.pub b/.crossbar/key.pub deleted file mode 100644 index 20adf7673..000000000 --- a/.crossbar/key.pub +++ /dev/null @@ -1,9 +0,0 @@ -Crossbar.io node public key - -creator: oberstet@intel-nuci7 -created-at: 2023-01-16T10:13:47.153Z -machine-id: 816b4b901e774fc1ad59cbf2719806b7 -node-authid: intel-nuci7 -node-cluster-ip: 127.0.0.1 -public-key-ed25519: 04ffa62e526aa0ff648cd61be4cc9d92f80e973485473647f76e96bef0d84dfe -public-adr-eth: 0x62E7Af2CF452e820051210D237723E5914fB53F4 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cb9b6512c..66ba5f9e3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,10 +3,10 @@ name: Autobahn JS CI on: push: branches: - - master + - $default-branch pull_request: branches: - - master + - $default-branch jobs: unittest: @@ -16,13 +16,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - # https://de.wikipedia.org/wiki/Node.js#Versionen - node: ['14', '18', '19'] + node: [lts/-2, lts/-1, lts/*] name: Node ${{ matrix.node }} run steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} @@ -32,13 +31,14 @@ jobs: docker run --rm --entrypoint=/usr/local/bin/crossbar $CB_IMAGE version docker run -d -v $PWD/.crossbar:/node -p 8080:8080 -p 8090:8090 -u $UID --entrypoint=/usr/local/bin/crossbar $CB_IMAGE start --cbdir /node - - name: Install dependencies - run: | - sudo apt update - sudo npm install -g nodeunit - sudo pip3 install --no-cache-dir -U scons boto taschenmesser + # - name: Install dependencies + # run: | + # sudo apt update + # sudo npm install -g nodeunit + # sudo pip3 install --no-cache-dir -U scons boto taschenmesser - name: Run tests run: | - cd packages/autobahn && npm install + cd packages/autobahn + npm install make test From 0fcff5a43855acac76e1ad34b087d55559e70538 Mon Sep 17 00:00:00 2001 From: yankos Date: Tue, 14 Jan 2025 20:50:45 +0200 Subject: [PATCH 10/17] test: improve github action --- .github/workflows/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 66ba5f9e3..3c5eb6f95 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,7 @@ -name: Autobahn JS CI +name: Autobahn JS CI v2 on: + workflow_dispatch: push: branches: - $default-branch @@ -41,4 +42,4 @@ jobs: run: | cd packages/autobahn npm install - make test + npm run `test From e5347928ca17943f5ed61d6bd7f9f65c46f2e9f1 Mon Sep 17 00:00:00 2001 From: yankos Date: Tue, 14 Jan 2025 21:00:35 +0200 Subject: [PATCH 11/17] test: minor changes of github action --- .github/workflows/main.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3c5eb6f95..c1b450130 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [lts/-2, lts/-1, lts/*] + node: [lts/*] name: Node ${{ matrix.node }} run steps: @@ -32,14 +32,11 @@ jobs: docker run --rm --entrypoint=/usr/local/bin/crossbar $CB_IMAGE version docker run -d -v $PWD/.crossbar:/node -p 8080:8080 -p 8090:8090 -u $UID --entrypoint=/usr/local/bin/crossbar $CB_IMAGE start --cbdir /node - # - name: Install dependencies - # run: | - # sudo apt update - # sudo npm install -g nodeunit - # sudo pip3 install --no-cache-dir -U scons boto taschenmesser - - - name: Run tests + - name: Install dependencies run: | cd packages/autobahn npm install - npm run `test + + - name: Run tests + run: | + npm run test From 0118241ab4a1586ab9bd5b26df9a97ce48384f04 Mon Sep 17 00:00:00 2001 From: yankos Date: Tue, 14 Jan 2025 21:08:33 +0200 Subject: [PATCH 12/17] test: use the correct folder to run tests --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c1b450130..43a6c1750 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,4 +39,5 @@ jobs: - name: Run tests run: | + cd packages/autobahn npm run test From e15061f746a171a16b27b818ddb21eeecd2006d1 Mon Sep 17 00:00:00 2001 From: yankos Date: Wed, 15 Jan 2025 22:17:20 +0200 Subject: [PATCH 13/17] test: add a code coverage report. --- .github/workflows/main.yml | 11 +++++++++++ .gitignore | 1 + packages/autobahn/.c8rc.json | 13 +++++++++++++ packages/autobahn/package.json | 3 ++- 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 packages/autobahn/.c8rc.json diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 43a6c1750..ae958f2a4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,6 +13,7 @@ jobs: unittest: env: CB_IMAGE: crossbario/crossbar:cpy-slim-amd64-22.7.1.dev1 + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} runs-on: ubuntu-latest strategy: @@ -41,3 +42,13 @@ jobs: run: | cd packages/autobahn npm run test + + - name: Upload coverage reports to Codecov via GitHub Actions + if: env.CODECOV_TOKEN != '' + uses: codecov/codecov-action@v5 + with: + directory: packages/autobahn/coverage + + - name: Skip uploading coverage reports to Codecov via GitHub Actions + if: env.CODECOV_TOKEN == '' + run: echo "Upload skipped. CODECOV_TOKEN is not defined. Add it as a secret in your repository settings." \ No newline at end of file diff --git a/.gitignore b/.gitignore index b2c793621..5b1fcf71b 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ package/.crossbar/ package-lock.json packages/autobahn-xbr/lib/contracts/ packages/autobahn-xbr/contracts/ +packages/autobahn/coverage/ \ No newline at end of file diff --git a/packages/autobahn/.c8rc.json b/packages/autobahn/.c8rc.json new file mode 100644 index 000000000..9cb19d107 --- /dev/null +++ b/packages/autobahn/.c8rc.json @@ -0,0 +1,13 @@ +{ + "all": true, + "sourceMap": false, + "include": [ + "lib/**/*.js" + ], + "report-dir": "./coverage", + "temp-dir": "./coverage", + "reporter": [ + "lcov", + "text-summary" + ] +} \ No newline at end of file diff --git a/packages/autobahn/package.json b/packages/autobahn/package.json index 3028ee590..7211907a5 100644 --- a/packages/autobahn/package.json +++ b/packages/autobahn/package.json @@ -8,7 +8,7 @@ "/lib" ], "scripts": { - "test": "nodeunit test/test.js" + "test": "c8 nodeunit test/test.js" }, "engines": { "node": ">= 7.10.1" @@ -27,6 +27,7 @@ }, "devDependencies": { "browserify": ">= 13.1.1", + "c8": "^8.0.1", "deep-equal": ">= 1.0.1", "google-closure-compiler": ">= 20170218.0.0", "nodeunit": ">= 0.11.3", From 26c0bbee3d37ec2ee7281ae124843d28a4a24fa5 Mon Sep 17 00:00:00 2001 From: yankos Date: Thu, 22 May 2025 20:57:51 +0300 Subject: [PATCH 14/17] test: enable last 3 lts versions. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ae958f2a4..902db931f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [lts/*] + node: [lts/-2, lts/-1, lts/*] name: Node ${{ matrix.node }} run steps: From 3ca99d7793128131f2215fd6e5f38cff153d5d22 Mon Sep 17 00:00:00 2001 From: yankos Date: Thu, 22 May 2025 21:03:14 +0300 Subject: [PATCH 15/17] test: different code coverages for different nodejs versions. --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 902db931f..96458f2f5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,6 +47,7 @@ jobs: if: env.CODECOV_TOKEN != '' uses: codecov/codecov-action@v5 with: + flags: ${{ matrix.node }} directory: packages/autobahn/coverage - name: Skip uploading coverage reports to Codecov via GitHub Actions From 19012d15964ac509b031b2f051a7621df131a42a Mon Sep 17 00:00:00 2001 From: yankos Date: Thu, 22 May 2025 21:13:52 +0300 Subject: [PATCH 16/17] test: revert the action name --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 96458f2f5..de32aa961 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Autobahn JS CI v2 +name: Autobahn JS CI on: workflow_dispatch: From 0a484591e48221a95ff39c21d390df78f575af65 Mon Sep 17 00:00:00 2001 From: yankos Date: Fri, 23 May 2025 08:13:05 +0300 Subject: [PATCH 17/17] test: make code cov report optional, remove it from actions. --- .github/workflows/main.yml | 12 ------------ packages/autobahn/package.json | 5 +++-- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index de32aa961..5baba4448 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,6 @@ jobs: unittest: env: CB_IMAGE: crossbario/crossbar:cpy-slim-amd64-22.7.1.dev1 - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} runs-on: ubuntu-latest strategy: @@ -42,14 +41,3 @@ jobs: run: | cd packages/autobahn npm run test - - - name: Upload coverage reports to Codecov via GitHub Actions - if: env.CODECOV_TOKEN != '' - uses: codecov/codecov-action@v5 - with: - flags: ${{ matrix.node }} - directory: packages/autobahn/coverage - - - name: Skip uploading coverage reports to Codecov via GitHub Actions - if: env.CODECOV_TOKEN == '' - run: echo "Upload skipped. CODECOV_TOKEN is not defined. Add it as a secret in your repository settings." \ No newline at end of file diff --git a/packages/autobahn/package.json b/packages/autobahn/package.json index 7211907a5..ec60f7724 100644 --- a/packages/autobahn/package.json +++ b/packages/autobahn/package.json @@ -8,7 +8,8 @@ "/lib" ], "scripts": { - "test": "c8 nodeunit test/test.js" + "test": "nodeunit test/test.js", + "test:coverage": "c8 nodeunit test/test.js" }, "engines": { "node": ">= 7.10.1" @@ -22,12 +23,12 @@ }, "optionalDependencies": { "bufferutil": ">= 1.2.1", + "c8": "^8.0.1", "utf-8-validate": ">= 1.2.1", "when": ">= 3.7.7" }, "devDependencies": { "browserify": ">= 13.1.1", - "c8": "^8.0.1", "deep-equal": ">= 1.0.1", "google-closure-compiler": ">= 20170218.0.0", "nodeunit": ">= 0.11.3",