adjust datastore testing
This commit is contained in:
parent
7ba8e51fa9
commit
db06cdb4ce
@ -21,7 +21,7 @@ def input_format
|
|||||||
end
|
end
|
||||||
|
|
||||||
def sanitized_scenario_title
|
def sanitized_scenario_title
|
||||||
@sanitized_scenario_title ||= @scenario_title.gsub /[^0-9A-Za-z.\-]/, '_'
|
@sanitized_scenario_title ||= @scenario_title.to_s.gsub /[^0-9A-Za-z.\-]/, '_'
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_grid_size meters
|
def set_grid_size meters
|
||||||
|
@ -23,9 +23,7 @@ class OSRMLoader
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.load_data
|
def self.load_data
|
||||||
puts "=== loading data with osrm-datastore"
|
run_bin "osrm-datastore", @input_file
|
||||||
log_time_and_run "#{BIN_PATH}/osrm-datastore --springclean"
|
|
||||||
log_time_and_run "#{BIN_PATH}/osrm-datastore #{@input_file}"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.launch
|
def self.launch
|
||||||
@ -50,7 +48,6 @@ class OSRMLoader
|
|||||||
if @@pid
|
if @@pid
|
||||||
s = `ps -o state -p #{@@pid}`.split[1].to_s.strip
|
s = `ps -o state -p #{@@pid}`.split[1].to_s.strip
|
||||||
up = (s =~ /^[DRST]/) != nil
|
up = (s =~ /^[DRST]/) != nil
|
||||||
# puts "=== osrm-routed, status pid #{@@pid}: #{s} (#{up ? 'up' : 'down'})"
|
|
||||||
up
|
up
|
||||||
else
|
else
|
||||||
false
|
false
|
||||||
@ -59,15 +56,11 @@ class OSRMLoader
|
|||||||
|
|
||||||
def self.osrm_up
|
def self.osrm_up
|
||||||
return if self.osrm_up?
|
return if self.osrm_up?
|
||||||
puts "=== launching osrm-routed"
|
|
||||||
log %[Process.spawn("#{BIN_PATH}/osrm-routed --sharedmemory=1 --port #{OSRM_PORT}",:out=>'#{OSRM_ROUTED_LOG_FILE}', :err=>'#{OSRM_ROUTED_LOG_FILE}')]
|
|
||||||
@@pid = Process.spawn("#{BIN_PATH}/osrm-routed --sharedmemory=1 --port #{OSRM_PORT}",:out=>OSRM_ROUTED_LOG_FILE, :err=>OSRM_ROUTED_LOG_FILE)
|
@@pid = Process.spawn("#{BIN_PATH}/osrm-routed --sharedmemory=1 --port #{OSRM_PORT}",:out=>OSRM_ROUTED_LOG_FILE, :err=>OSRM_ROUTED_LOG_FILE)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.osrm_down
|
def self.osrm_down
|
||||||
if @@pid
|
if @@pid
|
||||||
puts '=== shutting down osrm'
|
|
||||||
log_time "Process.kill 'TERM', #{@@pid}"
|
|
||||||
Process.kill 'TERM', @@pid
|
Process.kill 'TERM', @@pid
|
||||||
self.wait_for_shutdown
|
self.wait_for_shutdown
|
||||||
end
|
end
|
||||||
@ -75,8 +68,6 @@ class OSRMLoader
|
|||||||
|
|
||||||
def self.kill
|
def self.kill
|
||||||
if @@pid
|
if @@pid
|
||||||
puts '=== killing osrm'
|
|
||||||
log_time "Process.kill 'KILL', @@pid"
|
|
||||||
Process.kill 'KILL', @@pid
|
Process.kill 'KILL', @@pid
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -84,7 +75,6 @@ class OSRMLoader
|
|||||||
def self.wait_for_connection
|
def self.wait_for_connection
|
||||||
while true
|
while true
|
||||||
begin
|
begin
|
||||||
log_time "TCPSocket.new('127.0.0.1', OSRM_PORT)"
|
|
||||||
socket = TCPSocket.new('127.0.0.1', OSRM_PORT)
|
socket = TCPSocket.new('127.0.0.1', OSRM_PORT)
|
||||||
return
|
return
|
||||||
rescue Errno::ECONNREFUSED
|
rescue Errno::ECONNREFUSED
|
||||||
|
@ -18,7 +18,6 @@ def request_path path, waypoints=[], options={}
|
|||||||
uri = URI.parse ["#{HOST}/#{path}", params].compact.join('?')
|
uri = URI.parse ["#{HOST}/#{path}", params].compact.join('?')
|
||||||
@query = uri.to_s
|
@query = uri.to_s
|
||||||
Timeout.timeout(OSRM_TIMEOUT) do
|
Timeout.timeout(OSRM_TIMEOUT) do
|
||||||
log_time "Net::HTTP.get_response #{uri}"
|
|
||||||
Net::HTTP.get_response uri
|
Net::HTTP.get_response uri
|
||||||
end
|
end
|
||||||
rescue Errno::ECONNREFUSED => e
|
rescue Errno::ECONNREFUSED => e
|
||||||
@ -31,7 +30,6 @@ def request_url path
|
|||||||
uri = URI.parse"#{HOST}/#{path}"
|
uri = URI.parse"#{HOST}/#{path}"
|
||||||
@query = uri.to_s
|
@query = uri.to_s
|
||||||
Timeout.timeout(OSRM_TIMEOUT) do
|
Timeout.timeout(OSRM_TIMEOUT) do
|
||||||
log_time "Net::HTTP.get_response #{uri}"
|
|
||||||
Net::HTTP.get_response uri
|
Net::HTTP.get_response uri
|
||||||
end
|
end
|
||||||
rescue Errno::ECONNREFUSED => e
|
rescue Errno::ECONNREFUSED => e
|
||||||
|
@ -11,7 +11,8 @@ def run_bin bin, options
|
|||||||
opt.gsub! "{profile}", "#{PROFILES_PATH}/#{@profile}.lua"
|
opt.gsub! "{profile}", "#{PROFILES_PATH}/#{@profile}.lua"
|
||||||
end
|
end
|
||||||
|
|
||||||
@stdout = `#{QQ}#{BIN_PATH}/#{bin}#{EXE}#{QQ} #{opt} 2>error.log`
|
cmd = "#{QQ}#{BIN_PATH}/#{bin}#{EXE}#{QQ} #{opt} 2>error.log"
|
||||||
|
@stdout = `#{cmd}`
|
||||||
@stderr = File.read 'error.log'
|
@stderr = File.read 'error.log'
|
||||||
@exit_code = $?.exitstatus
|
@exit_code = $?.exitstatus
|
||||||
end
|
end
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@routing @bad
|
@routing @bad @testbot
|
||||||
Feature: Handle bad data in a graceful manner
|
Feature: Handle bad data in a graceful manner
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@routing @basic
|
@routing @basic @testbot
|
||||||
Feature: Basic Routing
|
Feature: Basic Routing
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@routing @bearing
|
@routing @bearing @testbot
|
||||||
Feature: Compass bearing
|
Feature: Compass bearing
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@routing @bearing_param @todo
|
@routing @bearing_param @todo @testbot
|
||||||
Feature: Bearing parameter
|
Feature: Bearing parameter
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@routing @graph
|
@routing @graph @testbot
|
||||||
Feature: Geometry Compression
|
Feature: Geometry Compression
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@routing @datastore
|
@routing @datastore @testbot
|
||||||
Feature: Temporary tests related to osrm-datastore
|
Feature: Temporary tests related to osrm-datastore
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@routing @distance
|
@routing @distance @testbot
|
||||||
Feature: Distance calculation
|
Feature: Distance calculation
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@routing @fastest
|
@routing @fastest @testbot
|
||||||
Feature: Choosing fastest route
|
Feature: Choosing fastest route
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@routing
|
@routing @testbot
|
||||||
Feature: Retrieve geometry
|
Feature: Retrieve geometry
|
||||||
|
|
||||||
Background: Use some profile
|
Background: Use some profile
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@routing @graph
|
@routing @graph @testbot
|
||||||
Feature: Basic Routing
|
Feature: Basic Routing
|
||||||
#Test the input data descibed on https://github.com/DennisOSRM/Project-OSRM/wiki/Graph-representation
|
#Test the input data descibed on https://github.com/DennisOSRM/Project-OSRM/wiki/Graph-representation
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@routing @726
|
@routing @726 @testbot
|
||||||
Feature: Avoid weird loops caused by rounding errors
|
Feature: Avoid weird loops caused by rounding errors
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@routing @origin
|
@routing @origin @testbot
|
||||||
Feature: Routing close to the [0,0] origin
|
Feature: Routing close to the [0,0] origin
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@routing @penalty @signal
|
@routing @penalty @signal @testbot
|
||||||
Feature: Penalties
|
Feature: Penalties
|
||||||
# Testbot uses a signal penalty of 7s.
|
# Testbot uses a signal penalty of 7s.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@routing @planetary
|
@routing @planetary @testbot
|
||||||
Feature: Distance calculation
|
Feature: Distance calculation
|
||||||
|
|
||||||
Scenario: Approximated Longitudinal distances at equator
|
Scenario: Approximated Longitudinal distances at equator
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@routing @projection
|
@routing @projection @testbot
|
||||||
Feature: Projection to nearest point on road
|
Feature: Projection to nearest point on road
|
||||||
# Waypoints are projected perpendiculary onto the closest road
|
# Waypoints are projected perpendiculary onto the closest road
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@routing @pbf
|
@routing @pbf @testbot
|
||||||
Feature: Importing protobuffer (.pbf) format
|
Feature: Importing protobuffer (.pbf) format
|
||||||
# Test normally read .osm, which is faster than .pbf files,
|
# Test normally read .osm, which is faster than .pbf files,
|
||||||
# since we don't need to use osmosis to first convert to .pbf
|
# since we don't need to use osmosis to first convert to .pbf
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@routing @snap
|
@routing @snap @testbot
|
||||||
Feature: Snap start/end point to the nearest way
|
Feature: Snap start/end point to the nearest way
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@routing @status
|
@routing @status @testbot
|
||||||
Feature: Status messages
|
Feature: Status messages
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@routing @time
|
@routing @time @testbot
|
||||||
Feature: Estimation of travel time
|
Feature: Estimation of travel time
|
||||||
# Testbot speeds:
|
# Testbot speeds:
|
||||||
# Primary road: 36km/h = 36000m/3600s = 100m/10s
|
# Primary road: 36km/h = 36000m/3600s = 100m/10s
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@routing @turns
|
@routing @turns @testbot
|
||||||
Feature: Turn directions/codes
|
Feature: Turn directions/codes
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@routing @utf
|
@routing @utf @testbot
|
||||||
Feature: Handling of UTF characters
|
Feature: Handling of UTF characters
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@routing @uturn @via
|
@routing @uturn @via @testbot
|
||||||
Feature: U-turns at via points
|
Feature: U-turns at via points
|
||||||
|
|
||||||
Background:
|
Background:
|
||||||
|
Loading…
Reference in New Issue
Block a user