Skip to content

Dogfood: minimal Vite + Playwright fixture for discover-tests#54

Open
jmjava wants to merge 3 commits intomainfrom
cursor/playwright-vite-dogfood-6f6e
Open

Dogfood: minimal Vite + Playwright fixture for discover-tests#54
jmjava wants to merge 3 commits intomainfrom
cursor/playwright-vite-dogfood-6f6e

Conversation

@jmjava
Copy link
Copy Markdown
Owner

@jmjava jmjava commented May 6, 2026

Summary

Adds fixtures/playwright-vite-dogfood/ (Vite + @playwright/test), wires discover_tests.roots, catalog, docs, and a CI job that runs npm ci, Playwright, and docgen discover-tests.

CI fix (JSON pipe)

docgen discover-tests printed a warning to stdout when npx playwright test --list returned no tests, so ... --format=json | python -c 'json.load(sys.stdin)' saw non-JSON first and failed with JSONDecodeError: Expecting value: line 1 column 1.

Change: that warning and merge-catalog status lines now go to stderr; stdout is only JSON (or yaml) for machine-readable formats. Added unit test test_discover_tests_json_stdout_is_pure_when_no_tests (asserts r.stdout is [] with empty discovery).

CI job

playwright-vite-dogfood: npm ciplaywright install --with-deps chromiumnpm run test:e2epip install .discover-tests --format=json piped to Python assert (with empty-stdout guard).

Verify locally

cd fixtures/playwright-vite-dogfood && npm ci && npx playwright install chromium && npm run test:e2e
cd ../../docs/demos && docgen --config docgen.yaml discover-tests --format=json | python3 -c "import json,sys; print(json.load(sys.stdin))"
Open in Web Open in Cursor 

cursoragent and others added 3 commits May 6, 2026 20:28
Add fixtures/playwright-vite-dogfood with vite, @playwright/test, smoke.spec.ts
at the fixture root (Playwright JSON list paths align with repo-relative files).

Wire discover_tests.roots in docs/demos/docgen.yaml, ignore node_modules,
refresh docgen.catalog.yaml with merged Playwright entry + fingerprints, and
document npm ci / playwright install / discover-tests in demos README.

Co-authored-by: John Menke <jmjava@gmail.com>
Co-authored-by: John Menke <jmjava@gmail.com>
When --format=json (or catalog), prefixing stdout with human messages broke
pipelines (e.g. CI piping JSON). Route warning and merge-catalog status to
stderr; stdout stays machine-readable.

Harden CI step with empty-stdout assert and a compact json.loads check.
Add unit test asserting JSON on stdout when discovery returns no tests.

Co-authored-by: John Menke <jmjava@gmail.com>
@jmjava jmjava marked this pull request as ready for review May 6, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants