diff --git a/batch/user_database_metadata_service.js b/batch/user_database_metadata_service.js index ac7d2b6a..2cfe79e3 100644 --- a/batch/user_database_metadata_service.js +++ b/batch/user_database_metadata_service.js @@ -21,15 +21,15 @@ UserDatabaseMetadataService.prototype.getUserMetadata = function (username, call UserDatabaseMetadataService.prototype.parseMetadataToDatabase = function (userDatabaseMetadata) { var dbParams = userDatabaseMetadata; - var dbopts = { - port: global.settings.db_batch_port || 6432, - pass: global.settings.db_pubuser_pass - }; + var dbopts = {}; + dbopts.pass = dbParams.dbpass || global.settings.db_pubuser_pass; + dbopts.port = dbParams.dbport || global.settings.db_batch_port || global.settings.db_port; dbopts.host = dbParams.dbhost; dbopts.dbname = dbParams.dbname; dbopts.user = (!!dbParams.dbpublicuser) ? dbParams.dbpublicuser : global.settings.db_pubuser; + // batch is secure so it's going to be authenticated by default dbopts.authenticated = true; dbopts.user = _.template(global.settings.db_user, { user_id: dbParams.dbuser }); diff --git a/test/acceptance/job.use-case-1.test.js b/test/acceptance/job.use-case-1.test.js index 47060a3e..63e6f41a 100644 --- a/test/acceptance/job.use-case-1.test.js +++ b/test/acceptance/job.use-case-1.test.js @@ -30,9 +30,8 @@ describe('Use case 1: cancel and modify a done job', function () { var batch = batchFactory(metadataBackend); - before(function (done) { + before(function () { batch.start(); - done(); }); after(function (done) { diff --git a/test/acceptance/job.use-case-2.test.js b/test/acceptance/job.use-case-2.test.js index 3206aae0..e4f020ef 100644 --- a/test/acceptance/job.use-case-2.test.js +++ b/test/acceptance/job.use-case-2.test.js @@ -30,9 +30,8 @@ describe('Use case 2: cancel a running job', function() { var batch = batchFactory(metadataBackend); - before(function (done) { + before(function () { batch.start(); - done(); }); after(function (done) { diff --git a/test/acceptance/job.use-case-3.test.js b/test/acceptance/job.use-case-3.test.js index 05b75af0..e9174d4d 100644 --- a/test/acceptance/job.use-case-3.test.js +++ b/test/acceptance/job.use-case-3.test.js @@ -30,9 +30,8 @@ describe('Use case 3: cancel a pending job', function() { var batch = batchFactory(metadataBackend); - before(function (done) { + before(function () { batch.start(); - done(); }); after(function (done) { diff --git a/test/acceptance/job.use-case-4.test.js b/test/acceptance/job.use-case-4.test.js index 123bcc1b..36be4eee 100644 --- a/test/acceptance/job.use-case-4.test.js +++ b/test/acceptance/job.use-case-4.test.js @@ -30,9 +30,8 @@ describe('Use case 4: modify a pending job', function() { var batch = batchFactory(metadataBackend); - before(function (done) { + before(function () { batch.start(); - done(); }); after(function (done) { diff --git a/test/acceptance/job.use-case-5.test.js b/test/acceptance/job.use-case-5.test.js index a35ca452..eadbeea3 100644 --- a/test/acceptance/job.use-case-5.test.js +++ b/test/acceptance/job.use-case-5.test.js @@ -30,9 +30,8 @@ describe('Use case 5: modify a running job', function() { var batch = batchFactory(metadataBackend); - before(function (done) { + before(function () { batch.start(); - done(); }); after(function (done) { diff --git a/test/acceptance/job.use-case-6.test.js b/test/acceptance/job.use-case-6.test.js index 9f46c937..ed2f5d3b 100644 --- a/test/acceptance/job.use-case-6.test.js +++ b/test/acceptance/job.use-case-6.test.js @@ -30,9 +30,8 @@ describe('Use case 6: modify a done job', function() { var batch = batchFactory(metadataBackend); - before(function (done) { + before(function () { batch.start(); - done(); }); after(function (done) {