Skip to content

test(e2e): add file collision behavior coverage#1153

Merged
chhoumann merged 3 commits intomasterfrom
test/e2e-file-collision-behavior
Mar 14, 2026
Merged

test(e2e): add file collision behavior coverage#1153
chhoumann merged 3 commits intomasterfrom
test/e2e-file-collision-behavior

Conversation

@chhoumann
Copy link
Owner

@chhoumann chhoumann commented Mar 14, 2026

Add Obsidian-backed end-to-end coverage for template file collision behavior.

This adds a dedicated bun run test:e2e entrypoint using obsidian-e2e, a live-vault suite that exercises the file collision behavior matrix and the file-exists migration path against a real QuickAdd plugin instance. It also documents the local E2E workflow in the repo README and ignores captured failure artifacts.

I considered wiring the suite into the existing GitHub Actions test job, but these tests currently depend on a locally installed Obsidian app, the obsidian CLI on PATH, and an open dev vault. Keeping them as an explicit local suite makes that dependency clear while still giving us verifiable coverage for the regression space around #1139.

Reviewer context and risk notes:

  • Scope is test/docs/tooling only; production plugin code is unchanged.
  • The E2E cases seed their own fixtures so they do not depend on prior test ordering.
  • Verified locally with bun run build-with-lint and bun run test:e2e.

Refs #1139


Open with Devin

Summary by CodeRabbit

  • Documentation

    • Updated development section with local tooling, test/build tasks, and E2E prerequisites.
  • Tests

    • Added a comprehensive end-to-end test suite covering file-existence and migration behaviors.
    • Added an E2E test runner configuration to control timeouts and worker settings.
  • Chores

    • Added an E2E test script and test tool dependency; updated ignore rules to exclude E2E artifacts.

@vercel
Copy link

vercel bot commented Mar 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
quickadd Ready Ready Preview Mar 14, 2026 7:03pm

@coderabbitai
Copy link

coderabbitai bot commented Mar 14, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a46a30fe-9bb0-425f-9825-b31c37038b82

📥 Commits

Reviewing files that changed from the base of the PR and between 95aff61 and e626b3b.

📒 Files selected for processing (1)
  • tests/e2e/file-exists-behavior.test.ts

📝 Walkthrough

Walkthrough

Adds end-to-end testing: Vitest E2E config, an extensive E2E test exercising QuickAdd file-existence behaviors and migrations, a package script and devDependency for E2E, README development instructions, and .gitignore updates to ignore src/**/*.js and .obsidian-e2e-artifacts.

Changes

Cohort / File(s) Summary
E2E Config & Scripts
vitest.e2e.config.mts, package.json
New Vitest E2E config scoped to tests/e2e/**/*.test.ts (60s test timeout, 30s hook timeout, single worker). Adds test:e2e script and obsidian-e2e@0.4.0 devDependency.
E2E Test Suite
tests/e2e/file-exists-behavior.test.ts
Adds a comprehensive E2E test covering 15 QuickAdd file-existence scenarios (T01–T15) and migration checks (M1–M6) with setup/teardown, helpers, seeding, polling, and artifact capture.
Docs & Ignore Rules
.gitignore, README.md
Reintroduces src/**/*.js ignore pattern and adds .obsidian-e2e-artifacts. README replaced Getting Started/Support with a Development section describing bun-based dev tasks and E2E prerequisites; support content retained.

Sequence Diagram(s)

sequenceDiagram
    participant Runner as Test Runner
    participant Sandbox as Obsidian Sandbox
    participant Plugin as QuickAdd Plugin
    participant FileSystem as File System

    Runner->>Sandbox: Initialize E2E vault
    Runner->>Sandbox: Acquire vault run lock
    Runner->>FileSystem: Seed template files
    Runner->>Plugin: Trigger QuickAdd choice (T01–T15 / M1–M6)
    Plugin->>FileSystem: Create/modify files per behavior
    Runner->>Runner: Poll for results / assertions
    Runner->>Sandbox: Capture failure artifacts if needed
    Runner->>Sandbox: Release vault lock & cleanup
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I hopped into the test-filled glade,
Seeding templates where decisions are made,
Choices clash and files sprout new names,
I tally outcomes, migrations, and games,
A tiny rabbit cheering passing frames.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'test(e2e): add file collision behavior coverage' directly and clearly describes the main change: adding end-to-end tests for file collision behavior.
Docstring Coverage ✅ Passed Docstring coverage is 87.50% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test/e2e-file-collision-behavior
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 14, 2026

Deploying quickadd with  Cloudflare Pages  Cloudflare Pages

Latest commit: e626b3b
Status: ✅  Deploy successful!
Preview URL: https://e89c5e2b.quickadd.pages.dev
Branch Preview URL: https://test-e2e-file-collision-beha.quickadd.pages.dev

View logs

@chhoumann chhoumann marked this pull request as ready for review March 14, 2026 18:58
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 95aff614da

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@chhoumann chhoumann merged commit b74bee3 into master Mar 14, 2026
4 checks passed
@chhoumann chhoumann deleted the test/e2e-file-collision-behavior branch March 14, 2026 19:08
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