pregate: a removed test named by a package.json script or Makefile runs that file's unrelated tests (same blind spot on main for edits)

Aperta
#3,537 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à
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
github-actions, javascript, python, typescript
Ambito
testing, tooling

Direzione di ricerca

Start with the pregate lane logic changed in #3534 and inspect fixtures P1 and P1py, then trace how package.json scripts, Makefile targets, and workflow run: steps are handled. Reproduce the removed-test and edited-script cases described in the issue. Done when pregate detects tests invoked through runner configuration and the stale removal or breaking edit no longer passes silently.

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

Descrizione

S3

Pregate lanes: when a removed test is named by a runner-config file, such as a package.json script or a Makefile target, pregate runs that file's own tests, for example a version or format test, instead of the script that names the test. Main has the same blind spot when that script is edited. Found by the GSTA-137 adversarial pass at f943239 (fixtures P1 and P1py).

#3534 makes a removed test run the tests of every remaining non-Markdown file that mentions its name (without the extension). When that file is package.json ("smoke": "node --test test/alpha.test.js") or a Makefile (python3 -m unittest tests.test_alpha), "its tests" are whatever tests exercise package.json or the Makefile. Those are usually version or format checks, not the smoke script. So the removal passes, and running the stale script (npm run smoke, make smoke) then fails. Main 6f27f0c refuses the removal with PREGATE_NO_LANE.

On main, editing that same script so it breaks also runs only package.json's own tests. So this is a general gap: pregate does not know that a runner-config entry invokes a test. It is not specific to removals.

Possible fixes:

  • Treat package.json scripts, Makefile targets and workflow run: steps that name a test as invoking it. Run that test when it exists; refuse a removed test such an entry names unless a dependencies entry covers it.
  • Or have pregate run any script or target that names a touched test.

Listed as a known limit in #3534.

Lingua principale
TypeScript
Stelle
143k
Fork
21k
Merge medio
5h 25m
PR unite (30g)
791

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 garrytan/gstack

Tutte le issue di garrytan/gstack

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.