Skip to content

Commit f81a259

Browse files
committed
[misc] test stability correction
1 parent eef8bbb commit f81a259

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

test/base.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,7 @@ module.exports.getHostSuffix = function getHostSuffix() {
133133
}
134134
return "@'%'";
135135
};
136+
137+
module.exports.isLocalDb = function isLocalDb() {
138+
return process.env.LOCAL_DB === 'local' || localEnv === undefined;
139+
};

test/integration/test-auth-plugin.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const Conf = require('../conf');
99
const fs = require('fs');
1010
const os = require('os');
1111
const path = require('path');
12-
const { isMaxscale, getHostSuffix } = require('../base');
12+
const { isMaxscale, getHostSuffix, isLocalDb } = require('../base');
1313

1414
describe('authentication plugin', () => {
1515
let rsaPublicKey = process.env.TEST_RSA_PUBLIC_KEY;
@@ -195,6 +195,8 @@ describe('authentication plugin', () => {
195195
if (process.platform === 'win32') return this.skip();
196196
if (!shareConn.info.isMariaDB() || !shareConn.info.hasMinVersion(10, 1, 11)) return this.skip();
197197
if (!process.env.LOCAL_SOCKET_AVAILABLE) return this.skip();
198+
if (!isLocalDb()) return this.skip();
199+
198200
if (Conf.baseConfig.host !== 'localhost' && Conf.baseConfig.host !== 'mariadb.example.com') return this.skip();
199201

200202
shareConn

test/integration/test-socket.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
const base = require('../base.js');
77
const { assert } = require('chai');
88
const Conf = require('../conf');
9-
const { isMaxscale } = require('../base');
9+
const { isMaxscale, isLocalDb } = require('../base');
1010

1111
describe('test socket', () => {
1212
it('named pipe', function (done) {
@@ -80,6 +80,7 @@ describe('test socket', () => {
8080
!(Conf.baseConfig.host === 'localhost' || Conf.baseConfig.host === 'mariadb.example.com')
8181
)
8282
return this.skip();
83+
if (!isLocalDb()) return this.skip();
8384

8485
shareConn
8586
.query('select @@version_compile_os,@@socket soc')

0 commit comments

Comments
 (0)