MobilityData / gtfs-validator

Canonical GTFS Validator project for schedule (static) files.
https://gtfs-validator.mobilitydata.org/
Apache License 2.0
287 stars 101 forks source link

Enable testing against entities in csv format #1052

Open lionel-nj opened 2 years ago

lionel-nj commented 2 years ago

Feature request

Is your feature request related to a problem? Please describe. As of now, in unit tests the logic of the auto generated code is repeated (behavior when parsing null values for example). If this auto generated code changes the tests similar to TimepointValidator will have to be written again. It is advisable to create a feature to test entities in CSV format.

Additional context https://github.com/MobilityData/gtfs-validator/pull/1044/files#r744334437

barbeau commented 2 years ago

FWIW, it looks like we do have some validation happening on CSV files, they are just dynamically generated:

https://github.com/MobilityData/gtfs-validator/blob/ff7c1f83a9e402f129edb2997ef29019b1163779/main/src/test/java/org/mobilitydata/gtfsvalidator/table/GtfsLevelTableLoaderTest.java#L69

But it looks like that's one of the few (if only) tests for the table loaders.

lionel-nj commented 2 years ago

Also to be considered: https://github.com/MobilityData/gtfs-validator/pull/1068#discussion_r751710647

barbeau commented 2 years ago

There are a number of test datasets here in the old Python validator that could potentially be reused: https://github.com/google/transitfeed/tree/master/tests/data

I've started tracking these (and other) test datasets on the awesome-transit list here: https://github.com/CUTR-at-USF/awesome-transit/blob/master/README.md#sample-gtfs-datasets-used-for-software-testing

I asked on the transit-developers Google Group if anyone knew of other test datasets - the thread is here: https://groups.google.com/g/transit-developers/c/lsxBFrrnzVE