From 92a06c9a281350b86fe49f7d76fd3cd3a80521db Mon Sep 17 00:00:00 2001 From: Patrick Niklaus Date: Fri, 4 Mar 2016 16:12:10 +0100 Subject: [PATCH] Renamed prepared -> contracted --- features/options/routed/files.feature | 10 +++++----- features/step_definitions/data.rb | 2 +- features/step_definitions/distance_matrix.rb | 2 +- features/step_definitions/matching.rb | 2 +- features/step_definitions/nearest.rb | 2 +- features/step_definitions/requests.rb | 2 +- features/step_definitions/routability.rb | 2 +- features/step_definitions/routing.rb | 2 +- features/step_definitions/trip.rb | 2 +- features/support/data.rb | 20 ++++++++++---------- features/support/run.rb | 6 +++--- features/testbot/bad.feature | 2 +- 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/features/options/routed/files.feature b/features/options/routed/files.feature index 15ce679eb..59ce7c213 100644 --- a/features/options/routed/files.feature +++ b/features/options/routed/files.feature @@ -4,8 +4,8 @@ Feature: osrm-routed command line options: files # For testing program options, the --trial option is used, which causes osrm-routed to quit # immediately after initialization. This makes testing easier and faster. # -# The {prepared_base} part of the options to osrm-routed will be expanded to the actual base path of -# the prepared input file. +# The {contracted_base} part of the options to osrm-routed will be expanded to the actual base path of +# the contracted input file. # TODO # Since we're not using osmr-datastore for all testing, osrm-routed is kept running. @@ -19,14 +19,14 @@ Feature: osrm-routed command line options: files And the ways | nodes | | ab | - And the data has been prepared + And the data has been contracted Scenario: osrm-routed - Passing base file - When I run "osrm-routed {prepared_base}.osrm --trial" + When I run "osrm-routed {contracted_base}.osrm --trial" Then stdout should contain /^\[info\] starting up engines/ And stdout should contain /\d{1,2}\.\d{1,2}\.\d{1,2}/ And stdout should contain /compiled at/ And stdout should contain /^\[info\] loaded plugin: viaroute/ And stdout should contain /^\[info\] trial run/ And stdout should contain /^\[info\] shutdown completed/ - And it should exit with code 0 \ No newline at end of file + And it should exit with code 0 diff --git a/features/step_definitions/data.rb b/features/step_definitions/data.rb index da7857cd6..37c4ed831 100644 --- a/features/step_definitions/data.rb +++ b/features/step_definitions/data.rb @@ -173,7 +173,7 @@ Given /^the data has been extracted$/ do end end -Given /^the data has been prepared$/ do +Given /^the data has been contracted$/ do begin reprocess rescue OSRMError => e diff --git a/features/step_definitions/distance_matrix.rb b/features/step_definitions/distance_matrix.rb index 2143d375d..d4f09d090 100644 --- a/features/step_definitions/distance_matrix.rb +++ b/features/step_definitions/distance_matrix.rb @@ -29,7 +29,7 @@ When /^I request a travel time matrix I should get$/ do |table| reprocess actual = [] actual << table.headers - OSRMLoader.load(self,"#{prepared_file}.osrm") do + OSRMLoader.load(self,"#{contracted_file}.osrm") do # compute matrix params = @query_params diff --git a/features/step_definitions/matching.rb b/features/step_definitions/matching.rb index c490b4652..2ec96b4f0 100644 --- a/features/step_definitions/matching.rb +++ b/features/step_definitions/matching.rb @@ -1,7 +1,7 @@ When /^I match I should get$/ do |table| reprocess actual = [] - OSRMLoader.load(self,"#{prepared_file}.osrm") do + OSRMLoader.load(self,"#{contracted_file}.osrm") do table.hashes.each_with_index do |row,ri| if row['request'] got = {'request' => row['request'] } diff --git a/features/step_definitions/nearest.rb b/features/step_definitions/nearest.rb index b0b5f94b8..9d84c45c8 100644 --- a/features/step_definitions/nearest.rb +++ b/features/step_definitions/nearest.rb @@ -1,7 +1,7 @@ When /^I request nearest I should get$/ do |table| reprocess actual = [] - OSRMLoader.load(self,"#{prepared_file}.osrm") do + OSRMLoader.load(self,"#{contracted_file}.osrm") do table.hashes.each_with_index do |row,ri| in_node = find_node_by_name row['in'] raise "*** unknown in-node '#{row['in']}" unless in_node diff --git a/features/step_definitions/requests.rb b/features/step_definitions/requests.rb index 1c012d7d7..e44ea028f 100644 --- a/features/step_definitions/requests.rb +++ b/features/step_definitions/requests.rb @@ -1,6 +1,6 @@ When /^I request \/(.*)$/ do |path| reprocess - OSRMLoader.load(self,"#{prepared_file}.osrm") do + OSRMLoader.load(self,"#{contracted_file}.osrm") do @response = request_path path, [] end end diff --git a/features/step_definitions/routability.rb b/features/step_definitions/routability.rb index 6b5134c8c..70bccd9c6 100644 --- a/features/step_definitions/routability.rb +++ b/features/step_definitions/routability.rb @@ -44,7 +44,7 @@ Then /^routability should be$/ do |table| if table.headers&["forw","backw","bothw"] == [] raise "*** routability tabel must contain either 'forw', 'backw' or 'bothw' column" end - OSRMLoader.load(self,"#{prepared_file}.osrm") do + OSRMLoader.load(self,"#{contracted_file}.osrm") do table.hashes.each_with_index do |row,i| output_row = row.dup attempts = [] diff --git a/features/step_definitions/routing.rb b/features/step_definitions/routing.rb index f1e9590d7..36172a5b4 100644 --- a/features/step_definitions/routing.rb +++ b/features/step_definitions/routing.rb @@ -1,7 +1,7 @@ When /^I route I should get$/ do |table| reprocess actual = [] - OSRMLoader.load(self,"#{prepared_file}.osrm") do + OSRMLoader.load(self,"#{contracted_file}.osrm") do table.hashes.each_with_index do |row,ri| if row['request'] got = {'request' => row['request'] } diff --git a/features/step_definitions/trip.rb b/features/step_definitions/trip.rb index ecb4c7782..f6d42406c 100644 --- a/features/step_definitions/trip.rb +++ b/features/step_definitions/trip.rb @@ -1,7 +1,7 @@ When /^I plan a trip I should get$/ do |table| reprocess actual = [] - OSRMLoader.load(self,"#{prepared_file}.osrm") do + OSRMLoader.load(self,"#{contracted_file}.osrm") do table.hashes.each_with_index do |row,ri| if row['request'] got = {'request' => row['request'] } diff --git a/features/support/data.rb b/features/support/data.rb index c099fef21..a62bc86f8 100644 --- a/features/support/data.rb +++ b/features/support/data.rb @@ -218,8 +218,8 @@ def extracted_file @extracted_file ||= "#{osm_file}_#{fingerprint_extract}" end -def prepared_file - @prepared_file ||= "#{osm_file}_#{fingerprint_extract}_#{fingerprint_prepare}" +def contracted_file + @contracted_file ||= "#{osm_file}_#{fingerprint_extract}_#{fingerprint_prepare}" end def write_osm @@ -237,14 +237,14 @@ def extracted? end end -def prepared? +def contracted? Dir.chdir TEST_FOLDER do - File.exist?("#{prepared_file}.osrm.hsgr") + File.exist?("#{contracted_file}.osrm.hsgr") end end def write_timestamp - File.open( "#{prepared_file}.osrm.timestamp", 'w') {|f| f.write(OSM_TIMESTAMP) } + File.open( "#{contracted_file}.osrm.timestamp", 'w') {|f| f.write(OSM_TIMESTAMP) } end def write_input_data @@ -295,16 +295,16 @@ def prepare_data end begin ["osrm.hsgr","osrm.fileIndex","osrm.geometry","osrm.nodes","osrm.ramIndex","osrm.core","osrm.edges"].each do |file| - log "Renaming #{extracted_file}.#{file} to #{prepared_file}.#{file}", :preprocess - File.rename "#{extracted_file}.#{file}", "#{prepared_file}.#{file}" + log "Renaming #{extracted_file}.#{file} to #{contracted_file}.#{file}", :preprocess + File.rename "#{extracted_file}.#{file}", "#{contracted_file}.#{file}" end rescue Exception => e raise FileError.new nil, "failed to rename data file after preparing." end begin ["osrm.names","osrm.restrictions","osrm"].each do |file| - log "Copying #{extracted_file}.#{file} to #{prepared_file}.#{file}", :preprocess - FileUtils.cp "#{extracted_file}.#{file}", "#{prepared_file}.#{file}" + log "Copying #{extracted_file}.#{file} to #{contracted_file}.#{file}", :preprocess + FileUtils.cp "#{extracted_file}.#{file}", "#{contracted_file}.#{file}" end rescue Exception => e raise FileError.new nil, "failed to copy data file after preparing." @@ -316,6 +316,6 @@ end def reprocess write_input_data extract_data unless extracted? - prepare_data unless prepared? + prepare_data unless contracted? log_preprocess_done end diff --git a/features/support/run.rb b/features/support/run.rb index 5f86a9ecb..3ddfd5448 100644 --- a/features/support/run.rb +++ b/features/support/run.rb @@ -12,9 +12,9 @@ def run_bin bin, options opt.gsub! "{extracted_base}", "#{extracted_file}" end - if opt.include? '{prepared_base}' - raise "*** {prepared_base} is missing" unless prepared_file - opt.gsub! "{prepared_base}", "#{prepared_file}" + if opt.include? '{contracted_base}' + raise "*** {contracted_base} is missing" unless contracted_file + opt.gsub! "{contracted_base}", "#{contracted_file}" end if opt.include? '{profile}' opt.gsub! "{profile}", "#{PROFILES_PATH}/#{@profile}.lua" diff --git a/features/testbot/bad.feature b/features/testbot/bad.feature index d7e3c95af..593a6e05c 100644 --- a/features/testbot/bad.feature +++ b/features/testbot/bad.feature @@ -11,7 +11,7 @@ Feature: Handle bad data in a graceful manner Given the ways | nodes | - When the data has been prepared + When the data has been contracted Then "osrm-extract" should return code 1 Scenario: Only dead-end oneways