gtfs-validator icon indicating copy to clipboard operation
gtfs-validator copied to clipboard

Enable testing against entities in csv format

Open lionel-nj opened this issue 4 years ago • 3 comments

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

lionel-nj avatar Nov 08 '21 14:11 lionel-nj

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.

barbeau avatar Nov 08 '21 18:11 barbeau

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

lionel-nj avatar Nov 18 '21 15:11 lionel-nj

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

barbeau avatar Mar 22 '22 14:03 barbeau