Compare commits

..

4 Commits

Author SHA1 Message Date
Patrick Niklaus 8f6fc0146b Merge branch 'develop' 2015-09-20 13:30:19 +02:00
Freenerd e1ac1c4fdc Test that alternative route exists
Complement to a6b44a1470
2015-09-18 17:30:53 +02:00
Daniel Patterson a6b44a1470 Revert alternative instructions array nesting to previous behaviour. 2015-09-17 09:06:51 -07:00
Daniel J. Hofmann e8834a68f3 Script for fully automated test bisecting.
Automate cucumber tests bisecting by providing a `git bisect` script.

Because it is stored in source control, but bisecting changes the HEAD,
it is advised to first copy over the script to a place outside source
control, e.g. `/tmp`.

Usage:

    git bisect start HEAD HEAD~10
    bit bisect run /tmp/bisect_cucumber.sh

This automatically configures and builds OSRM, spawns the cucumber tests
and communicates with `git bisect` based on its return code.

Reference:

- man git-bisect
2015-09-16 19:13:31 +02:00
4 changed files with 57 additions and 1 deletions
+1 -1
View File
@@ -214,7 +214,7 @@ template <class DataFacadeT> class JSONDescriptor final : public BaseDescriptor<
osrm::json::Array json_current_alt_instructions;
if (config.instructions)
{
json_alt_instructions = BuildTextualDescription(alternate_description_factory, alternative_path_segments);
json_current_alt_instructions = BuildTextualDescription(alternate_description_factory, alternative_path_segments);
json_alt_instructions.values.push_back(json_current_alt_instructions);
json_result.values["alternative_instructions"] = json_alt_instructions;
}
+4
View File
@@ -82,6 +82,10 @@ When /^I route I should get$/ do |table|
end
if table.headers.include? 'route'
got['route'] = (instructions || '').strip
if table.headers.include?('alternative')
raise "*** No alternative found ***" unless json['found_alternative']
got['alternative'] = way_list json['alternative_instructions'].first
end
if table.headers.include?('distance')
if row['distance']!=''
raise "*** Distance must be specied in meters. (ex: 250m)" unless row['distance'] =~ /\d+m/
+25
View File
@@ -52,6 +52,31 @@ Feature: Via points
| a,c,f | ab,bcd,bcd,de,efg |
| a,c,f,h | ab,bcd,bcd,de,efg,efg,gh |
Scenario: Alternative via points
Given the node map
| | b | c | d | | |
| a | | | | | z |
| | g | h | i | j | |
And the ways
| nodes |
| ab |
| bc |
| cd |
| dz |
| ag |
| gh |
| hi |
| ij |
| jz |
And the query options
| alt | true |
When I route I should get
| waypoints | route | alternative |
| a,z | ab,bc,cd,dz | ag,gh,hi,ij,jz |
Scenario: Duplicate via point
Given the node map
| x | | | | | |
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Automates bisecting cucumber tests in a portable way; usage:
#
# git bisect start GOODGITSHA BADGITSHA
# git bisect run /path/to/bisect_cucumber.sh
#
# XXX: store this file outside source control first, e.g. by copying it over
# to /tmp, otherwise jumping through commits will change this script, too.
# e: exit on first error, x: print commands
set -ex
BUILD_DIR=build
cmake -E remove_directory $BUILD_DIR
cmake -E make_directory $BUILD_DIR
cmake -E chdir $BUILD_DIR cmake .. -DCMAKE_BUILD_TYPE=Release
cmake -E chdir $BUILD_DIR cmake --build .
cucumber -p verify
# notes on the return codes git bisect understands:
# - exit code 0 means okay
# - exit code 125 means skip this commit and try a commit nearby
# - every other exit code means bad