feat: add playwright reporter emitting ingest batches#92
Merged
Conversation
Implement @flakemetry/playwright-reporter on top of the sdk: onBegin resolves the CI run context from the environment, onTestEnd records each attempt with status mapping (retried pass becomes flaky, timeouts and interruptions become fail) and links retries to their first attempt, and onEnd builds a contract-valid ingest batch and delivers it fail-open. Suite names come from describe blocks only, CI metadata and pr number are read from GitHub Actions env, and an output-file mode dumps the batch for inspection. Covered by pure mapping tests and a full-lifecycle integration test driving synthetic Playwright events. Closes #14.
The reporter lifecycle test leaked GITHUB_SHA from the CI environment because resolveRunContext used nullish coalescing, which does not fall through on empty strings. Normalize empty env vars to undefined so set-but-empty CI variables fall back correctly, and make the lifecycle test hermetic by stubbing all GitHub env vars.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR-2 of M1: the primary ingestion source. A Playwright
Reporterbuilt on the SDK (#91).What's included
FlakemetryReporterimplementing the PlaywrightReporterinterface:onBegin→ resolve CI run context,onTestEnd→ record each attempt,onEnd→ build + deliver the ingest batchpassed@retry0 → pass,passed@retry>0 → flaky,failed/timedOut/interrupted → fail,skipped → skipFLAKEMETRY_OUTPUT_FILEdumps the batch to disk for inspectionexamples/with a readyplaywright.config.ts+ READMEVerification
retryOfIndex, suites distinguished)build/lint/typecheck/testgreen,format:checkcleanNotes
node_modules(both registerexpect), so the end-to-end path is exercised via the lifecycle driver with real Playwright types; a real run against the docker stack is covered by E2E smoke + one-command demo dataset & GIF #29resourcecarries noproject— per the contract (packages/contracts — zod schemas as single source of truth #4) the ingest token determines the project server-sideCloses #14.