Automattic / Automattic/wp-codebox

Preserve PHPUnit bootstrap integration process failures

Offen Anfängerfreundlich
#2,467 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
16
Forks
4
Ø Merge
59 Min.
Gemergte PRs (30 T.)
131

Beschreibung

## Problem

When `tests/playground-phpunit-bootstrap-failure.integration.test.ts` receives a failed recipe-run process with empty stdout, its catch path calls `JSON.parse("")`. That replaces the original CLI process failure with `SyntaxError: Unexpected end of JSON input`, hiding stderr, exit status, timeout, and command context needed to diagnose the runtime failure.

This occurred in the full smoke aggregate while verifying #2464 and #2466. The test passes standalone, so preserving the original failure is required to diagnose any recurrence under aggregate load.

## Desired outcome

Parse recipe-run output only when non-empty JSON exists. Return structured failed recipe output when available; otherwise rethrow the original process error unchanged.

## Acceptance criteria

- Empty or absent stdout does not enter `JSON.parse`.
- Structured recipe failure JSON remains the primary assertion input.
- Unstructured process failures retain their original diagnostics.
- The standalone integration and full smoke aggregate pass.

## AI assistance

GPT-5.6 Sol via OpenCode identified the masking parser after the aggregate failure and drafted this diagnostic repair under Chris Huber's direction.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne in tests/playground-phpunit-bootstrap-failure.integration.test.ts und untersuche den catch-Pfad für die Verarbeitung fehlgeschlagener recipe-run-Prozesse. Führe den eigenständigen Integrationstest und das vollständige Smoke-Aggregat aus. Erledigt ist die Aufgabe, wenn strukturiertes Fehler-JSON weiterhin verfügbar bleibt, während leeres oder fehlendes stdout den ursprünglichen Prozessfehler und dessen Diagnoseinformationen bewahrt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

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

Neue Issues direkt in Ihr Postfach

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