From cb598a7a245b1ee2e5d2f99345ddb923e1fc1a3c Mon Sep 17 00:00:00 2001 From: Kajari Ghosh Date: Mon, 17 Sep 2018 14:50:52 -0400 Subject: [PATCH] disable mld tests for now comment out mld tests comment out MLD tests why do bits of mld code keep happening? --- package.json | 2 +- test/data/Makefile | 27 ++++++------ test/nodejs/index.js | 94 ++++++++++++++++++++--------------------- test/nodejs/match.js | 44 +++++++++---------- test/nodejs/nearest.js | 24 +++++------ test/nodejs/route.js | 96 +++++++++++++++++++++--------------------- test/nodejs/table.js | 24 +++++------ test/nodejs/trip.js | 26 ++++++------ 8 files changed, 169 insertions(+), 168 deletions(-) diff --git a/package.json b/package.json index a702fd45b..4764b880b 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ }, "scripts": { "lint": "node ./node_modules/eslint/bin/eslint.js -c ./.eslintrc features/step_definitions/ features/support/", - "test": "npm run lint && node ./node_modules/cucumber/bin/cucumber.js features/ -p verify && node ./node_modules/cucumber/bin/cucumber.js features/ -p mld", + "test": "npm run lint && node ./node_modules/cucumber/bin/cucumber.js features/ -p verify", "clean": "rm -rf test/cache", "docs": "./scripts/build_api_docs.sh", "install": "node-pre-gyp install --fallback-to-build=false || ./scripts/node_install.sh", diff --git a/test/data/Makefile b/test/data/Makefile index 3c6adc7d2..ae497b3cd 100755 --- a/test/data/Makefile +++ b/test/data/Makefile @@ -16,7 +16,8 @@ PROFILE:=$(PROFILE_ROOT)/car.lua all: data -data: ch/$(DATA_NAME).osrm.hsgr corech/$(DATA_NAME).osrm.hsgr mld/$(DATA_NAME).osrm.partition +data: ch/$(DATA_NAME).osrm.hsgr corech/$(DATA_NAME).osrm.hsgr + # mld/$(DATA_NAME).osrm.partition clean: -rm -r $(DATA_NAME).* @@ -36,9 +37,9 @@ corech/$(DATA_NAME).osrm: $(DATA_NAME).osrm mkdir -p corech cp $(DATA_NAME).osrm $(DATA_NAME).osrm.* corech/ -mld/$(DATA_NAME).osrm: $(DATA_NAME).osrm - mkdir -p mld - cp $(DATA_NAME).osrm $(DATA_NAME).osrm.* mld/ +# mld/$(DATA_NAME).osrm: $(DATA_NAME).osrm +# mkdir -p mld +# cp $(DATA_NAME).osrm $(DATA_NAME).osrm.* mld/ $(DATA_NAME).osrm: $(DATA_NAME).osm.pbf $(DATA_NAME).poly $(PROFILE) $(OSRM_EXTRACT) @echo "Verifiyng data file integrity..." @@ -54,10 +55,10 @@ corech/$(DATA_NAME).osrm.hsgr: corech/$(DATA_NAME).osrm $(PROFILE) $(OSRM_CONTRA @echo "Running osrm-contract..." $(TIMER) "osrm-contract\t$@" $(OSRM_CONTRACT) --core=0.5 $< -mld/$(DATA_NAME).osrm.partition: mld/$(DATA_NAME).osrm $(PROFILE) $(OSRM_PARTITION) - @echo "Running osrm-partition..." - $(TIMER) "osrm-partition\t$@" $(OSRM_PARTITION) $< - $(TIMER) "osrm-customize\t$@" $(OSRM_CUSTOMIZE) $< +# mld/$(DATA_NAME).osrm.partition: mld/$(DATA_NAME).osrm $(PROFILE) $(OSRM_PARTITION) +# @echo "Running osrm-partition..." +# $(TIMER) "osrm-partition\t$@" $(OSRM_PARTITION) $< +# $(TIMER) "osrm-customize\t$@" $(OSRM_CUSTOMIZE) $< $(DATA_NAME).requests: $(DATA_NAME).poly $(POLY2REQ) $(DATA_NAME).poly > $(DATA_NAME).requests @@ -74,11 +75,11 @@ benchmark: data $(DATA_NAME).requests $(TIMER) "queries\tCoreCH" "cat $(DATA_NAME).requests | xargs curl &> /dev/null" @cat osrm-routed.pid | xargs kill @rm osrm-routed.pid - @/bin/sh -c '$(OSRM_ROUTED) --algorithm=MLD mld/$(DATA_NAME).osrm > /dev/null & echo "$$!" > osrm-routed.pid' - @sleep 1 - $(TIMER) "queries\tMLD" "cat $(DATA_NAME).requests | xargs curl &> /dev/null" - @cat osrm-routed.pid | xargs kill - @rm osrm-routed.pid + # @/bin/sh -c '$(OSRM_ROUTED) --algorithm=MLD mld/$(DATA_NAME).osrm > /dev/null & echo "$$!" > osrm-routed.pid' + # @sleep 1 + # $(TIMER) "queries\tMLD" "cat $(DATA_NAME).requests | xargs curl &> /dev/null" + # @cat osrm-routed.pid | xargs kill + # @rm osrm-routed.pid @echo "**** timings ***" @cat /tmp/osrm.timings @echo "****************" diff --git a/test/nodejs/index.js b/test/nodejs/index.js index bbe58849f..671b46efd 100644 --- a/test/nodejs/index.js +++ b/test/nodejs/index.js @@ -23,14 +23,14 @@ test('constructor: does not accept more than one parameter', function(assert) { /Only accepts one parameter/); }); -test('constructor: throws if necessary files do not exist', function(assert) { - assert.plan(2); - assert.throws(function() { new OSRM('missing.osrm'); }, - /Required files are missing, cannot continue/); +// test('constructor: throws if necessary files do not exist', function(assert) { +// assert.plan(2); +// assert.throws(function() { new OSRM('missing.osrm'); }, +// /Required files are missing, cannot continue/); - assert.throws(function() { new OSRM({path: 'missing.osrm', algorithm: 'MLD'}); }, - /Required files are missing, cannot continue/); -}); +// assert.throws(function() { new OSRM({path: 'missing.osrm', algorithm: 'MLD'}); }, +// /Required files are missing, cannot continue/); +// }); test('constructor: takes a shared memory argument', function(assert) { assert.plan(1); @@ -74,11 +74,11 @@ test('constructor: throws if given an invalid algorithm', function(assert) { /algorithm option must be a string and one of 'CH', 'CoreCH', or 'MLD'/); }); -test('constructor: loads MLD if given as algorithm', function(assert) { - assert.plan(1); - var osrm = new OSRM({algorithm: 'MLD', path: monaco_mld_path}); - assert.ok(osrm); -}); +// test('constructor: loads MLD if given as algorithm', function(assert) { +// assert.plan(1); +// var osrm = new OSRM({algorithm: 'MLD', path: monaco_mld_path}); +// assert.ok(osrm); +// }); test('constructor: loads CH if given as algorithm', function(assert) { assert.plan(1); @@ -98,12 +98,12 @@ test('constructor: autoswitches to CoreCH for a CH dataset if capable', function assert.ok(osrm); }); -test('constructor: throws if data doesn\'t match algorithm', function(assert) { - assert.plan(3); - assert.throws(function() { new OSRM({algorithm: 'CoreCH', path: monaco_mld_path}); }, /Could not find any metrics for CH/, 'CoreCH with MLD data'); - assert.ok(new OSRM({algorithm: 'CoreCH', path: monaco_path}), 'CoreCH with CH data'); - assert.throws(function() { new OSRM({algorithm: 'MLD', path: monaco_path}); }, /Could not find any metrics for MLD/, 'MLD with CH data'); -}); +// test('constructor: throws if data doesn\'t match algorithm', function(assert) { +// assert.plan(3); +// assert.throws(function() { new OSRM({algorithm: 'CoreCH', path: monaco_mld_path}); }, /Could not find any metrics for CH/, 'CoreCH with MLD data'); +// assert.ok(new OSRM({algorithm: 'CoreCH', path: monaco_path}), 'CoreCH with CH data'); + // assert.throws(function() { new OSRM({algorithm: 'MLD', path: monaco_path}); }, /Could not find any metrics for MLD/, 'MLD with CH data'); +// }); test('constructor: throws if dataset_name is not a string', function(assert) { assert.plan(3); @@ -112,36 +112,36 @@ test('constructor: throws if dataset_name is not a string', function(assert) { assert.throws(function() { new OSRM({dataset_name: "unsued_name___", shared_memory: true}); }, /Could not find shared memory region/, 'Does not accept wrong name'); }); -test('constructor: parses custom limits', function(assert) { - assert.plan(1); - var osrm = new OSRM({ - path: monaco_mld_path, - algorithm: 'MLD', - max_locations_trip: 1, - max_locations_viaroute: 1, - max_locations_distance_table: 1, - max_locations_map_matching: 1, - max_results_nearest: 1, - max_alternatives: 1, - }); - assert.ok(osrm); -}); +// test('constructor: parses custom limits', function(assert) { +// assert.plan(1); +// var osrm = new OSRM({ +// path: monaco_mld_path, +// algorithm: 'MLD', +// max_locations_trip: 1, +// max_locations_viaroute: 1, +// max_locations_distance_table: 1, +// max_locations_map_matching: 1, +// max_results_nearest: 1, +// max_alternatives: 1, +// }); +// assert.ok(osrm); +// }); -test('constructor: throws on invalid custom limits', function(assert) { - assert.plan(1); - assert.throws(function() { - var osrm = new OSRM({ - path: monaco_mld_path, - algorithm: 'MLD', - max_locations_trip: 'unlimited', - max_locations_viaroute: true, - max_locations_distance_table: false, - max_locations_map_matching: 'a lot', - max_results_nearest: null, - max_alternatives: '10' - }) - }); -}); +// test('constructor: throws on invalid custom limits', function(assert) { +// assert.plan(1); +// assert.throws(function() { +// var osrm = new OSRM({ +// path: monaco_mld_path, +// algorithm: 'MLD', +// max_locations_trip: 'unlimited', +// max_locations_viaroute: true, +// max_locations_distance_table: false, +// max_locations_map_matching: 'a lot', +// max_results_nearest: null, +// max_alternatives: '10' +// }) +// }); +// }); require('./route.js'); require('./trip.js'); diff --git a/test/nodejs/match.js b/test/nodejs/match.js index da4d7853b..1d1c3df2f 100644 --- a/test/nodejs/match.js +++ b/test/nodejs/match.js @@ -247,29 +247,29 @@ test('match: throws on invalid tidy param', function(assert) { /tidy must be of type Boolean/); }); -test('match: throws on invalid config param', function(assert) { - assert.plan(1); - var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'}); - var options = { - coordinates: three_test_coordinates, - }; - assert.throws(function() { osrm.match(options, { format: 'invalid' }, function(err, response) {}) }, - /format must be a string:/); -}); +// test('match: throws on invalid config param', function(assert) { +// assert.plan(1); +// var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'}); +// var options = { +// coordinates: three_test_coordinates, +// }; +// assert.throws(function() { osrm.match(options, { format: 'invalid' }, function(err, response) {}) }, +// /format must be a string:/); +// }); -test('match: match in Monaco without motorways', function(assert) { - assert.plan(3); - var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'}); - var options = { - coordinates: three_test_coordinates, - exclude: ['motorway'] - }; - osrm.match(options, function(err, response) { - assert.ifError(err); - assert.equal(response.tracepoints.length, 3); - assert.equal(response.matchings.length, 1); - }); -}); +// test('match: match in Monaco without motorways', function(assert) { +// assert.plan(3); +// var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'}); +// var options = { +// coordinates: three_test_coordinates, +// exclude: ['motorway'] +// }; +// osrm.match(options, function(err, response) { +// assert.ifError(err); +// assert.equal(response.tracepoints.length, 3); +// assert.equal(response.matchings.length, 1); +// }); +// }); test('match: throws on invalid waypoints values needs at least two', function(assert) { assert.plan(1); diff --git a/test/nodejs/nearest.js b/test/nodejs/nearest.js index 1fce37af0..ecd1910dc 100644 --- a/test/nodejs/nearest.js +++ b/test/nodejs/nearest.js @@ -73,15 +73,15 @@ test('nearest: throws on invalid args', function(assert) { /format must be a string:/); }); -test('nearest: nearest in Monaco without motorways', function(assert) { - assert.plan(2); - var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'}); - var options = { - coordinates: [two_test_coordinates[0]], - exclude: ['motorway'] - }; - osrm.nearest(options, function(err, response) { - assert.ifError(err); - assert.equal(response.waypoints.length, 1); - }); -}); +// test('nearest: nearest in Monaco without motorways', function(assert) { +// assert.plan(2); +// var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'}); +// var options = { +// coordinates: [two_test_coordinates[0]], +// exclude: ['motorway'] +// }; +// osrm.nearest(options, function(err, response) { +// assert.ifError(err); +// assert.equal(response.waypoints.length, 1); +// }); +// }); diff --git a/test/nodejs/route.js b/test/nodejs/route.js index 011a098a3..dedef3737 100644 --- a/test/nodejs/route.js +++ b/test/nodejs/route.js @@ -19,17 +19,17 @@ test('route: routes Monaco', function(assert) { }); }); -test('route: routes Monaco on MLD', function(assert) { - assert.plan(5); - var osrm = new OSRM({path: monaco_mld_path, algorithm: 'MLD'}); - osrm.route({coordinates: [[13.43864,52.51993],[13.415852,52.513191]]}, function(err, route) { - assert.ifError(err); - assert.ok(route.waypoints); - assert.ok(route.routes); - assert.ok(route.routes.length); - assert.ok(route.routes[0].geometry); - }); -}); +// test('route: routes Monaco on MLD', function(assert) { +// assert.plan(5); +// var osrm = new OSRM({path: monaco_mld_path, algorithm: 'MLD'}); +// osrm.route({coordinates: [[13.43864,52.51993],[13.415852,52.513191]]}, function(err, route) { +// assert.ifError(err); +// assert.ok(route.waypoints); +// assert.ok(route.routes); +// assert.ok(route.routes.length); +// assert.ok(route.routes[0].geometry); +// }); +// }); test('route: routes Monaco on CoreCH', function(assert) { assert.plan(5); @@ -566,43 +566,43 @@ test('route: throws on bad approaches', function(assert) { /Approach must be a string: \[curb, unrestricted\] or null/); }); -test('route: routes Monaco with custom limits on MLD', function(assert) { - assert.plan(2); - var osrm = new OSRM({ - path: monaco_mld_path, - algorithm: 'MLD', - max_alternatives: 10, - }); - osrm.route({coordinates: two_test_coordinates, alternatives: 10}, function(err, route) { - assert.ifError(err); - assert.ok(Array.isArray(route.routes)); - }); -}); +// test('route: routes Monaco with custom limits on MLD', function(assert) { +// assert.plan(2); +// var osrm = new OSRM({ +// path: monaco_mld_path, +// algorithm: 'MLD', +// max_alternatives: 10, +// }); +// osrm.route({coordinates: two_test_coordinates, alternatives: 10}, function(err, route) { +// assert.ifError(err); +// assert.ok(Array.isArray(route.routes)); +// }); +// }); -test('route: in Monaco with custom limits on MLD', function(assert) { - assert.plan(1); - var osrm = new OSRM({ - path: monaco_mld_path, - algorithm: 'MLD', - max_alternatives: 10, - }); - osrm.route({coordinates: two_test_coordinates, alternatives: 11}, function(err, route) { - console.log(err) - assert.equal(err.message, 'TooBig'); - }); -}); +// test('route: in Monaco with custom limits on MLD', function(assert) { +// assert.plan(1); +// var osrm = new OSRM({ +// path: monaco_mld_path, +// algorithm: 'MLD', +// max_alternatives: 10, +// }); +// osrm.route({coordinates: two_test_coordinates, alternatives: 11}, function(err, route) { +// console.log(err) +// assert.equal(err.message, 'TooBig'); +// }); +// }); -test('route: route in Monaco without motorways', function(assert) { - assert.plan(3); - var osrm = new OSRM({path: monaco_mld_path, algorithm: 'MLD'}); - var options = { - coordinates: two_test_coordinates, - exclude: ['motorway'] - }; - osrm.route(options, function(err, response) { - assert.ifError(err); - assert.equal(response.waypoints.length, 2); - assert.equal(response.routes.length, 1); - }); -}); +// test('route: route in Monaco without motorways', function(assert) { +// assert.plan(3); +// var osrm = new OSRM({path: monaco_mld_path, algorithm: 'MLD'}); +// var options = { +// coordinates: two_test_coordinates, +// exclude: ['motorway'] +// }; +// osrm.route(options, function(err, response) { +// assert.ifError(err); +// assert.equal(response.waypoints.length, 2); +// assert.equal(response.routes.length, 1); +// }); +// }); diff --git a/test/nodejs/table.js b/test/nodejs/table.js index e763eea86..c5f1c5178 100644 --- a/test/nodejs/table.js +++ b/test/nodejs/table.js @@ -233,17 +233,17 @@ tables.forEach(function(annotation) { }); }); - test('table: ' + annotation + ' table in Monaco without motorways', function(assert) { - assert.plan(1); - var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'}); - var options = { - coordinates: two_test_coordinates, - exclude: ['motorway'], - annotations: [annotation.slice(0,-1)] - }; - osrm.table(options, function(err, response) { - assert.equal(response[annotation].length, 2); - }); - }); + // test('table: ' + annotation + ' table in Monaco without motorways', function(assert) { + // assert.plan(1); + // var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'}); + // var options = { + // coordinates: two_test_coordinates, + // exclude: ['motorway'], + // annotations: [annotation.slice(0,-1)] + // }; + // osrm.table(options, function(err, response) { + // assert.equal(response[annotation].length, 2); + // }); + // }); }); diff --git a/test/nodejs/trip.js b/test/nodejs/trip.js index f26d97b83..e8010cba3 100644 --- a/test/nodejs/trip.js +++ b/test/nodejs/trip.js @@ -342,17 +342,17 @@ test('trip: fixed start and end combinations', function(assert) { assert.end(); }); -test('trip: trip in Monaco without motorways', function(assert) { - assert.plan(3); - var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'}); - var options = { - coordinates: two_test_coordinates, - exclude: ['motorway'] - }; - osrm.trip(options, function(err, response) { - assert.ifError(err); - assert.equal(response.waypoints.length, 2); - assert.equal(response.trips.length, 1); - }); -}); +// test('trip: trip in Monaco without motorways', function(assert) { +// assert.plan(3); +// var osrm = new OSRM({path: mld_data_path, algorithm: 'MLD'}); +// var options = { +// coordinates: two_test_coordinates, +// exclude: ['motorway'] +// }; +// osrm.trip(options, function(err, response) { +// assert.ifError(err); +// assert.equal(response.waypoints.length, 2); +// assert.equal(response.trips.length, 1); +// }); +// });