npm test fails on main because publication subtests share leaked state

Aperta
#56 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@NopeCharon ci sta già lavorando.

Dal 19/11/2026.

  • #57 di @NopeCharon — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
git, github-actions, node.js, typescript
Ambito
ci-cd, testing

Direzione di ricerca

Start with the failing subtests in scripts/publication.test.ts and inspect how the store, counters, and PR labels are reset between them. Run npm test to reproduce the four failures, then verify cleanup prevents one subtest from affecting the next. The issue also proposes a read-only workflow for pull requests and pushes to main; done means npm test passes and the workflow runs it on both events.

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

Descrizione

npm test fails on main, and has since #34. 4 of the 30 tests fail (Node 24.22):

✖ label changes prevent archival and promotion
✖ merge with no archive reports failure and requires manual archival
✖ promotion failure after merge still retains the valid archive remotely
✖ CI archival and promotion with simulated GitHub and Git

The publication code is fine. This is shared state leaking between subtests of CI archival and promotion with simulated GitHub and Git in scripts/publication.test.ts:

  1. #34 added incomplete artifacts and untrusted runner SKUs cannot archive. It ends with downloads === 2 and doesn't reset the counters. Before that change, the preceding test ended with clearStore().
  2. label changes prevent archival and promotion doesn't call clearStore(), so assert.equal(downloads, 0) sees 2 and throws.
  3. The throw skips the pr.labels = [] on the last line, so the PR keeps the benchmarks: skip label. The next two tests then take the approved-skip path instead of the failure they expect, and fail with "Missing expected rejection".

Bisecting confirms it. 02d7c6f passes 29/29, and bdbca55 (#34) is the first commit that fails.

No workflow runs npm test, so CI didn't catch it. #34 notes "Tests were not run."

Proposed fix:

  • Reset the store and counters at the start of the label test, and restore the mutated fixtures in finally blocks so one failing subtest can't cascade into later ones.
  • Add a read-only workflow that runs npm test on PRs and pushes to main.
Lingua principale
TypeScript
Stelle
2
Fork
1
Merge medio
6h 19m
PR unite (30g)
4

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 hyperlight-dev/hyperlight-bench

Tutte le issue di hyperlight-dev/hyperlight-bench

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.