Stryker's vitest runner drops vitest.mutate.config.ts's testNamePattern, so the clock-face test it means to skip still runs

Aperta
#1,940 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
testing

Direzione di ricerca

Start by reading vitest.mutate.config.ts:13 and ui/src/model/events.test.ts:148, then inspect how the mutation run handles this test under worker threads. The issue points to @stryker-mutator/vitest-runner 10.1.1 overwriting testNamePattern; the reporter says they did not run Stryker. Reproduce the first-run failure and check that a proposed fix keeps the clock-face test from failing in the mutation run.

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

Descrizione

bug:needs-info

vitest.mutate.config.ts:13 sets testNamePattern to leave out ui/src/model/events.test.ts:148 ("is its time of day on the browser's clock face"), because that test sets process.env.TZ, which a worker thread ignores.

@stryker-mutator/vitest-runner 10.1.1 overwrites that pattern on every project in each run without test ids, the dry run included (node_modules/@stryker-mutator/vitest-runner/dist/src/vitest-test-runner.js:216-219):

this.ctx.projects.forEach((project) => {
    project.config.testNamePattern = undefined;
});

So the dry run runs the clock-face test anyway. In the thread pool it fails:

$ pnpm exec vitest run --config vitest.mutate.config.ts --pool threads ui/src/model/events.test.ts -t "clock face"
× is its time of day on the browser's clock face
AssertionError: expected '13:30:00' to be '17:00:00'

I read this from the runner's code and did not run Stryker (agents may not). If it holds, a pnpm mutate run whose test files include ui/src/model/events.test.ts (a mutant in ui/src/model/events.ts or something it imports) fails its first run. Possible fixes: exclude the test some other way (for example a skipIf on worker threads), or make it not depend on process.env.TZ.

Found while triaging #1938.

Written by an agent.

Lingua principale
TypeScript
Stelle
730
Fork
44
Merge medio
16h 13m
PR unite (30g)
387

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 callstackincubator/simlock

Tutte le issue di callstackincubator/simlock

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.