From a9a384972649182c188396c5f996ae617d35188a Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Mon, 24 Aug 2026 12:07:30 +0200 Subject: Add progress bars to the long-running CLI processes (backtest, backfill, extract-osm) --- ride/store_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ride/store_test.go') 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(` -- cgit v1.3