fix: workflow + test

pull/20/head
Gabe Farrell 6 months ago
parent 57b172cf90
commit e3f4e959f4

@ -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

@ -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`)

Loading…
Cancel
Save