diff --git a/.github/workflows/astro.yml b/.github/workflows/astro.yml index f123cfc..71ee903 100644 --- a/.github/workflows/astro.yml +++ b/.github/workflows/astro.yml @@ -24,8 +24,8 @@ jobs: uses: withastro/action@v4 with: path: ./docs # The root location of your Astro project inside the repository. (optional) - # node-version: 22 # The specific version of Node that should be used to build your site. Defaults to 22. (optional) - package-manager: yarn@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional) + node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 22. (optional) + package-manager: yarn@1.22.22 # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional) deploy: needs: build diff --git a/internal/db/psql/listen_activity_test.go b/internal/db/psql/listen_activity_test.go index ccfdfe5..1041823 100644 --- a/internal/db/psql/listen_activity_test.go +++ b/internal/db/psql/listen_activity_test.go @@ -17,6 +17,7 @@ func flattenListenCounts(items []db.ListenActivityItem) []int64 { return ret } +// TODO: This test has some inherent flakiness due to local time possibly crossing day boundaries with UTC func TestListenActivity(t *testing.T) { truncateTestData(t) @@ -130,8 +131,8 @@ func TestListenActivity(t *testing.T) { err = store.Exec(context.Background(), ` INSERT INTO listens (user_id, track_id, listened_at) - VALUES (1, 1, DATE '2024-03-10'), - (1, 2, DATE '2024-03-20')`) + VALUES (1, 1, TIMESTAMP WITH TIME ZONE '2024-03-10T12:00:00Z'), + (1, 2, TIMESTAMP WITH TIME ZONE '2024-03-20T12:00:00Z')`) require.NoError(t, err) activity, err = store.GetListenActivity(ctx, db.ListenActivityOpts{ @@ -141,8 +142,9 @@ func TestListenActivity(t *testing.T) { }) require.NoError(t, err) require.Len(t, activity, 31) // number of days in march - assert.EqualValues(t, 1, activity[8].Listens) - assert.EqualValues(t, 1, activity[18].Listens) + t.Log(activity) + assert.EqualValues(t, 1, activity[9].Listens) + assert.EqualValues(t, 1, activity[19].Listens) // Truncate and insert listens associated with two different albums err = store.Exec(context.Background(), `TRUNCATE TABLE listens RESTART IDENTITY`)