Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Commit

Permalink
refactor: use WATERLINE_ADAPTER_TESTS_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
davepreston committed Jun 21, 2019
1 parent d72e2d7 commit e0c4b0b
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions test/integration/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ var log = new (require('captains-log'))();
var TestRunner = require('waterline-adapter-tests');
var Adapter = require('../../lib/adapter.js');

var local = require('../../local.js');
try {
require('../../local.js');
}
catch (error) {
log.warn('No local.js found. make sure you have an environment variable called WATERLINE_ADAPTER_TESTS_URL with the connection info for you DB.')
}

// Grab targeted interfaces from this adapter's `package.json` file:
var package = {};
Expand All @@ -41,15 +46,7 @@ console.log();

var mssql = require('mssql');
var config = {
url: local.MSSQL_URL,
user: process.env.MSSQL_USER || local.MSSQL_USER,
password: process.env.MSSQL_PASSWORD || local.MSSQL_PASSWORD,
server: process.env.MSSQL_HOST || local.MSSQL_HOST,
database: process.env.MSSQL_DATABASE || local.MSSQL_DATABASE,
port: process.env.MSSQL_PORT || local.MSSQL_PORT,
options: {
encrypt: true
},
url: process.env.WATERLINE_ADAPTER_TESTS_URL,
timeout: 300 * 1000,
pool: {
max: 100
Expand All @@ -58,7 +55,7 @@ var config = {
};

console.log('Dropping any existing tables...');
var connection = new mssql.ConnectionPool(config, function (err) {
var connection = new mssql.ConnectionPool(process.env.WATERLINE_ADAPTER_TESTS_URL, function (err) {
if (err) throw err;

new mssql.Request(connection).query([
Expand Down

0 comments on commit e0c4b0b

Please sign in to comment.