test(database): scope two pgTAP assertions to their own fixtures

Aperta Adatta ai principianti
#419 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
75/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
postgresql, sql
Ambito
databases, testing

Direzione di ricerca

Apri supabase/tests/database/15_project_pages.test.sql e leggi prima il test 6: seleziona ogni riga da public.project_pages, quindi deve essere filtrato sull'id del progetto che il test inserisce. Poi leggi il test 25 in supabase/tests/database/16_public_share_surfaces.test.sql e restringi la ricerca del contatore alle chiavi che quel test scrive. Esegui supabase test db su entrambi i file contro il tuo database locale popolato; fatto quando entrambi riportano zero fallimenti senza un reset.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: database bug priority: P3 size: S

Context

Against the shared local database (the one npm run dev uses), npm run test:db fails two assertions that read rows the database already holds rather than only the test's own fixtures:

  • 15_project_pages.test.sql test 6, "project_pages: creating projects creates no page": select project_id from public.project_pages is empty only on a fresh database.
  • 16_public_share_surfaces.test.sql test 25, "purge_public_rate_limit_counters: the current minute's counters are kept".

Found while verifying #414, whose migration touches neither object. A fresh database (CI) may well pass; a developer's local run does not, so the suite's result depends on what else is in the database.

Plan

Scope both assertions to the rows each test inserts (its own workspace or project ids, its own counter keys).

Acceptance criteria

  • Both files pass against a local database that holds other workspaces' project pages and rate limit counters
  • No e2e change needed: database tests only

Files and areas

supabase/tests/database/15_project_pages.test.sql, supabase/tests/database/16_public_share_surfaces.test.sql.

Verification

supabase test db supabase/tests/database/15_project_pages.test.sql supabase/tests/database/16_public_share_surfaces.test.sql -> currently 1 failure in each.


Model: anthropic/claude-opus-5-5 | Reasoning effort: not reported by the harness

Lingua principale
TypeScript
Stelle
1
Fork
1
Merge medio
6h 56m
PR unite (30g)
136

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eddiejaoude/StackDash

Tutte le issue di eddiejaoude/StackDash

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.