osrm-backend/features/support/hooks.rb

36 lines
826 B
Ruby
Raw Normal View History

STRESS_TIMEOUT = 300
Before do |scenario|
2015-04-30 08:54:14 -04:00
# fetch scenario and feature name, so we can use it in log files if needed
2014-03-22 06:36:42 -04:00
case scenario
2015-04-30 08:54:14 -04:00
when Cucumber::RunningTestCase::Scenario
2014-03-22 06:36:42 -04:00
@feature_name = scenario.feature.name
@scenario_title = scenario.name
2015-04-30 08:54:14 -04:00
when Cucumber::RunningTestCase::ExampleRow
@feature_name = scenario.scenario_outline.feature.name
2014-03-22 06:36:42 -04:00
@scenario_title = scenario.scenario_outline.name
end
2015-04-30 08:54:14 -04:00
@load_method = DEFAULT_LOAD_METHOD
2015-12-08 17:00:11 -05:00
@query_params = []
@scenario_time = Time.now.strftime("%Y-%m-%dT%H:%m:%SZ")
reset_data
@has_logged_preprocess_info = false
@has_logged_scenario_info = false
2012-02-18 09:19:11 -05:00
set_grid_size DEFAULT_GRID_SIZE
2013-08-31 17:35:26 -04:00
set_origin DEFAULT_ORIGIN
end
Around('@stress') do |scenario, block|
2013-09-18 02:16:19 -04:00
Timeout.timeout(STRESS_TIMEOUT) do
block.call
end
end
After do
end