Skip to content

Commit a191631

Browse files
committed
build: use module to get server version in travis
1 parent e388a9f commit a191631

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ install:
7575

7676
before_script:
7777
- "docker --version"
78-
- "docker exec mysql mysql -e 'select version()'"
78+
- "node tool/mysql-version.js"
7979

8080
script:
8181
# Run test script

tool/mysql-version.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
var common = require('../test/common');
2+
3+
process.nextTick(run);
4+
5+
function run() {
6+
var conn = common.createConnection();
7+
8+
conn.connect(function () {
9+
conn.destroy();
10+
11+
try {
12+
console.log(conn._protocol._handshakeInitializationPacket.serverVersion);
13+
process.exit(0);
14+
} catch (e) {
15+
console.error('unable to get mysql version');
16+
process.exit(1);
17+
}
18+
});
19+
}

0 commit comments

Comments
 (0)