Skip to content

Commit 5e1e1d1

Browse files
committed
[misc] deno test CI correction
1 parent 721daf6 commit 5e1e1d1

File tree

3 files changed

+26
-24
lines changed

3 files changed

+26
-24
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ jobs:
7777
deno-version: ${{ matrix.deno }}
7878

7979
- name: Install dependencies
80-
if: ${{ !matrix.deno }}
8180
run: npm install
8281

8382
- name: Run Tests node

test/integration/pool.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ describe.concurrent('Pool', () => {
309309

310310
const seconds = Math.round((performance.now() - start) / 1000);
311311
// on windows, less accurate, such needs to have 11 too
312-
assert.isTrue(seconds === 10 || seconds === 11);
312+
assert.isTrue(seconds === 10 || seconds === 11, 'result was ' + seconds);
313313
}, 20000);
314314

315315
test('pool escape', async ({ skip }) => {
@@ -1118,7 +1118,7 @@ describe.concurrent('Pool', () => {
11181118
assert.equal(pool.activeConnections(), 10);
11191119
assert.equal(pool.totalConnections(), 10);
11201120
assert.equal(pool.idleConnections(), 0);
1121-
assert.isOk(pool.taskQueueSize() > 8000);
1121+
assert.isOk(pool.taskQueueSize() > 8000, 'err, current pool.taskQueueSize() is ' + pool.taskQueueSize());
11221122
}, 200);
11231123
} else {
11241124
assert.equal(pool.activeConnections(), 10);
@@ -1511,7 +1511,7 @@ describe.concurrent('Pool', () => {
15111511

15121512
setTimeout(someWriterStream.destroy.bind(someWriterStream), 2);
15131513
});
1514-
}, 10000);
1514+
}, 20000);
15151515

15161516
test("ensure pipe ending doesn't stall connection promise", async ({ skip }) => {
15171517
if (isMaxscale(shareConn)) return skip();

test/integration/ssl.test.js

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,13 @@ describe.concurrent('ssl', function () {
5050
let serverCaFile = Conf.baseConfig.ssl && Conf.baseConfig.ssl.ca ? null : getEnv('TEST_DB_SERVER_CERT');
5151
let clientKeyFileName = getEnv('TEST_DB_CLIENT_KEY');
5252
let clientCertFileName = getEnv('TEST_DB_CLIENT_CERT');
53-
let clientKeystoreFileName = getEnv('TEST_DB_CLIENT_PKCS');
5453

5554
if (!serverCaFile && (Conf.baseConfig.host === 'localhost' || Conf.baseConfig.host === 'mariadb.example.com')) {
5655
try {
5756
if (fs.existsSync('../../ssl')) {
58-
serverCaFile = '../../ssl/server.crt';
57+
serverCaFile = '../../ssl/ca_server.crt';
5958
clientKeyFileName = '../../ssl/client.key';
6059
clientCertFileName = '../../ssl/client.crt';
61-
clientKeystoreFileName = '../../ssl/fullclient-keystore.p12';
6260
}
6361
} catch (err) {
6462
console.error(err);
@@ -68,7 +66,6 @@ describe.concurrent('ssl', function () {
6866
if (serverCaFile) ca = [fs.readFileSync(serverCaFile, 'utf8')];
6967
if (clientKeyFileName) clientKey = [fs.readFileSync(clientKeyFileName, 'utf8')];
7068
if (clientCertFileName) clientCert = [fs.readFileSync(clientCertFileName, 'utf8')];
71-
if (clientKeystoreFileName) clientKeystore = [fs.readFileSync(clientKeystoreFileName)];
7269

7370
await shareConn.query("DROP USER IF EXISTS 'sslTestUser'" + getHostSuffix());
7471
await shareConn.query("DROP USER IF EXISTS 'X509testUser'" + getHostSuffix());
@@ -349,7 +346,7 @@ describe.concurrent('ssl', function () {
349346
ssl: { rejectUnauthorized: false, secureProtocol: 'TLSv1_method' },
350347
port: sslPort
351348
});
352-
checkProtocol(conn, 'TLSv1');
349+
await checkProtocol(conn, 'TLSv1');
353350
await conn.end();
354351
});
355352

@@ -370,7 +367,7 @@ describe.concurrent('ssl', function () {
370367
ssl: { rejectUnauthorized: false, secureProtocol: 'TLSv1_1_method' },
371368
port: sslPort
372369
});
373-
checkProtocol(conn, 'TLSv1.1');
370+
await checkProtocol(conn, 'TLSv1.1');
374371
await conn.end();
375372
});
376373

@@ -396,7 +393,7 @@ describe.concurrent('ssl', function () {
396393
},
397394
port: sslPort
398395
});
399-
checkProtocol(conn, 'TLSv1.1');
396+
await checkProtocol(conn, 'TLSv1.1');
400397
await conn.end();
401398
});
402399

@@ -467,7 +464,7 @@ describe.concurrent('ssl', function () {
467464
ssl: { rejectUnauthorized: false, secureProtocol: 'TLSv1_2_method' },
468465
port: sslPort
469466
});
470-
checkProtocol(conn, 'TLSv1.2');
467+
await checkProtocol(conn, 'TLSv1.2');
471468
await conn.end();
472469
});
473470

