Skip to content

chore(e2e): migrate to shared obsidian-e2e instance runner#283

Merged
chhoumann merged 4 commits into
masterfrom
chore/shared-e2e-runner
Jul 10, 2026
Merged

chore(e2e): migrate to shared obsidian-e2e instance runner#283
chhoumann merged 4 commits into
masterfrom
chore/shared-e2e-runner

Conversation

@chhoumann

@chhoumann chhoumann commented Jul 10, 2026

Copy link
Copy Markdown
Owner

What

Migrates PodNotes' isolated Obsidian orchestration from four vendored scripts plus two helper modules to the published obsidian-e2e instance runner.

  • Removes the vendored runner scripts, helpers, and their unit tests, reducing the repository by roughly 2,600 net lines.
  • Uses published obsidian-e2e@0.7.0 through a single obsidian-e2e.config.mjs.
  • Preserves the existing npm command contract for provisioning, starting, running commands against, and stopping isolated Obsidian instances.
  • Emits canonical OBSIDIAN_E2E_* variables while retaining the legacy PODNOTES_E2E_* aliases during migration.
  • Makes the live suite use a real local WAV fixture and reuse the note leaf PodNotes opens, eliminating unsupported-media and Markdown-leaf race noise from runtime diagnostics.

Why

PodNotes, MetaEdit, and QuickAdd carried near-identical E2E orchestration that had drifted between repositories. Consolidating on the shared published runner leaves one maintained implementation while preserving PodNotes' hardened readiness, process ownership, profile isolation, and teardown behavior.

The fixture cleanup also makes a clean runtime log meaningful. The old suite wrote plain text into .mp3 files and raced a second Markdown leaf against PodNotes' asynchronous note opening, which produced delayed browser and Obsidian errors even when assertions passed.

Validation

Validated after merging current master into this branch:

  • npm run lint
  • npm run format:check
  • npm run typecheck
  • npm run build
  • npm run test: 93 files and 1,519 tests passed; Svelte checks reported 0 errors and 0 warnings.
  • MkDocs build with the pinned docs/requirements.txt versions.
  • Published dependency proof: npm ls obsidian-e2e --depth=0 resolved obsidian-e2e@0.7.0.
  • Real Obsidian 1.13.0 in a private worktree profile: 14/14 live E2E tests passed.
  • Post-suite dev:errors: no errors captured.
  • Teardown terminated all 5 private processes, required no forced kills, and removed the profile directory.

Drift guard

scripts/e2e-config.test.ts serialize-compares the runner's defaultData with { schemaVersion: 2, ...DEFAULT_SETTINGS }. Adding or removing a setting without updating the seed fails the unit suite.

Environment contract

The runner emits canonical OBSIDIAN_E2E_* variables alongside the temporary PODNOTES_E2E_* aliases. The harness reads canonical names first. HOME must still be remapped to OBSIDIAN_E2E_OBSIDIAN_HOME because the Obsidian CLI socket is profile-scoped.

Heads-up for in-flight branches

  • Branches editing the deleted vendored scripts should port their intent into obsidian-e2e.config.mjs rather than restoring those scripts.
  • Changes to DEFAULT_SETTINGS must update the config seed in lockstep; the drift test enforces this.

Replace the four vendored scripts/*-obsidian-e2e-*.mjs orchestration copies
(their unit tests, and the two helper files obsidian-e2e-errors.mjs /
obsidian-e2e-types.d.ts that existed only to serve them) with the shared
`obsidian-e2e` instance-runner bin. The four npm script names are unchanged;
they now point at `obsidian-e2e <provision|start|stop|run>`, configured by a new
`obsidian-e2e.config.mjs` at the repo root.

- Add obsidian-e2e.config.mjs: pluginId, two plugin artifacts (manifest.json +
  main.js only - PodNotes injects its CSS into main.js, so there is no styles.css
  to symlink), the schema-v2 DEFAULT_SETTINGS-shaped data.json seed, envPrefix
  "PODNOTES" so legacy PODNOTES_E2E_* aliases keep flowing, and the PodNotes eval
  ready probe. defaultCommand/readyProbe match the runner defaults; the probe is
  written out explicitly for documentation.
- Port the data-seed drift test to scripts/e2e-config.test.ts (asserts the
  config's defaultData serialize-equals { schemaVersion: 2, ...DEFAULT_SETTINGS }
  from src/constants.ts). The deleted script unit tests drop out of the vitest
  `scripts/**` include cleanly.
- tests/e2e/harness.ts: read canonical OBSIDIAN_E2E_VAULT first, legacy
  PODNOTES_E2E_VAULT alias as fallback. OBSIDIAN_BIN is unchanged.
- orca.yaml archive hook: `npm exec obsidian-e2e -- stop --worktree ...` (npm's
  `npm exec <pkg> -- <args>` forwards --worktree to the bin), keeping the
  `command -v node` guard and `|| true`.
- package.json: add obsidian-e2e.config.mjs to the oxfmt format file list.
- AGENTS.md + .gitignore: document the runner bin, config file, and canonical env
  names + legacy aliases.

The dependency is a local file: link for validating the runner before it ships;
npm normalized it to `file:../obsidian-e2e` (pnpm consumers keep the absolute
path). This MUST switch to the published obsidian-e2e ^0.7.0 before this PR
merges (the runner package is currently unpublished at 0.6.0).
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 10, 2026

Copy link
Copy Markdown

Deploying podnotes with  Cloudflare Pages  Cloudflare Pages

Latest commit: f81bbb5
Status: ✅  Deploy successful!
Preview URL: https://4a2c2de3.podnotes.pages.dev
Branch Preview URL: https://chore-shared-e2e-runner.podnotes.pages.dev

View logs

@chhoumann chhoumann marked this pull request as ready for review July 10, 2026 20:50
@chhoumann

Copy link
Copy Markdown
Owner Author

All CI checks are green (Test, CodeQL, Analyze x2, Cloudflare Pages, Graphite AI Reviews). No open review threads and no changes requested. Also verified all four gates locally on the branch: npm run test (1459 tests pass), lint, format:check, and typecheck all clean. Ready for your merge.

@chhoumann chhoumann merged commit 7b9497e into master Jul 10, 2026
6 checks passed
@chhoumann chhoumann deleted the chore/shared-e2e-runner branch July 10, 2026 21:12
@chhoumann

Copy link
Copy Markdown
Owner Author

Pushed one follow-up: the orca.yaml archive hook now invokes the worktree-local node_modules/.bin/obsidian-e2e instead of npm exec - the npm shim is often absent from Orca's non-login GUI PATH, which would make the stop fail silently behind || true and leak the instance (same fix as quickadd ca29a8a7). Verified under a clean env -i PATH. CI is re-running on the new commit; still ready for your merge once it's green again.

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.

1 participant