diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index b8a79b0aeac..1a86cd9c333 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -23,8 +23,8 @@ jobs: sleep: 15 - name: houston sleep: 15 - - name: denver - sleep: 15 + #- name: denver + # sleep: 15 - name: septa sleep: 15 - name: portland diff --git a/pom.xml b/pom.xml index 468448b6bc0..229a053ddc4 100644 --- a/pom.xml +++ b/pom.xml @@ -971,7 +971,7 @@ org.opentripplanner otp-client - 0.0.20 + 0.0.23 test diff --git a/smoke-tests/atlanta/router-config.json b/smoke-tests/atlanta/router-config.json new file mode 100644 index 00000000000..fe4c160bd12 --- /dev/null +++ b/smoke-tests/atlanta/router-config.json @@ -0,0 +1,21 @@ +{ + "routingDefaults": { + "itineraryFilters": { + // add IBI accessibility score between 0 and 1 + "accessibilityScore": true + }, + // use stop and trip with unknown wheelchair accessibility during routing + "wheelchairAccessibility": { + "trip": { + "onlyConsiderAccessible": false, + "unknownCost": 600, + "inaccessibleCost": 3600 + }, + "stop": { + "onlyConsiderAccessible": false, + "unknownCost": 600, + "inaccessibleCost": 3600 + } + } + } +} diff --git a/smoke-tests/seattle/build-config.json b/smoke-tests/seattle/build-config.json index fed9ca170ad..2ab8a50787c 100644 --- a/smoke-tests/seattle/build-config.json +++ b/smoke-tests/seattle/build-config.json @@ -37,5 +37,16 @@ "feedId" : "monorail", "source" : "https://github.com/transitland/gtfs-archives-not-hosted-elsewhere/raw/master/seattlemonorail-wa-us.zip" } + ], + "transferRequests": [ + { + "modes": "WALK" + }, + { + "modes": "WALK", + "wheelchairAccessibility": { + "enabled": true + } + } ] } diff --git a/smoke-tests/seattle/router-config.json b/smoke-tests/seattle/router-config.json index 87e991fbd52..1d28a694b66 100644 --- a/smoke-tests/seattle/router-config.json +++ b/smoke-tests/seattle/router-config.json @@ -1,4 +1,21 @@ { + "routingDefaults": { + "itineraryFilters": { + "accessibilityScore": true + }, + "wheelchairAccessibility": { + "trip": { + "onlyConsiderAccessible": false, + "unknownCost": 600, + "inaccessibleCost": 3600 + }, + "stop": { + "onlyConsiderAccessible": false, + "unknownCost": 600, + "inaccessibleCost": 3600 + } + } + }, "updaters": [ { "type": "stop-time-updater", diff --git a/src/test/java/org/opentripplanner/smoketest/SeattleSmokeTest.java b/src/test/java/org/opentripplanner/smoketest/SeattleSmokeTest.java index a47e0265121..761c1466aa6 100644 --- a/src/test/java/org/opentripplanner/smoketest/SeattleSmokeTest.java +++ b/src/test/java/org/opentripplanner/smoketest/SeattleSmokeTest.java @@ -1,6 +1,8 @@ package org.opentripplanner.smoketest; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.opentripplanner.client.model.RequestMode.BUS; import static org.opentripplanner.client.model.RequestMode.FLEX_ACCESS; import static org.opentripplanner.client.model.RequestMode.FLEX_DIRECT; @@ -18,6 +20,7 @@ import org.opentripplanner.client.model.Coordinate; import org.opentripplanner.client.model.LegMode; import org.opentripplanner.client.model.Route; +import org.opentripplanner.client.parameters.TripPlanParametersBuilder; import org.opentripplanner.smoketest.util.SmokeTestRequest; @Tag("smoke-test") @@ -44,6 +47,28 @@ public void acrossTheCity() { SmokeTest.assertThatAllTransitLegsHaveFareProducts(plan); } + @Test + public void accessibleRouting() throws IOException { + var req = new TripPlanParametersBuilder() + .withFrom(sodo) + .withTo(clydeHill) + .withTime(SmokeTest.weekdayAtNoon()) + .withWheelchair(true) + .build(); + + var tripPlan = SmokeTest.API_CLIENT.plan(req); + + assertFalse(tripPlan.transitItineraries().isEmpty()); + + // assert that accessibility score is there + tripPlan + .itineraries() + .forEach(i -> { + assertTrue(i.accessibilityScore().isPresent()); + i.legs().forEach(l -> assertTrue(l.accessibilityScore().isPresent())); + }); + } + @Test public void flexAndTransit() { var modes = Set.of(WALK, BUS, FLEX_DIRECT, FLEX_EGRESS, FLEX_ACCESS); diff --git a/src/test/java/org/opentripplanner/smoketest/SmokeTest.java b/src/test/java/org/opentripplanner/smoketest/SmokeTest.java index e61bfe9f96e..1319e7f8fd9 100644 --- a/src/test/java/org/opentripplanner/smoketest/SmokeTest.java +++ b/src/test/java/org/opentripplanner/smoketest/SmokeTest.java @@ -6,6 +6,7 @@ import java.io.IOException; import java.time.DayOfWeek; import java.time.LocalDate; +import java.time.LocalDateTime; import java.time.LocalTime; import java.time.ZoneId; import java.time.temporal.TemporalAdjusters; @@ -46,9 +47,9 @@ public class SmokeTest { * This is a problem in particular in the case of MARTA as they only publish new data about 2 days * before the expiration date of the old one. */ - public static LocalDate nextMonday() { + public static LocalDateTime weekdayAtNoon() { var today = LocalDate.now(); - return today.with(TemporalAdjusters.next(DayOfWeek.FRIDAY)); + return today.with(TemporalAdjusters.next(DayOfWeek.FRIDAY)).atTime(LocalTime.of(12, 0)); } public static void assertThatThereAreVehicleRentalStations() { @@ -86,7 +87,7 @@ static TripPlan basicRouteTest(SmokeTestRequest req, List expectedModes) .withFrom(req.from()) .withTo(req.to()) .withModes(req.modes()) - .withTime(SmokeTest.nextMonday().atTime(LocalTime.of(12, 0))) + .withTime(SmokeTest.weekdayAtNoon()) .withSearchDirection(req.searchDirection()) .build(); var plan = API_CLIENT.plan(tpr);