Skip to content

Commit

Permalink
refactor(Various changes to get GraphQL unit tests to pass):
Browse files Browse the repository at this point in the history
  • Loading branch information
br648 committed May 10, 2024
1 parent 61752ec commit e623aef
Show file tree
Hide file tree
Showing 19 changed files with 340 additions and 407 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,8 @@ public class GraphQLGtfsSchema {
// If it is not possible to join across all fetches (e.g. no matching id) an empty array
// will be returned.
new JDBCFetcher("pattern_stops", "stop_id", null, false),
// new JDBCFetcher("pattern_locations", "location_id", null, false),
// new JDBCFetcher("pattern_location_group_stops", "location_group_id", null, false),
new JDBCFetcher("pattern_locations", "location_id", null, false),
new JDBCFetcher("pattern_location_group_stops", "location_group_id", null, false),
new JDBCFetcher("patterns", "pattern_id")
)
)
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/conveyal/gtfs/GTFSFeedTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ void canDoRoundTripLoadAndWriteToFlexZipFile() throws IOException {
new FileTestCase(
"stop_times.txt",
new DataExpectation[]{
new DataExpectation("trip_id", "a30277f8-e50a-4a85-9141-b1e0da9d429d"),
new DataExpectation("trip_id", "flex-a30277f8-e50a-4a85-9141-b1e0da9d429d"),
new DataExpectation("departure_time", "07:00:00"),
new DataExpectation("stop_id", "4u6g")
}
Expand All @@ -200,7 +200,7 @@ void canDoRoundTripLoadAndWriteToFlexZipFile() throws IOException {
"trips.txt",
new DataExpectation[]{
new DataExpectation("route_id", "1"),
new DataExpectation("trip_id", "a30277f8-e50a-4a85-9141-b1e0da9d429d"),
new DataExpectation("trip_id", "flex-a30277f8-e50a-4a85-9141-b1e0da9d429d"),
new DataExpectation("service_id", "04100312-8fe1-46a5-a9f2-556f39478f57")
}
)
Expand Down
3 changes: 2 additions & 1 deletion src/test/resources/fake-agency-with-flex/calendar_dates.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
service_id,date,exception_type
04100312-8fe1-46a5-a9f2-556f39478f57,20170916,2
04100312-8fe1-46a5-a9f2-556f39478f57,20170916,2
calendar-date-service,20170917,1
2 changes: 1 addition & 1 deletion src/test/resources/fake-agency-with-flex/frequencies.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
trip_id,start_time,end_time,headway_secs,exact_times
frequency-trip,08:00:00,09:00:00,1800,0
flex-frequency-trip,08:00:00,09:00:00,1800,0
13 changes: 6 additions & 7 deletions src/test/resources/fake-agency-with-flex/stop_times.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
trip_id,arrival_time,departure_time,stop_id,stop_sequence,stop_headsign,pickup_type,drop_off_type,continuous_pickup,continuous_drop_off,shape_dist_traveled,timepoint,pickup_booking_rule_id,drop_off_booking_rule_id,start_pickup_drop_off_window,end_pickup_drop_off_window
a30277f8-e50a-4a85-9141-b1e0da9d429d,07:00:00,07:00:00,4u6g,1,Test stop headsign,0,0,1,1,0.0000000,1,"1","1",07:00:00,07:00:00
a30277f8-e50a-4a85-9141-b1e0da9d429d,07:01:00,07:01:00,johv,2,Test stop headsign 2,0,0,1,1,341.4491961,1,"1","1",07:01:00,07:01:00
frequency-trip,08:00:00,08:00:00,4u6g,1,Test stop headsign frequency trip,0,0,1,1,0.0000000,1,"1","1",07:02:00,07:02:00
frequency-trip,08:29:00,08:29:00,1234,2,Test stop headsign frequency trip,0,0,1,1,341.4491961,1,"1","1",07:03:00,07:03:00
frequency-trip,08:31:00,08:31:00,area_251,3,,0,0,1,1,341.4491961,1,"1","1",07:03:00,07:03:00
frequency-trip,08:32:00,08:32:00,1,3,,0,0,1,1,341.4491961,1,"1","1",07:03:00,07:03:00

flex-a30277f8-e50a-4a85-9141-b1e0da9d429d,07:00:00,07:00:00,4u6g,1,Test stop headsign,0,0,1,1,0.0000000,1,"1","1",07:00:00,07:00:00
flex-a30277f8-e50a-4a85-9141-b1e0da9d429d,07:01:00,07:01:00,johv,2,Test stop headsign 2,0,0,1,1,341.4491961,1,"1","1",07:01:00,07:01:00
flex-frequency-trip,08:00:00,08:00:00,4u6g,1,Test stop headsign frequency trip,0,0,1,1,0.0000000,1,"1","1",07:02:00,07:02:00
flex-frequency-trip,08:29:00,08:29:00,1234,2,Test stop headsign frequency trip,0,0,1,1,341.4491961,1,"1","1",07:03:00,07:03:00
flex-calendar-date-trip,08:33:00,08:33:00,area_251,1,Test stop headsign calendar date trip,0,0,1,1,0.0000000,1,"1","1",07:00:00,07:00:00
flex-calendar-date-trip,08:34:00,08:34:00,1,2,Test stop headsign calendar date trip 2,0,0,1,1,0.0000000,1,"1","1",07:00:00,07:00:00
5 changes: 3 additions & 2 deletions src/test/resources/fake-agency-with-flex/trips.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
route_id,trip_id,trip_headsign,trip_short_name,direction_id,block_id,shape_id,bikes_allowed,wheelchair_accessible,service_id
1,a30277f8-e50a-4a85-9141-b1e0da9d429d,,,0,,5820f377-f947-4728-ac29-ac0102cbc34e,0,0,04100312-8fe1-46a5-a9f2-556f39478f57
1,frequency-trip,,,0,,5820f377-f947-4728-ac29-ac0102cbc34e,0,0,04100312-8fe1-46a5-a9f2-556f39478f57
1,flex-a30277f8-e50a-4a85-9141-b1e0da9d429d,,,0,,5820f377-f947-4728-ac29-ac0102cbc34e,0,0,04100312-8fe1-46a5-a9f2-556f39478f57
1,flex-frequency-trip,,,0,,5820f377-f947-4728-ac29-ac0102cbc34e,0,0,04100312-8fe1-46a5-a9f2-556f39478f57
1,flex-calendar-date-trip,,,0,,5820f377-f947-4728-ac29-ac0102cbc34e,0,0,calendar-date-service
1 change: 1 addition & 0 deletions src/test/resources/graphql/feedRowCounts.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ query($namespace: String) {
row_counts {
agency
calendar
calendar_dates
errors
routes
stops
Expand Down
Loading

0 comments on commit e623aef

Please sign in to comment.