Conversation
There was a problem hiding this comment.
Pull request overview
This pull request migrates entity validation tests from a CSV-based approach to direct Go unit tests. The old approach used CSV files with test data in testdata/gtfs-examples/bad-entities/ and a generic TestEntityErrors function to iterate over them. The new approach creates individual *_test.go files for each GTFS entity type with table-driven tests that construct entities programmatically and validate their error conditions.
Key Changes:
- Removed the old CSV-based test infrastructure (
TestEntityErrorsfunction and entirebad-entitiesdirectory) - Added 25+ new test files covering entity validation (trips, stops, routes, fares, calendars, etc.)
- Enhanced entity implementations with proper field validation (added
requiredtags,ConditionalErrorsmethods)
Reviewed changes
Copilot reviewed 67 out of 67 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| validator/validator_test.go | Removed TestEntityErrors function and unused imports (fmt, testreader) |
| testdata/gtfs-examples/bad-entities/* | Deleted entire directory containing CSV-based test data files |
| gtfs/trip_test.go | Added unit tests for Trip entity error validation |
| gtfs/translation_test.go | Added unit tests for Translation entity error validation |
| gtfs/transfer_test.go | Added unit tests for Transfer entity error validation |
| gtfs/timeframe_test.go | Added unit tests for Timeframe entity error validation |
| gtfs/timeframe.go | Added required field tags and ConditionalErrors method |
| gtfs/stop_time_test.go | Added additional test cases for StopTime validation |
| gtfs/stop_test.go | Added comprehensive unit tests for Stop entity validation |
| gtfs/stop_area_test.go | Added unit tests for StopArea entity validation |
| gtfs/shape_test.go | Added unit tests for Shape entity error validation |
| gtfs/shape.go | Enhanced with explicit required field checks |
| gtfs/route_test.go | Added unit tests for Route entity error validation |
| gtfs/route_network_test.go | Added unit tests for RouteNetwork entity validation |
| gtfs/route_network.go | Added required field tags |
| gtfs/rider_category_test.go | Added unit tests for RiderCategory entity validation |
| gtfs/pathway_test.go | Added unit tests for Pathway entity error validation |
| gtfs/network_test.go | Added unit tests for Network entity validation |
| gtfs/network.go | Added required field tag for NetworkID |
| gtfs/location_test.go | Added unit tests for Location entity validation |
| gtfs/level_test.go | Added unit tests for Level entity validation |
| gtfs/gtfs_flex_test.go | Removed old flex tests (replaced by new specific tests) |
| gtfs/frequency_test.go | Added unit tests for Frequency entity error validation |
| gtfs/feed_info_test.go | Added unit tests for FeedInfo entity error validation |
| gtfs/fare_transfer_rule_test.go | Added unit tests for FareTransferRule validation |
| gtfs/fare_rule_test.go | Added unit tests for FareRule entity validation |
| gtfs/fare_product_test.go | Added unit tests for FareProduct entity validation |
| gtfs/fare_media_test.go | Added unit tests for FareMedia entity validation |
| gtfs/fare_leg_rule_test.go | Added unit tests for FareLegRule entity validation |
| gtfs/fare_attribute_test.go | Added unit tests for FareAttribute entity validation |
| gtfs/calendar_test.go | Added unit tests for Calendar entity error validation |
| gtfs/calendar_date_test.go | Added unit tests for CalendarDate entity validation |
| gtfs/booking_rule_test.go | Added bidirectional validation tests for BookingRule |
| gtfs/booking_rule.go | Enhanced with bidirectional field validation logic |
| gtfs/attribution_test.go | Added unit tests for Attribution entity error validation |
| gtfs/area_test.go | Added unit tests for Area entity validation |
| gtfs/agency_test.go | Added unit tests for Agency entity error validation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 67 out of 67 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.