From 76d841c72bd5650ee168ef76148d6f5f552d8e41 Mon Sep 17 00:00:00 2001 From: andig Date: Thu, 9 Oct 2025 11:15:52 +0200 Subject: [PATCH] chore: fix profile test --- core/site_optimizer_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/site_optimizer_test.go b/core/site_optimizer_test.go index 2ea2b78bc..3f397bd35 100644 --- a/core/site_optimizer_test.go +++ b/core/site_optimizer_test.go @@ -9,6 +9,7 @@ import ( "github.com/evcc-io/evcc/core/loadpoint" "github.com/evcc-io/evcc/core/metrics" "github.com/evcc-io/evcc/server/db" + "github.com/jinzhu/now" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" ) @@ -51,6 +52,9 @@ func TestSqliteTimestamp(t *testing.T) { func TestUpdateHouseholdProfile(t *testing.T) { clock := clock.NewMock() + // make sure test data added starting 00:00 local time + clock.Set(now.With(clock.Now()).BeginningOfDay()) + require.NoError(t, db.NewInstance("sqlite", ":memory:")) metrics.Init()