Skip to content

Commit b3220d3

Browse files
committed
add mysql options for travis
run changeUser tests on travis
1 parent 08c3cf1 commit b3220d3

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

.travis.yml

+12
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,15 @@ node_js:
33
- '0.6'
44
- '0.8'
55
- '0.10'
6+
7+
before_script:
8+
- "mysql -e 'create database node_mysql;'"
9+
10+
env:
11+
- MYSQL_DATABASE=node_mysql
12+
13+
mysql:
14+
adapter: mysql2
15+
username: root
16+
encoding: utf8
17+
database: node_mysql

test/integration/connection/test-change-user-empty-queue.js

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ var common = require('../../common');
22
var connection = common.createConnection();
33
var assert = require('assert');
44

5-
if (common.isTravis()) {
6-
return console.log('skipping - travis mysql does not support this test');
7-
}
8-
95
connection.query('CREATE DATABASE ' + common.testDatabase, function(err) {
106
if (err && err.code !== 'ER_DB_CREATE_EXISTS') throw err;
117

test/integration/connection/test-change-user-fatal-error.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,16 @@ var common = require('../../common');
77
var connection = common.createConnection();
88
var assert = require('assert');
99

10-
if (common.isTravis()) {
11-
return console.log('skipping - travis mysql does not support this test');
12-
}
1310

1411
var err;
15-
connection.changeUser({user: 'does-not-exist'}, function(_err) {
12+
// XXX: user: 'does-not-exist' doesn't cause any error...
13+
connection.changeUser({database: 'does-not-exist'}, function(_err) {
1614
err = _err;
1715
connection.end();
1816
});
1917

2018
process.on('exit', function() {
2119
if (process.env.NO_GRANT == '1' && err === null) return;
22-
assert.equal(err.code, 'ER_ACCESS_DENIED_ERROR');
20+
assert.equal(err.code, 'ER_BAD_DB_ERROR');
2321
assert.equal(err.fatal, true);
2422
});

test/integration/connection/test-change-user.js

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ var common = require('../../common');
22
var connection = common.createConnection();
33
var assert = require('assert');
44

5-
if (common.isTravis()) {
6-
return console.log('skipping - travis mysql does not support this test');
7-
}
8-
95
connection.query('CREATE DATABASE ' + common.testDatabase, function(err) {
106
if (err && err.code !== 'ER_DB_CREATE_EXISTS') throw err;
117
});

0 commit comments

Comments
 (0)