Run cucumber in its own dataset namespace so it does not interfere

This commit is contained in:
Patrick Niklaus 2018-04-04 16:26:11 +00:00 committed by Patrick Niklaus
parent 0e8b8b4901
commit c4b90f52c0
2 changed files with 4 additions and 2 deletions

View File

@ -107,7 +107,8 @@ class OSRMDatastoreLoader extends OSRMBaseLoader {
} }
loadData (callback) { loadData (callback) {
this.scope.runBin('osrm-datastore', this.inputFile, this.scope.environment, (err) => { const command_arguments = util.format('--dataset-name=%s %s', this.scope.DATASET_NAME, this.inputFile);
this.scope.runBin('osrm-datastore', command_arguments, this.scope.environment, (err) => {
if (err) return callback(new Error('*** osrm-datastore exited with ' + err.code + ': ' + err)); if (err) return callback(new Error('*** osrm-datastore exited with ' + err.code + ': ' + err));
callback(); callback();
}); });
@ -116,7 +117,7 @@ class OSRMDatastoreLoader extends OSRMBaseLoader {
osrmUp (callback) { osrmUp (callback) {
if (this.osrmIsRunning()) return callback(); if (this.osrmIsRunning()) return callback();
const command_arguments = util.format('--shared-memory=1 -i %s -p %d -a %s', this.scope.OSRM_IP, this.scope.OSRM_PORT, this.scope.ROUTING_ALGORITHM); const command_arguments = util.format('--dataset-name=%s -s -i %s -p %d -a %s', this.scope.DATASET_NAME, this.scope.OSRM_IP, this.scope.OSRM_PORT, this.scope.ROUTING_ALGORITHM);
this.child = this.scope.runBin('osrm-routed', command_arguments, this.scope.environment, (err) => { this.child = this.scope.runBin('osrm-routed', command_arguments, this.scope.environment, (err) => {
if (err && err.signal !== 'SIGINT') { if (err && err.signal !== 'SIGINT') {
this.child = null; this.child = null;

View File

@ -27,6 +27,7 @@ module.exports = function () {
return callback(new Error('*** '+stxxl_config+ 'does not exist')); return callback(new Error('*** '+stxxl_config+ 'does not exist'));
} }
this.DATASET_NAME = 'cucumber';
this.PLATFORM_WINDOWS = process.platform.match(/^win.*/); this.PLATFORM_WINDOWS = process.platform.match(/^win.*/);
this.DEFAULT_ENVIRONMENT = Object.assign({STXXLCFG: stxxl_config}, process.env); this.DEFAULT_ENVIRONMENT = Object.assign({STXXLCFG: stxxl_config}, process.env);
this.DEFAULT_PROFILE = 'bicycle'; this.DEFAULT_PROFILE = 'bicycle';