mirror of
https://github.com/Hopiu/webapi-eca.git
synced 2026-03-16 22:10:31 +00:00
HOTFIX! Finally found the silly bug in DB shutDown approach at the end of the testing!!! Lets grab a beer!
This commit is contained in:
parent
47cabfaa31
commit
d1361c900c
3 changed files with 14 additions and 21 deletions
|
|
@ -1,13 +0,0 @@
|
|||
path = require 'path'
|
||||
logger = require path.join '..', '..', 'js-coffee', 'logging'
|
||||
log = logger.getLogger
|
||||
nolog: true
|
||||
db = require path.join '..', '..', 'js-coffee', 'persistence'
|
||||
opts =
|
||||
logger: log
|
||||
opts[ 'db-port' ] = 6379
|
||||
db opts
|
||||
|
||||
# This needs to be done because else the DB connection will remain alive and
|
||||
# prevent the unit test from ending
|
||||
setTimeout db.shutDown, 2000
|
||||
|
|
@ -10,8 +10,8 @@ catch err
|
|||
console.log 'Error fetching standard objects file: ' + err.message
|
||||
|
||||
logger = require path.join '..', 'js-coffee', 'logging'
|
||||
log = logger.getLogger()
|
||||
# nolog: true
|
||||
log = logger.getLogger
|
||||
nolog: true
|
||||
|
||||
cm = require path.join '..', 'js-coffee', 'components-manager'
|
||||
opts =
|
||||
|
|
|
|||
|
|
@ -1,16 +1,22 @@
|
|||
#!/usr/bin/env node
|
||||
process.chdir( __dirname );
|
||||
var fs = require( 'fs' );
|
||||
var path = require( 'path' );
|
||||
var nodeunit = require( 'nodeunit' );
|
||||
var args = process.argv.slice( 2 );
|
||||
var fs = require( 'fs' ),
|
||||
path = require( 'path' ),
|
||||
nodeunit = require( 'nodeunit' ),
|
||||
db = require( './js-coffee/persistence' ),
|
||||
args = process.argv.slice( 2 ),
|
||||
fEnd = function() {
|
||||
console.log('Shutting down DB from unit_test.sh script...');
|
||||
db.shutDown();
|
||||
};
|
||||
|
||||
if( args[ 0 ] !== undefined ) {
|
||||
var fl = path.resolve( args[ 0 ] );
|
||||
if ( fs.existsSync( fl ) ) {
|
||||
nodeunit.reporters.default.run( [ fl, 'testing/end-unittest' ] );
|
||||
nodeunit.reporters.default.run( [ fl ], null, fEnd );
|
||||
} else {
|
||||
console.error( 'File not found!!' );
|
||||
}
|
||||
} else {
|
||||
nodeunit.reporters.default.run( [ 'testing', 'testing/end-unittest' ] );
|
||||
nodeunit.reporters.default.run( [ 'testing' ], null, fEnd );
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue