pnpm test can fail at random because the engine's test script rebuilds its dist while the CLI's tests import it

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

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
76/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
typescript

Rechercherichtung

Start with packages/cli-engine/package.json, tsdown.config.ts, and turbo.json, then run pnpm test repeatedly to reproduce the intermittent resolution failure. Confirm the CLI test task waits for the engine build and that the engine test run no longer cleans dist/ during parallel tests; pnpm test should complete reliably.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

packages/cli-engine/package.json's test script is pnpm run build && pnpm run typecheck && vitest run, and tsdown.config.ts has clean: true. Under the parallel pnpm test, the engine's test task can delete and rewrite dist/ while the CLI's tests are importing it, which fails with Failed to resolve entry for package "@prisma/cli-engine". In turbo.json, test depends only on ^build. Turbo cache hits hide it most of the time.

The fix the ledger proposed: make the CLI's test task depend on the engine's build, and stop the engine's test script from cleaning dist/ mid-run.

Recorded in the prisma-cli-v8 project ledger, which is being deleted at project close-out: https://github.com/prisma/prisma-cli/blob/4356b361adf7044bae59aa0bc70340eda89fdad6/.drive/projects/prisma-cli-v8/deferred.md#L400

🤖 Generated with Claude Code

Vorherrschende Sprache
TypeScript
Sterne
25
Forks
4
Ø Merge
18 Std. 22 Min.
Gemergte PRs (30 T.)
34

Entwicklungsumgebung

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 prisma/prisma-cli

Alle Issues in prisma/prisma-cli

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

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