Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,43 @@ jobs:
# VHS terminal capture needs a DISPLAY (headless Ubuntu has none by default).
- run: xvfb-run -a pytest tests/ --ignore=tests/e2e -v --tb=short

playwright-vite-dogfood:
name: Playwright Vite dogfood fixture
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: "20"
cache: npm
cache-dependency-path: fixtures/playwright-vite-dogfood/package-lock.json
- name: Install fixture deps + Playwright (Chromium)
working-directory: fixtures/playwright-vite-dogfood
run: |
npm ci
npx playwright install --with-deps chromium
- name: Run Playwright tests against Vite dev server
working-directory: fixtures/playwright-vite-dogfood
env:
CI: "1"
run: npm run test:e2e
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install docgen (CLI)
run: pip install --no-cache-dir .
- name: docgen discover-tests includes fixture spec
env:
PYTHONPATH: ${{ github.workspace }}/src
run: |
set -euo pipefail
cd docs/demos
docgen --config docgen.yaml discover-tests --format=json | python3 -c "import json,sys; r=sys.stdin.read().strip(); \
assert r, 'empty stdout from discover-tests'; \
d=json.loads(r); \
assert len(d)>=1, d; \
assert any('smoke.spec.ts' in (x.get('spec_path') or '') for x in d), d"

smoke:
name: smoke (config + lint + tts dry-run)
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ Thumbs.db

.pytest_cache/
tests/.bin-cache/

# Node fixture for Playwright discovery dogfood (fixtures/playwright-vite-dogfood)
fixtures/playwright-vite-dogfood/node_modules/
.coverage
htmlcov/
.mypy_cache/
Expand Down
15 changes: 13 additions & 2 deletions docgen.catalog.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
catalog_schema_version: 1
updated_at: '2026-05-06T19:38:58Z'
updated_at: '2026-05-06T20:27:45Z'
docgen_version: 0.2.0
repo_root: .
entries: []
entries:
- id: pw-d330a6619721b3e5
kind: playwright_node
test:
spec: fixtures/playwright-vite-dogfood/smoke.spec.ts
title: home page shows dogfood heading
project: null
fingerprints:
tracked_paths:
- fixtures/playwright-vite-dogfood/smoke.spec.ts
inputs:
fixtures/playwright-vite-dogfood/smoke.spec.ts: 6620ca5a5197a75dbb4c635e73f1ade26ccc6514d1990dd8449d3be90cb12c37
18 changes: 16 additions & 2 deletions docs/demos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,26 @@ docgen --config docgen.yaml catalog init # once; creates ../../docgen.ca
docgen --config docgen.yaml catalog stale
```

Discovery and catalog merge (Node Playwright projects under the repo root):
Discovery and catalog merge (**requires** the Vite + Playwright fixture installed — see below):

```bash
cd docs/demos
cd fixtures/playwright-vite-dogfood && npm ci && npx playwright install chromium
cd ../../docs/demos
docgen --config docgen.yaml discover-tests
docgen --config docgen.yaml discover-tests --merge-catalog
docgen --config docgen.yaml catalog refresh
```

The fixture lives at **`fixtures/playwright-vite-dogfood/`** (`vite`, `@playwright/test`, **`smoke.spec.ts`** at the fixture root). `docgen.yaml` lists it under **`discover_tests.roots`**.

To run Playwright directly:

```bash
cd fixtures/playwright-vite-dogfood
npm ci && npx playwright install chromium
npm run test:e2e
```

Optional narration draft for segment 07 (requires `OPENAI_API_KEY`):

```bash
Expand All @@ -58,3 +70,5 @@ docgen --config docgen.yaml validate --pre-push
```

Upstream consumer dogfood (separate clone) is described in `milestones/upstream-dogfood.md` at the repo root.

The **Playwright + Vite** dogfood fixture under `fixtures/playwright-vite-dogfood/` runs in CI (see `.github/workflows/ci.yml`).
1 change: 1 addition & 0 deletions docs/demos/docgen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ env_file: ../../.env
discover_tests:
roots:
- "."
- "fixtures/playwright-vite-dogfood"

narration_from_source:
model: gpt-4o-mini
Expand Down
4 changes: 4 additions & 0 deletions fixtures/playwright-vite-dogfood/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
test-results/
playwright-report/
blob-report/
36 changes: 36 additions & 0 deletions fixtures/playwright-vite-dogfood/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Playwright + Vite dogfood fixture

Tiny **Vite** app plus **@playwright/test** so this repository can run:

- `npx playwright test` / `npm run test:e2e`
- `docgen discover-tests` and `docgen discover-tests --merge-catalog` (from `docs/demos` with `discover_tests.roots` including this directory)

Specs live at the fixture root (`smoke.spec.ts`) so Playwright’s `--list --reporter=json` file paths line up with repo-relative paths for catalog fingerprints.

Not product code — only for local verification and docgen discovery against a realistic Node layout.

## Setup

```bash
cd fixtures/playwright-vite-dogfood
npm ci
npx playwright install chromium
```

## Run tests

```bash
npm run test:e2e
```

## docgen

From repository root, after `npm ci` here:

```bash
cd docs/demos
docgen --config docgen.yaml discover-tests
docgen --config docgen.yaml discover-tests --merge-catalog
```

This fixture is also exercised in **GitHub Actions** (`.github/workflows/ci.yml`, job `playwright-vite-dogfood`).
12 changes: 12 additions & 0 deletions fixtures/playwright-vite-dogfood/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>docgen Playwright dogfood</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
Loading
Loading