fix: assert ParentStation in TestSearchStopsByName#385
Merged
aaronbrethorst merged 1 commit intoOneBusAway:mainfrom Feb 18, 2026
Merged
fix: assert ParentStation in TestSearchStopsByName#385aaronbrethorst merged 1 commit intoOneBusAway:mainfrom
aaronbrethorst merged 1 commit intoOneBusAway:mainfrom
Conversation
aaronbrethorst
approved these changes
Feb 18, 2026
Member
aaronbrethorst
left a comment
There was a problem hiding this comment.
Sharp catch, Bhupesh — a silently skipped field in a hand-maintained SQL scan is exactly the kind of gap that leads to subtle regressions. Good defensive testing.
What Changed
- Added
assert.False(t, r.ParentStation.Valid)to the existing "returns all fields correctly" subtest, covering the NULL case and completing coverage of all 9SearchStopsByNameRowfields. - Added a new "reads non-null parent_station correctly" subtest that sets
parent_stationvia raw SQL UPDATE, asserts the scan reads it, and defers cleanup to reset to NULL for test isolation.
Review
No issues found. The test is well-structured: the defer cleanup maintains isolation for subsequent subtests, the NULL and non-NULL cases are both covered, and the approach of using a raw SQL UPDATE to test the scan without modifying shared fixture setup is pragmatic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #377
Summary
The "returns all fields correctly" subtest of
TestSearchStopsByNameingtfsdb/fts_queries_test.goasserted 8 of 9 fields returned bySearchStopsByNameRow, silently skippingParentStation. Becausefts_queries.gois hand-maintained SQL (not sqlc-generated), columnscan order can drift without detection.
assert.False(t, r.ParentStation.Valid)to the existing"returns all fields correctly" subtest, covering the NULL case for
stop s1 (which has no parent_station set).
sets
parent_station = 'hub1'via a raw SQL UPDATE, verifies thescan reads it correctly, then resets it to NULL so other subtests
are unaffected.
Test plan
make testpassesmake lintpasses