Skip to content

Commit 73cd7f9

Browse files
committed
[misc] remove use of srv environment test in CI
1 parent 403b366 commit 73cd7f9

File tree

6 files changed

+17
-22
lines changed

6 files changed

+17
-22
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ jobs:
7474
LOCAL_DB: ${{ steps.setup-env.outputs.database-type }}
7575
DB_TYPE: ${{ matrix.db-type }}
7676
TEST_DB_SERVER_CERT: ${{ matrix.db-type == 'container' && './.github/workflows/certs/server.crt' || '' }}
77+
DB_VERSION: ${{ matrix.db-tag }}
7778

7879
- name: Download Codecov uploader
7980
shell: bash

test/base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ module.exports.isMaxscale = function isMaxscale() {
4848
const maxscaleVersion = global.shareConn.info.maxscaleVersion;
4949
if (!maxscaleVersion) {
5050
// maxscale before 23.08
51-
return process.env.srv === 'maxscale';
51+
return process.env.DB_TYPE === 'maxscale' || process.env.srv === 'maxscale';
5252
}
5353
}
5454
return true;

test/integration/datatype/test-datetime.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: LGPL-2.1-or-later
2-
// Copyright (c) 2015-2024 MariaDB Corporation Ab
2+
// Copyright (c) 2015-2025 MariaDB Corporation Ab
33

44
'use strict';
55

@@ -47,11 +47,7 @@ describe('datetime', () => {
4747
//using distant server, time might be different
4848
// if local socket not available, this means using distant / docker server that might have other default
4949
if (!process.env.LOCAL_SOCKET_AVAILABLE) this.skip();
50-
if (
51-
(Conf.baseConfig.host !== 'localhost' && Conf.baseConfig.host !== 'mariadb.example.com') ||
52-
isMaxscale() ||
53-
process.env.srv === 'skysql-ha'
54-
)
50+
if ((Conf.baseConfig.host !== 'localhost' && Conf.baseConfig.host !== 'mariadb.example.com') || isMaxscale())
5551
this.skip();
5652

5753
let res = await shareConn.query('SELECT UNIX_TIMESTAMP(?) tt', [new Date('2000-01-01 UTC')]);
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: LGPL-2.1-or-later
2-
// Copyright (c) 2015-2024 MariaDB Corporation Ab
2+
// Copyright (c) 2015-2025 MariaDB Corporation Ab
33

44
'use strict';
55

@@ -9,14 +9,14 @@ const { isMaxscale } = require('../base');
99

1010
describe('server additional information API', () => {
1111
it('server version', async function () {
12-
if (isMaxscale() || process.env.srv === 'build') this.skip();
12+
if (isMaxscale()) this.skip();
1313

1414
const res = await shareConn.query('SELECT VERSION() a');
1515
assert.deepEqual(res, [{ a: shareConn.serverVersion() }]);
1616
});
1717

1818
it('server type', function () {
19-
if (!process.env.srv) this.skip();
20-
assert.equal(process.env.srv !== 'mysql', shareConn.info.isMariaDB());
19+
if (!process.env.DB_TYPE) this.skip();
20+
assert.equal(process.env.DB_TYPE !== 'mysql', shareConn.info.isMariaDB());
2121
});
2222
});

test/integration/test-connection-meta.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: LGPL-2.1-or-later
2-
// Copyright (c) 2015-2024 MariaDB Corporation Ab
2+
// Copyright (c) 2015-2025 MariaDB Corporation Ab
33

44
'use strict';
55

@@ -10,12 +10,10 @@ const assert = require('chai').assert;
1010
describe('Connection meta', function () {
1111
it('server version', () => {
1212
const serverVersion = shareConn.serverVersion();
13-
if (process.env.srv) {
14-
if (!isMaxscale()) {
15-
const version = process.env.v;
16-
if (version && !version.includes('-rc')) {
17-
assert(serverVersion.startsWith(version), serverVersion + '/' + version);
18-
}
13+
if (!isMaxscale()) {
14+
const version = process.env.DB_VERSION;
15+
if (version && !version.includes('-rc')) {
16+
assert(serverVersion.startsWith(version), serverVersion + '/' + version);
1917
}
2018
}
2119
});
@@ -34,8 +32,8 @@ describe('Connection meta', function () {
3432

3533
it('isMariaDB', () => {
3634
const isMariadb = shareConn.info.isMariaDB();
37-
if (process.env.srv) {
38-
assert.equal(isMariadb, !process.env.srv.startsWith('mysql'));
35+
if (process.env.DB_TYPE) {
36+
assert.equal(isMariadb, !process.env.DB_TYPE.startsWith('mysql'));
3937
}
4038
});
4139

test/integration/test-connection-opts.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: LGPL-2.1-or-later
2-
// Copyright (c) 2015-2024 MariaDB Corporation Ab
2+
// Copyright (c) 2015-2025 MariaDB Corporation Ab
33

44
'use strict';
55

@@ -21,7 +21,7 @@ describe('connection option', () => {
2121
});
2222

2323
it('collation with no id', async function () {
24-
if (process.env.srv === 'mariadb-es' || process.env.srv === 'mariadb-es-test') this.skip();
24+
if (process.env.DB_TYPE === 'enterprise') this.skip();
2525
if (!shareConn.info.isMariaDB() || !shareConn.info.hasMinVersion(11, 2, 0)) this.skip();
2626
const conn = await base.createConnection();
2727
await conn.query('set NAMES utf8mb4 COLLATE uca1400_vietnamese_ai_ci');

0 commit comments

Comments
 (0)