Isolate CI database journey and stabilize E2E dependency cache
ci / module boundaries / boundaries (push) Successful in 7s
ci / db / db (push) Failing after 29s
ci / api / api (push) Successful in 52s
ci / ts / ts (packages + web) (push) Successful in 4m22s

This commit is contained in:
mrleo1nid committed 2026-10-30 11:05:13 +03:00
1 parent 82bf015283
commit bbd629dcf8
3 files changed
+45 -4

No files matched your search

@@ -25,16 +25,18 @@ func TestUploadedArtistPortraitStagingLifetime(t *testing.T) {
ctx := context.Background()
pool, err := db.Connect(ctx, address)
require.NoError(t, err)
defer pool.Close()
t.Cleanup(pool.Close)
require.NoError(t, db.Migrate(ctx, pool))
store := NewStore(pool)
author := uuid.New()
_, err = pool.Exec(ctx, `INSERT INTO users(id,username,password_hash,role) VALUES($1,$2,'x','admin')`, author, "portrait-"+author.String())
require.NoError(t, err)
t.Cleanup(func() {
_, _ = pool.Exec(ctx, `DELETE FROM upload_batches WHERE author_id=$1`, author)
_, _ = pool.Exec(ctx, `DELETE FROM users WHERE id=$1`, author)
_ = store.ReconcileQuota(ctx)
_, err := pool.Exec(ctx, `DELETE FROM upload_batches WHERE author_id=$1`, author)
require.NoError(t, err)
_, err = pool.Exec(ctx, `DELETE FROM users WHERE id=$1`, author)
require.NoError(t, err)
require.NoError(t, store.ReconcileQuota(ctx))
})
svc := NewService(store, nil, nil, nil, nil, nil, library.FPCalc{}, Config{StagingDir: t.TempDir()}, slog.New(slog.DiscardHandler))
owner := auth.WithPrincipal(ctx, auth.Principal{UserID: author, Role: auth.RoleAdmin})