First attempt at getting travis ci working
This commit is contained in:
parent
145007797b
commit
dae1d11530
13
.travis.yml
Normal file
13
.travis.yml
Normal file
@ -0,0 +1,13 @@
|
||||
language: node_js
|
||||
|
||||
node_js:
|
||||
- "0.11"
|
||||
- "0.10"
|
||||
- "0.8"
|
||||
|
||||
before_script:
|
||||
- psql -c 'DROP DATABASE IF EXISTS test;' -U postgres
|
||||
- psql -c 'create database test;' -U postgres
|
||||
- mysql -e 'create database IF NOT EXISTS test;'
|
||||
- mysql -Uroot test < ./tests/sql/mysql.sql
|
||||
- psql -f ./tests/sql/pgsql.sql
|
@ -21,6 +21,7 @@
|
||||
"grunt-contrib-nodeunit": "^0.4.1",
|
||||
"grunt-istanbul": "^0.3.0",
|
||||
"grunt-jsdoc": ">=0.6.1",
|
||||
"grunt-cli":"",
|
||||
"jsdoc": "^3.3.0-alpha9",
|
||||
"mysql": "^2.5.2",
|
||||
"mysql2": "^0.12.5",
|
||||
|
@ -1,5 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
var configFile = (process.env.CI) ? '../config-travis.json' : '../config.json';
|
||||
|
||||
// Load a fresh version of the test base
|
||||
delete require.cache[require.resolve('../query-builder-base')];
|
||||
var testBase = require('../query-builder-base');
|
||||
@ -7,7 +9,7 @@ var tests = testBase.tests;
|
||||
|
||||
// Load the test config file
|
||||
var adapterName = 'mysql2';
|
||||
var config = require('../config.json')[adapterName];
|
||||
var config = require(configFile)[adapterName];
|
||||
|
||||
// Set up the connection
|
||||
var mysql2 = require(adapterName);
|
||||
|
@ -1,5 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
var configFile = (process.env.CI) ? '../config-travis.json' : '../config.json';
|
||||
|
||||
// Load the test base
|
||||
delete require.cache[require.resolve('../query-builder-base')];
|
||||
var testBase = require('../query-builder-base');
|
||||
@ -7,7 +9,7 @@ var tests = testBase.tests;
|
||||
|
||||
// Load the test config file
|
||||
var adapterName = 'mysql';
|
||||
var config = require('../config.json')[adapterName];
|
||||
var config = require(configFile)[adapterName];
|
||||
|
||||
// Set up the connection
|
||||
var mysql = require(adapterName);
|
||||
|
@ -1,5 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
var configFile = (process.env.CI) ? '../config-travis.json' : '../config.json';
|
||||
|
||||
// Load the test base
|
||||
delete require.cache[require.resolve('../query-builder-base')];
|
||||
var testBase = require('../query-builder-base');
|
||||
@ -7,7 +9,7 @@ var tests = testBase.tests;
|
||||
|
||||
// Load the test config file
|
||||
var adapterName = 'pg';
|
||||
var config = require('../config.json')[adapterName];
|
||||
var config = require(configFile)[adapterName];
|
||||
|
||||
// Set up the connection
|
||||
var pg = require(adapterName);
|
||||
|
24
tests/config-travis.json
Normal file
24
tests/config-travis.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"mysql": {
|
||||
"driver": "mysql",
|
||||
"conn": {
|
||||
"host": "localhost",
|
||||
"user": "root",
|
||||
"password": "",
|
||||
"database": "test"
|
||||
}
|
||||
},
|
||||
"mysql2": {
|
||||
"driver": "mysql",
|
||||
"conn": {
|
||||
"host": "localhost",
|
||||
"user": "root",
|
||||
"password": "",
|
||||
"database": "test"
|
||||
}
|
||||
},
|
||||
"pg": {
|
||||
"driver": "pg",
|
||||
"conn": "postgres://postgres@localhost/test"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user