aboutsummaryrefslogtreecommitdiff
path: root/ride/store_test.go
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-08-24 12:07:30 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-08-24 12:07:30 +0200
commita9a384972649182c188396c5f996ae617d35188a (patch)
treedc5d317d33643629acb605137626eba920b0ba18 /ride/store_test.go
parent3646cc0d06d077a4881b611ac845c3a6ee6dd54d (diff)
Add progress bars to the long-running CLI processes (backtest, backfill, extract-osm)
Diffstat (limited to 'ride/store_test.go')
-rw-r--r--ride/store_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/ride/store_test.go b/ride/store_test.go
index 877f4e5..89c4830 100644
--- a/ride/store_test.go
+++ b/ride/store_test.go
@@ -197,6 +197,20 @@ func TestBackfill(t *testing.T) {
assert.Equal(t, 1, count)
}
+func TestBackfillReportsProgress(t *testing.T) {
+ db := newTestDB(t)
+ require.NoError(t, Save(db, sampleRide(t)))
+
+ var calls [][2]int
+ count, err := Backfill(db, func(current, total int) {
+ calls = append(calls, [2]int{current, total})
+ })
+ require.NoError(t, err)
+ assert.Equal(t, 1, count)
+ require.Len(t, calls, 1)
+ assert.Equal(t, [2]int{1, 1}, calls[0])
+}
+
func TestBackfillSkipsInvalidRide(t *testing.T) {
db := newTestDB(t)
_, err := db.Exec(`