Skip to content

chore(e2e): adopt shared createPluginHarness#287

Merged
chhoumann merged 2 commits into
masterfrom
chore/shared-harness
Jul 11, 2026
Merged

chore(e2e): adopt shared createPluginHarness#287
chhoumann merged 2 commits into
masterfrom
chore/shared-harness

Conversation

@chhoumann

@chhoumann chhoumann commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

Migrates PodNotes' hand-rolled E2E harness onto obsidian-e2e@^0.8.1's shared createPluginHarness factory. This is the PodNotes consumer of the same deduplication already merged for MetaEdit (chhoumann/MetaEdit#180).

tests/e2e/harness.ts drops from 338 to ~160 lines. The removed code is plumbing the factory now owns: the vault lock + marker lifecycle, sandbox creation, per-test diagnostics reset, data restore, plugin reload, failure-artifact capture, and the dev-vault symlink preflight. What stays is only PodNotes-specific: the ready predicate (API + protocol handler attached), the detach-views -> flush-saves ordering before data restore, and the plugin-ready command sentinel.

evalJsonAsync now delegates to the factory's serializer. For every value current tests exchange (plain JSON data) behavior is identical; the envelope contract itself is intentionally the factory's, which differs at the edges (a returned Date is rejected as non-plain instead of silently becoming an ISO string, undefined round-trips via sentinel instead of being dropped, and remote failures throw DevEvalError instead of plain Error). Adversarial review confirmed no current call site depends on the old edge behavior.

Review follow-ups applied:

  • symlinkRepoRoot is passed module-relative; the factory's process.cwd() default broke IDE-launched runs.
  • Two factory-side findings (vault lock released before sandbox cleanup; marker-clear failures swallowed in teardown) are filed upstream on obsidian-e2e rather than worked around here.

@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: c68b9a3
Status: ✅  Deploy successful!
Preview URL: https://e6235951.podnotes.pages.dev
Branch Preview URL: https://chore-shared-harness.podnotes.pages.dev

View logs

@chhoumann

Copy link
Copy Markdown
Owner Author

Ready for your merge. All CI green (Test, both CodeQL analyses, Graphite AI review, Cloudflare Pages) and no outstanding review threads. Live test:e2e passed 14/14 against a runner-provisioned isolated vault, matching the pre-migration count. Leaving the merge to you.

The factory defaults symlinkRepoRoot to process.cwd(), so the dev-vault
symlink preflight compared against <caller-cwd>/main.js and rejected
correct symlinks when Vitest was launched from an IDE or parent directory.
Derive the repo root from import.meta.url like the old harness did.
(Adversarial review finding on this PR.)
@chhoumann chhoumann merged commit 9f94307 into master Jul 11, 2026
6 checks passed
@chhoumann chhoumann deleted the chore/shared-harness branch July 11, 2026 10:52
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