Skip to content

Commit

Permalink
ci: add Node.js 18 in the test matrix
Browse files Browse the repository at this point in the history
A few notes:

- the certificates were recreated because Node.js 18 includes OpenSSL
v3, which has deprecated support for some legacy ciphers (like RC2)

- eiows currently fails to build on Node.js 18, so the tests are
temporarily skipped

See also: https://github.com/nodejs/Release
  • Loading branch information
darrachequesne committed Nov 19, 2022
1 parent 1b71a6f commit 535a01d
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 80 deletions.
28 changes: 21 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,35 @@ on:
schedule:
- cron: '0 0 * * 0'

permissions:
contents: read

jobs:
test-node:
runs-on: ubuntu-latest
timeout-minutes: 10

strategy:
matrix:
node-version: [14, 16]
node-version:
- 10
- 18

steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
env:
CI: true

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test

- name: Run tests with µWebSockets.js
run: npm run test:uws
if: ${{ matrix.node-version == '18' }}
26 changes: 13 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"devDependencies": {
"babel-eslint": "^8.0.2",
"eiows": "^3.8.0",
"eiows": "^4.1.2",
"engine.io-client": "6.2.0",
"engine.io-client-v3": "npm:engine.io-client@3.5.2",
"expect.js": "^0.3.1",
Expand All @@ -53,17 +53,17 @@
"rimraf": "^3.0.2",
"superagent": "^3.8.1",
"typescript": "^4.4.3",
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.0.0"
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.15.0"
},
"scripts": {
"compile": "rimraf ./build && tsc",
"test": "npm run compile && npm run format:check && npm run test:default && npm run test:compat-v3 && npm run test:eiows && npm run test:uws",
"test": "npm run compile && npm run format:check && npm run test:default && npm run test:compat-v3",
"test:default": "mocha --bail --exit",
"test:compat-v3": "EIO_CLIENT=3 mocha --exit",
"test:eiows": "EIO_WS_ENGINE=eiows mocha --exit",
"test:uws": "EIO_WS_ENGINE=uws mocha --exit",
"format:check": "prettier --check \"lib/**/*.ts\" \"test/**/*.js\"",
"format:fix": "prettier --write \"lib/**/*.ts' 'test/**/*.js\"",
"format:fix": "prettier --write \"lib/**/*.ts\" \"test/**/*.js\"",
"prepack": "npm run compile"
},
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion test/common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const { listen, uServer } = require("..");
const { App, us_socket_local_port } = require("uWebSockets.js");
const { Socket } =
process.env.EIO_CLIENT === "3"
? require("engine.io-client-v3")
Expand All @@ -18,6 +17,7 @@ exports.listen = (opts, fn) => {
opts.allowEIO3 = true;

if (process.env.EIO_WS_ENGINE === "uws") {
const { App, us_socket_local_port } = require("uWebSockets.js");
const engine = new uServer(opts);
const app = App();
engine.attach(app, opts);
Expand Down
40 changes: 20 additions & 20 deletions test/fixtures/client.crt
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
-----BEGIN CERTIFICATE-----
MIIDojCCAYoCAQIwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQVUxEzARBgNV
BAgTClNvbWUtU3RhdGUxITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0
ZDAeFw0xNTExMTgxNzM4MDVaFw0yNTExMTUxNzM4MDVaMG0xCzAJBgNVBAYTAkZJ
MRMwEQYDVQQIEwpTb21lLVN0YXRlMREwDwYDVQQHEwhIZWxzaW5raTEhMB8GA1UE
ChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMRMwEQYDVQQDEwpGb28gQ2xpZW50
MIGfMA0GCSqGSIb3DQEBAQUAA4GNAD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
t0UJWU1rR+kLDS3qLfQqvnbvUMroZ9zxE9CJq6+aKEQEpc79lfiv464=
-----END CERTIFICATE-----
Binary file modified test/fixtures/client.pfx
Binary file not shown.
40 changes: 20 additions & 20 deletions test/fixtures/server.crt
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
-----BEGIN CERTIFICATE-----
MIIDoTCCAYkCAQEwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQVUxEzARBgNV
BAgTClNvbWUtU3RhdGUxITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0
ZDAeFw0xNTExMTgxNzM4MDhaFw0yNTExMTUxNzM4MDhaMGwxCzAJBgNVBAYTAkZJ
MRMwEQYDVQQIEwpTb21lLVN0YXRlMREwDwYDVQQHEwhIZWxzaW5raTEhMB8GA1UE
ChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMRIwEAYDVQQDEwlsb2NhbGhvc3Qw
gZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMBAs08Mguowi6W8+BrqiByLr3Fh
pKnnRTtO/wfDDebgP3Da5vIapHt0NbbSIYkju1M1y/9S0uqCScSIIFeSr8wOvmB1
c0jRX+P6oA6p8lJXG/HEfEuu3uK+Olkds7sHcrtuRaYLEAXNYCUTlT0VdfVvxV96
0m/5wMRpexjC5h+jAgMBAAEwDQYJKoZIhvcNAQEFBQADggIBACvxt9oSl8zDz2i9
DFtBVA87TYkv7MPqc6HKzpzKjUpay1CmTrXxaw9WKXGC47aoj/wXNqe1W/w5KUdH
79Z7n/TKpQJ9hj3NQJerFGD5EGu+rL4/FshMiwjp0/AiuAIThVa11BDzmEltwf86
mHfIhRG89m3LmJbCzOLTjqjnt3vL5fcW0KEN+5TDFxINbXC6o+ioZgMeh3n+d01D
MZImN01A0ZwKch81IDmPZD/IrtCLGwG/YfTaQUshMHUaQIKqDIyzDb/VgWGh1vET
J6Zpbvr3xc+mg34588qd6JcyND6X1LKBvLUNqcIrcA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iR1NhKI
AMYghpel30w5e+cWtsdR06P2FvZMuiMFCyqsbPf1xcEIAXN7HJDswq6g0ppTVZ4L
sXljG/J0vp+jAst4XKGLaGqnt8JaBnpNX9NO2Up3h5j7Pa4Nhm/LZ3Ku5ZVDmS1d
B98Bsgr6tQSSyPNfZW0tGXELsNX1I+wUFw9IXFadRTHkhjeT/GhFw3i12uY7rqzm
uJegTtWDkp1QOajhYhLD9WGXb9teldkAAgZawD6ax/uAzqx/4mBFvsUa3FMcua8k
HF9P2lLzKAcyaKt1cvlfUYmDVZ2Gh+9PgM8SqRpMIqK5jMRvFgemxJXS9BMBrQLp
TCvgRwQZD4mUloRlGNewKfJ0oQ1rY29vwdjTL8+BBS/GR8EuzYnqJG/D2nK0guIN
ze+cSDghA5N2pp/ffnpLWmkIDO+fsGAj3eApLhbPQ1xCXnEv6fOjgUmnxdt41m8d
+pEVBICohnvYgoEERDNAi1onJlBd/eyk0Jn37QiwqhQyrmfgwncvlt2SyzS1IZ7s
cEYreG6QHghBhgYiYo0FMuDCjT6g6Ga+T8nOp0xpZtGEWvHwjLjxvQ==
-----END CERTIFICATE-----
26 changes: 11 additions & 15 deletions test/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3646,7 +3646,8 @@ describe("server", () => {
}
});

it("should allow loading of other websocket server implementation like eiows", done => {
// FIXME eiows fails to build on Node.js 18 (and has dropped support for Node.js 10)
it.skip("should allow loading of other websocket server implementation like eiows", done => {
const engine = listen(
{ allowUpgrades: false, wsEngine: require("eiows").Server },
port => {
Expand All @@ -3667,19 +3668,20 @@ describe("server", () => {
});

describe("remoteAddress", () => {
const POSSIBLE_VALUES = [
"0000:0000:0000:0000:0000:0000:0000:0001",
"0000:0000:0000:0000:0000:ffff:7f00:0001",
"::ffff:127.0.0.1",
"::1"
];

it("should be defined (polling)", done => {
const engine = listen({ transports: ["polling"] }, port => {
new ClientSocket(`ws://localhost:${port}`, {
transports: ["polling"]
});
engine.on("connection", socket => {
if (process.env.EIO_WS_ENGINE === "uws") {
expect(socket.remoteAddress).to.be(
"0000:0000:0000:0000:0000:ffff:7f00:0001"
);
} else {
expect(socket.remoteAddress).to.be("::ffff:127.0.0.1");
}
expect(POSSIBLE_VALUES).to.contain(socket.remoteAddress);
done();
});
});
Expand All @@ -3691,13 +3693,7 @@ describe("server", () => {
transports: ["websocket"]
});
engine.on("connection", socket => {
if (process.env.EIO_WS_ENGINE === "uws") {
expect(socket.remoteAddress).to.be(
"0000:0000:0000:0000:0000:ffff:7f00:0001"
);
} else {
expect(socket.remoteAddress).to.be("::ffff:127.0.0.1");
}
expect(POSSIBLE_VALUES).to.contain(socket.remoteAddress);
done();
});
});
Expand Down

0 comments on commit 535a01d

Please sign in to comment.