From 879de346ea66f09042f48e6d3e89c8965442fb26 Mon Sep 17 00:00:00 2001 From: Michael Krasnyk Date: Fri, 2 Jun 2017 17:08:52 +0200 Subject: [PATCH] Add timezone names customization in tests --- features/car/conditional_restrictions.feature | 88 +++++++++---------- features/support/env.js | 1 + features/support/run.js | 3 +- 3 files changed, 47 insertions(+), 45 deletions(-) diff --git a/features/car/conditional_restrictions.feature b/features/car/conditional_restrictions.feature index 2cf42e81953..baed5ba3a4d 100644 --- a/features/car/conditional_restrictions.feature +++ b/features/car/conditional_restrictions.feature @@ -13,8 +13,8 @@ Feature: Car - Turn restrictions Scenario: Car - ignores unrecognized restriction Given the extract extra arguments "--parse-conditional-restrictions" # time stamp for 10am on Tues, 02 May 2017 GMT - Given the contract extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" - Given the customize extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the node map """ n @@ -43,8 +43,8 @@ Feature: Car - Turn restrictions Scenario: Car - Restriction would be on, but the restriction was badly tagged Given the extract extra arguments "--parse-conditional-restrictions" # time stamp for 10am on Tues, 02 May 2017 GMT - Given the contract extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" - Given the customize extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the node map """ @@ -76,8 +76,8 @@ Feature: Car - Turn restrictions Scenario: Car - ignores except restriction Given the extract extra arguments "--parse-conditional-restrictions" # time stamp for 10am on Tues, 02 May 2017 GMT - Given the contract extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" - Given the customize extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the node map """ n @@ -108,8 +108,8 @@ Feature: Car - Turn restrictions Scenario: Car - only_right_turn Given the extract extra arguments "--parse-conditional-restrictions" # time stamp for 10am on Tues, 02 May 2017 GMT - Given the contract extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" - Given the customize extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the node map """ n @@ -138,8 +138,8 @@ Feature: Car - Turn restrictions Scenario: Car - No right turn Given the extract extra arguments "--parse-conditional-restrictions" # time stamp for 10am on Tues, 02 May 2017 GMT - Given the contract extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" - Given the customize extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the node map """ n @@ -168,8 +168,8 @@ Feature: Car - Turn restrictions Scenario: Car - only_left_turn Given the extract extra arguments "--parse-conditional-restrictions" # time stamp for 10am on Tues, 02 May 2017 GMT - Given the contract extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" - Given the customize extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the node map """ n @@ -198,8 +198,8 @@ Feature: Car - Turn restrictions Scenario: Car - No left turn Given the extract extra arguments "--parse-conditional-restrictions" # time stamp for 10am on Tues, 02 May 2017 GMT - Given the contract extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" - Given the customize extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the node map """ n @@ -228,8 +228,8 @@ Feature: Car - Turn restrictions Scenario: Car - Conditional restriction is off Given the extract extra arguments "--parse-conditional-restrictions" # time stamp for 10am on Tues, 02 May 2017 GMT - Given the contract extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" - Given the customize extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the node map """ n @@ -258,8 +258,8 @@ Feature: Car - Turn restrictions Scenario: Car - Conditional restriction is on Given the extract extra arguments "--parse-conditional-restrictions" # 10am utc, wed - Given the contract extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493805600" - Given the customize extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493805600" + Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493805600" + Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493805600" Given the node map """ n @@ -288,8 +288,8 @@ Feature: Car - Turn restrictions Scenario: Car - Conditional restriction with multiple time windows Given the extract extra arguments "--parse-conditional-restrictions" # 5pm Wed 02 May, 2017 GMT - Given the contract extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493744400" - Given the customize extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493744400" + Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493744400" + Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493744400" Given the node map """ @@ -321,8 +321,8 @@ Feature: Car - Turn restrictions Scenario: Car - only_right_turn Given the extract extra arguments "--parse-conditional-restrictions" # time stamp for 10am on Tues, 02 May 2017 GMT - Given the contract extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" - Given the customize extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the node map """ n @@ -351,8 +351,8 @@ Feature: Car - Turn restrictions Scenario: Car - No right turn Given the extract extra arguments "--parse-conditional-restrictions" # time stamp for 10am on Tues, 02 May 2017 GMT - Given the contract extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" - Given the customize extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the node map """ n @@ -381,8 +381,8 @@ Feature: Car - Turn restrictions Scenario: Car - only_left_turn Given the extract extra arguments "--parse-conditional-restrictions" # time stamp for 10am on Tues, 02 May 2017 GMT - Given the contract extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" - Given the customize extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the node map """ n @@ -411,8 +411,8 @@ Feature: Car - Turn restrictions Scenario: Car - No left turn Given the extract extra arguments "--parse-conditional-restrictions" # time stamp for 10am on Tues, 02 May 2017 GMT - Given the contract extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" - Given the customize extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the node map """ n @@ -441,8 +441,8 @@ Feature: Car - Turn restrictions Scenario: Car - Conditional restriction is off Given the extract extra arguments "--parse-conditional-restrictions" # time stamp for 10am on Tues, 02 May 2017 GMT - Given the contract extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" - Given the customize extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" + Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493719200" Given the node map """ n @@ -471,8 +471,8 @@ Feature: Car - Turn restrictions Scenario: Car - Conditional restriction is on Given the extract extra arguments "--parse-conditional-restrictions" # 10am utc, wed - Given the contract extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493805600" - Given the customize extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493805600" + Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493805600" + Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493805600" Given the node map """ n @@ -501,8 +501,8 @@ Feature: Car - Turn restrictions Scenario: Car - Conditional restriction with multiple time windows Given the extract extra arguments "--parse-conditional-restrictions" # 5pm Wed 02 May, 2017 GMT - Given the contract extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493744400" - Given the customize extra arguments "--time-zone-file=test/data/tz/win/guinea.geojson --parse-conditionals-from-now=1493744400" + Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493744400" + Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/guinea.geojson --parse-conditionals-from-now=1493744400" Given the node map """ @@ -535,8 +535,8 @@ Feature: Car - Turn restrictions Scenario: Car - DC North capitol situation, two on one off Given the extract extra arguments "--parse-conditional-restrictions=1" # 9pm Wed 02 May, 2017 UTC, 5pm EDT - Given the contract extra arguments "--time-zone-file=test/data/tz/win/dc.geojson --parse-conditionals-from-now=1493845200" - Given the customize extra arguments "--time-zone-file=test/data/tz/win/dc.geojson --parse-conditionals-from-now=1493845200" + Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/dc.geojson --parse-conditionals-from-now=1493845200" + Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/dc.geojson --parse-conditionals-from-now=1493845200" # """ # a h @@ -582,8 +582,8 @@ Feature: Car - Turn restrictions Scenario: Car - DC North capitol situation, one on two off Given the extract extra arguments "--parse-conditional-restrictions=1" # 10:30am utc, wed, 6:30am est - Given the contract extra arguments "--time-zone-file=test/data/tz/win/dc.geojson --parse-conditionals-from-now=1493807400" - Given the customize extra arguments "--time-zone-file=test/data/tz/win/dc.geojson --parse-conditionals-from-now=1493807400" + Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/dc.geojson --parse-conditionals-from-now=1493807400" + Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/dc.geojson --parse-conditionals-from-now=1493807400" # """ # a h @@ -630,8 +630,8 @@ Feature: Car - Turn restrictions # same test as the following one, but given a different time zone file Given the extract extra arguments "--parse-conditional-restrictions" # 9am UTC, 10am BST - Given the contract extra arguments "--time-zone-file=test/data/tz/win/dc.geojson --parse-conditionals-from-now=1493802000" - Given the customize extra arguments "--time-zone-file=test/data/tz/win/dc.geojson --parse-conditionals-from-now=1493802000" + Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/dc.geojson --parse-conditionals-from-now=1493802000" + Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/dc.geojson --parse-conditionals-from-now=1493802000" # """ # a @@ -668,8 +668,8 @@ Feature: Car - Turn restrictions Scenario: Car - Somewhere in london, the UK, GMT timezone Given the extract extra arguments "--parse-conditional-restrictions" # 9am UTC, 10am BST - Given the contract extra arguments "--time-zone-file=test/data/tz/win/london.geojson --parse-conditionals-from-now=1493802000" - Given the customize extra arguments "--time-zone-file=test/data/tz/win/london.geojson --parse-conditionals-from-now=1493802000" + Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/london.geojson --parse-conditionals-from-now=1493802000" + Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/london.geojson --parse-conditionals-from-now=1493802000" # """ # a @@ -706,8 +706,8 @@ Feature: Car - Turn restrictions Scenario: Car - Somewhere in London, the UK, GMT timezone Given the extract extra arguments "--parse-conditional-restrictions=1" # 9am UTC, 10am BST - Given the contract extra arguments "--time-zone-file=test/data/tz/win/london.geojson --parse-conditionals-from-now=1493802000" - Given the customize extra arguments "--time-zone-file=test/data/tz/win/london.geojson --parse-conditionals-from-now=1493802000" + Given the contract extra arguments "--time-zone-file=test/data/tz/{timezone_names}/london.geojson --parse-conditionals-from-now=1493802000" + Given the customize extra arguments "--time-zone-file=test/data/tz/{timezone_names}/london.geojson --parse-conditionals-from-now=1493802000" # """ # a diff --git a/features/support/env.js b/features/support/env.js index 36f8e065c34..5947afffacd 100644 --- a/features/support/env.js +++ b/features/support/env.js @@ -40,6 +40,7 @@ module.exports = function () { this.DEFAULT_GRID_SIZE = 100; // meters // get algorithm name from the command line profile argument this.ROUTING_ALGORITHM = process.argv[process.argv.indexOf('-p') + 1].match('mld') ? 'MLD' : 'CH'; + this.TIMEZONE_NAMES = this.PLATFORM_WINDOWS ? 'win' : 'iana'; this.OSRM_PORT = process.env.OSRM_PORT && parseInt(process.env.OSRM_PORT) || 5000; this.HOST = 'http://127.0.0.1:' + this.OSRM_PORT; diff --git a/features/support/run.js b/features/support/run.js index 2b4408f7510..f65a17fe15b 100644 --- a/features/support/run.js +++ b/features/support/run.js @@ -15,7 +15,8 @@ module.exports = function () { '{profile_file}': this.profileFile, '{rastersource_file}': this.rasterCacheFile, '{speeds_file}': this.speedsCacheFile, - '{penalties_file}': this.penaltiesCacheFile + '{penalties_file}': this.penaltiesCacheFile, + '{timezone_names}': this.TIMEZONE_NAMES }; for (let k in table) {