npm test fails on main because publication subtests share leaked state

Offen
#56 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@NopeCharon arbeitet bereits daran.

Seit 19.11.2026.

  • #57 von @NopeCharon — offen

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
git, github-actions, node.js, typescript
Bereich
ci-cd, testing

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.
Vorherrschende Sprache
TypeScript
Sterne
2
Forks
1
Ø Merge
6 Std. 19 Min.
Gemergte PRs (30 T.)
4

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus hyperlight-dev/hyperlight-bench

Alle Issues in hyperlight-dev/hyperlight-bench

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.