From f255850382eab3327f6c645b88cda55e27b6574f Mon Sep 17 00:00:00 2001 From: cgole Date: Tue, 17 Nov 2015 13:23:52 -0800 Subject: [PATCH 1/5] Add mysql CI host --- test/init.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/init.js b/test/init.js index 83bd213..1bfb10c 100644 --- a/test/init.js +++ b/test/init.js @@ -7,8 +7,8 @@ var config = require('rc')('loopback', {test: {mysql: {}}}).test.mysql; global.getConfig = function (options) { var dbConf = { - host: config.host || 'localhost', - port: config.port || 3306, + host: process.env.MYSQL_HOST || config.host || 'localhost', + port: process.env.MYSQL_PORT || config.port || 3306, database: 'myapp_test', username: config.username, password: config.password, From da879ea47fe0b1f2c08ebbaefb4098553a195851 Mon Sep 17 00:00:00 2001 From: cgole Date: Wed, 18 Nov 2015 14:37:46 -0800 Subject: [PATCH 2/5] Added db username password --- test/init.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/init.js b/test/init.js index 1bfb10c..8b0351c 100644 --- a/test/init.js +++ b/test/init.js @@ -3,15 +3,15 @@ module.exports = require('should'); var DataSource = require('loopback-datasource-juggler').DataSource; var config = require('rc')('loopback', {test: {mysql: {}}}).test.mysql; - +console.log(config) global.getConfig = function (options) { var dbConf = { host: process.env.MYSQL_HOST || config.host || 'localhost', port: process.env.MYSQL_PORT || config.port || 3306, database: 'myapp_test', - username: config.username, - password: config.password, + username: process.env.MYSQL_USERNAME || config.username, + password: process.env.MYSQL_PASSWORD || config.password, createDatabase: true }; From 5d95e03d3fc7241b485b7c76ee62387ac019d871 Mon Sep 17 00:00:00 2001 From: cgole Date: Wed, 18 Nov 2015 15:07:03 -0800 Subject: [PATCH 3/5] Changed username to user --- test/init.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/init.js b/test/init.js index 8b0351c..ea0aaa0 100644 --- a/test/init.js +++ b/test/init.js @@ -10,7 +10,7 @@ global.getConfig = function (options) { host: process.env.MYSQL_HOST || config.host || 'localhost', port: process.env.MYSQL_PORT || config.port || 3306, database: 'myapp_test', - username: process.env.MYSQL_USERNAME || config.username, + username: process.env.MYSQL_USER || config.username, password: process.env.MYSQL_PASSWORD || config.password, createDatabase: true }; From 6c3e58f9321d6213c1ac371d08c2c03fefbcd3b1 Mon Sep 17 00:00:00 2001 From: cgole Date: Wed, 18 Nov 2015 17:13:06 -0800 Subject: [PATCH 4/5] seperate env variable for test db --- test/init.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/init.js b/test/init.js index ea0aaa0..1a61831 100644 --- a/test/init.js +++ b/test/init.js @@ -7,11 +7,11 @@ console.log(config) global.getConfig = function (options) { var dbConf = { - host: process.env.MYSQL_HOST || config.host || 'localhost', - port: process.env.MYSQL_PORT || config.port || 3306, + host: process.env.TEST_MYSQL_HOST || config.host || 'localhost', + port: process.env.TEST_MYSQL_PORT || config.port || 3306, database: 'myapp_test', - username: process.env.MYSQL_USER || config.username, - password: process.env.MYSQL_PASSWORD || config.password, + username: process.env.TEST_MYSQL_USER || config.username, + password: process.env.TEST_MYSQL_PASSWORD || config.password, createDatabase: true }; @@ -20,7 +20,7 @@ global.getConfig = function (options) { dbConf[el] = options[el]; } } - + console.log(dbConf) return dbConf; }; From 58850ec24cfbcb0cb558c20f4f0225820e1cc568 Mon Sep 17 00:00:00 2001 From: cgole Date: Thu, 19 Nov 2015 14:57:10 -0800 Subject: [PATCH 5/5] removed console.log --- test/init.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/init.js b/test/init.js index 1a61831..e337a65 100644 --- a/test/init.js +++ b/test/init.js @@ -20,7 +20,6 @@ global.getConfig = function (options) { dbConf[el] = options[el]; } } - console.log(dbConf) return dbConf; };