Unit tests: snapping on out-and-back routes, off-route hysteresis #39
Labels
No labels
area:companion
area:docs
area:shared
area:tooling
area:watchapp
blocker
kind:chore
kind:feature
kind:spike
kind:test
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Depends on
#32 Off-route detection with hysteresis and auto-recovery
robert/PedalPebble
#31 Navigation engine: windowed snapping to the route polyline
robert/PedalPebble
#33 Next turn, then-turn, remaining distance and ETA
robert/PedalPebble
Reference
robert/PedalPebble#39
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
The navigation logic most likely to fail in a way that is confusing on the road.
Acceptance criteria
Files
companion/src/test/Audited this issue's 6 acceptance criteria against #31's
RouteSnapper(merged tonight as PR #114) and opened PR #116 with the real, missing test scope. Not closing this issue — real scope remains (see below), leaving that call to Robert.Already covered by
RouteSnapperTest(#31), verified non-superficial (tight tolerances):No near-duplicate tests added for these three.
Genuinely missing, now added in PR #116:
2. Lollipop and self-crossing routes. This surfaced a real bug in
RouteSnapper, not just an untested case: on a route that crosses itself, ordinary GPS noise (3 m, well inside normal accuracy) near the crossing could make the windowed search jump the cursor irrecoverably to a much later, chronologically-wrong visit of the same physical point. Reproduced concretely on an 8 m half-size figure-eight; fixed with a two-phase search inRouteSnapper.snap()that is verified to change nothing on any previously-covered path (full existing test suite + real-komoot fixture pass unchanged) while closing the gap. A lollipop fixture is also added and confirmed to already track correctly without needing the fix.Out of this issue's honest scope, not fabricated, dependency edges added instead:
4. Off-route enter/exit hysteresis at the thresholds — belongs to #32, which is separate and still open.
RouteSnapperdeliberately only reports a raw offset for #32 to build hysteresis on; there is noOffRouteDetector.ktin the repo yet. #39 now depends on #32.6. Distance-to-turn and ETA against hand-computed values — belongs to #33 ("Next turn, then-turn, remaining distance and ETA"), also separate and open, targeting a
NavEngine.ktthat doesn't exist yet. The pieces it would combine (Cue.distanceAlongRouteMeters,RouteSnap.distanceAlongRouteMeters) both already exist independently, but nothing combines them yet, and no ETA logic exists anywhere. #39 now depends on #33.PR: #116. Real
./gradlew :companion:core:test --rerun-tasksandkoverVerifyboth green.PR #116 merged. Independently re-verified the claimed bug fix before merging: reverted just
RouteSnapper.kt's two-phase-search change (keeping the new tests), re-ran./gradlew :companion:core:test --tests "*RouteSnapperTest*"— the new figure-eight test genuinely fails against the pre-fix code, confirming this is a real bug catch, not a test written to match already-correct behaviour. Restored the fix, full:companion:core:testsuite green again.Leaving this issue open as Sentinel recommended — real scope remains on #32 and #33, now correctly tracked as dependencies. Will pick those up as separate issues in due course.