@@ -493,7 +490,7 @@ describe.concurrent('ssl', function () {
493490
},
494491
port: sslPort
495492
});
496-
checkProtocol(conn, 'TLSv1.2');
493+
await checkProtocol(conn, 'TLSv1.2');
497494
await validConnection(conn);
498495
await conn.end();
499496
});
@@ -543,15 +540,18 @@ describe.concurrent('ssl', function () {
543540
if (Conf.baseConfig.host !== 'localhost') return skip();
544541

545542
try {
546-
await createConnection({ host: '127.0.0.1', ssl: { ca: ca } });
543+
await createConnection({ ssl: { ca: ca } });
547544
throw new Error('Must have thrown an exception !');
548545
} catch (err) {
549-
assert(
550-
err.message.includes("Hostname/IP doesn't match certificate's altnames") ||
551-
err.message.includes("Hostname/IP does not match certificate's altnames"),
552-
'error was : ' + err.message
553-
);
554-
assert(err.message.includes("IP: 127.0.0.1 is not in the cert's list"), 'error was : ' + err.message);
546+
if (isDeno()) {
547+
assert(err.message.includes('write UNKNOWN'), 'error was : ' + err.message);
548+
} else {
549+
assert(
550+
err.message.includes("Hostname/IP doesn't match certificate's altnames") ||
551+
err.message.includes("Hostname/IP does not match certificate's altnames"),
552+
'error was : ' + err.message
553+
);
554+
}
555555
}
556556
});
557557

@@ -571,7 +571,7 @@ describe.concurrent('ssl', function () {
571571
} else if (!shareConn.info.hasMinVersion(5, 7, 28)) {
572572
expectedProtocol = 'TLSv1.1';
573573
}
574-
checkProtocol(conn, expectedProtocol);
574+
await checkProtocol(conn, expectedProtocol);
575575
await validConnection(conn);
576576
await conn.end();
577577
});
@@ -706,9 +706,12 @@ describe.concurrent('ssl', function () {
706706
}, 10000);
707707
});
708708

709-
function checkProtocol(conn, protocol) {
710-
const currentProtocol = isDeno() ? conn.__tests.getSocket().protocol : conn.__tests.getSocket().getProtocol();
711-
709+
async function checkProtocol(conn, protocol) {
710+
let currentProtocol = isDeno() ? conn.__tests.getSocket().protocol : conn.__tests.getSocket().getProtocol();
711+
if (!currentProtocol) {
712+
const res = await conn.query("SHOW STATUS LIKE 'Ssl_version'");
713+
currentProtocol = res[0].Value;
714+
}
712715
if (Array.isArray(protocol)) {
713716
for (let i = 0; i < protocol.length; i++) {
714717
if (currentProtocol === protocol[i]) return;

0 commit comments

Comments
 (0)