Skip to content

chore(e2e): run .agents/run-e2e on macOS and fail when no spec ran - #2138

Merged
chhoumann merged 2 commits into
masterfrom
chore/run-e2e-macos
Oct 2, 2026
Merged

chhoumann merged 2 commits into
masterfrom
chore/run-e2e-macos

Conversation

@chhoumann

@chhoumann chhoumann commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

.agents/run-e2e could not run on macOS, and anywhere it could pass while running no spec.

  • macOS: it stopped at GNU-only realpath -e (realpath: illegal option -- e, exit 1, after starting and stopping the instance). Paths are now resolved with cd -P … && pwd -P. The check stays as strict as before: only the fixed profile root /tmp/quickadd-obsidian-e2e is resolved first (on macOS /tmp links to /private/tmp, and the runner prints the /tmp form); below it, and for the vault, the printed path must equal its physical path, so a .. or a link is still rejected. On Linux the root is already physical and the check is the same as before.
  • bash 3.2 (macOS's /bin/bash): the parser uses associative arrays and [[ -v ]]. The script now stops at the top with "run-e2e needs bash 4 or newer; this is bash 3.2.57… On macOS: brew install bash" instead of starting the instance and failing mid-parse. #!/usr/bin/env bash finds Homebrew's bash when it is on PATH.
  • Templater check: macOS's sha256sum needs an operand for --check; it now reads -, which GNU's accepts too.
  • No spec ran: Vitest exits 0 when a -t filter matches no test (all skipped). The script adds a JSON reporter next to the default one and fails with "No spec ran: the arguments matched no test (…)" when no test passed or failed. A spec path that matches no file already failed (Vitest: "No test files found", exit 1).

Testing

On macOS (this Mac, Homebrew bash 5.3, Obsidian 1.14.3):

Run Exit
.agents/run-e2e tests/e2e/phone-keyboard.test.ts 0 (3 passed)
.agents/run-e2e tests/e2e/drag-pill-touch.test.ts tests/e2e/phone-keyboard.test.ts 0 (4 passed)
… -t "multi-select" 0 (1 passed, 2 skipped)
… -t "no test has this name" 1, "No spec ran"
.agents/run-e2e tests/e2e/does-not-exist.test.ts 1, "No test files found"
a failing spec (choice-list-layout -t "New choice menu", fails in this local instance on master too) 1
/bin/bash .agents/run-e2e … (bash 3.2) 1, "needs bash 4 or newer", before the build
mocked pnpm: valid paths / vault .. / home .. / home through a link / /private/tmp spelling / home outside the root 0 / 1 / 1 / 1 / 1 / 1, the rejected ones before test:e2e

Linux: tests/orb-setup.test.ts (runs in CI on Linux) drives the script with a mocked pnpm. "passes its arguments to Vitest as filters" now expects the reporter arguments and has the mock write the JSON report; a new test, "fails when its arguments match no test", expects exit 1, "No spec ran", and the instance stopped. The four lifecycle tests also pass on this Mac when the Linux gate and its /tmp-is-not-a-link assertion are lifted in a throwaway copy. The GNU path differs from before only in using cd -P/pwd -P instead of realpath -e (same result for existing directories, empty for missing ones, which the check rejects) and sha256sum … -.

pnpm run test: 6607 passed, 34 skipped. pnpm run build-with-lint: clean.

Release impact

None: tooling only (chore).

Note

Make .agents/run-e2e macOS-compatible and fail when no spec ran

  • Adds a Bash 4+ startup guard and replaces GNU realpath -e with a portable cd -P/pwd -P physical_dir helper so path validation works on macOS.
  • Rewrites test execution to write a temporary JSON results file via Vitest reporters, parse passed/failed counts with Node, and exit 1 when the total is zero — so filters matching no tests fail loudly.
  • Cleanup trap now removes the results file; checksum check passes data via stdin to sha256sum.
  • Adds tests in orb-setup.test.ts for reporter/output-file argument forwarding and the zero-test failure path.
  • Risk: exits before starting services on Bash < 4; physical_dir-based validation now rejects noncanonical or out-of-layout vault/home paths — check the start-environment validation in .agents/run-e2e.

Macroscope summarized 3857b54.

Summary by CodeRabbit

  • Bug Fixes
    • The E2E test runner now reports an error when no tests match the supplied arguments or no tests run, rather than completing without a result.
    • Improved validation of the test environment and vault locations helps catch invalid setup before tests run.
    • The runner now reports an error on Bash versions older than 4.
  • Tests
    • Added coverage for test argument handling, JSON result reporting, and zero-test failures.

On macOS the script stopped at GNU-only `realpath -e`, and its Templater
check at `sha256sum --check` without an operand. Paths are now resolved
with `cd -P`; only the profile root is resolved first, since macOS's /tmp
is a link and the runner prints the /tmp form, and below it the printed
paths must still be physical. Under bash 3.2 (macOS's /bin/bash) the
script now says it needs bash 4 instead of failing mid-parse.

Vitest exits 0 when a -t filter matches no test, so the script reads a
JSON report and fails when no test passed or failed.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-02T08:55:44.459790Z f366b28 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: f2d7ed03-fb79-4b78-a521-4f646442b628

📥 Commits

Reviewing files that changed from the base of the PR and between f366b28 and 3857b54.

📒 Files selected for processing (1)
  • .agents/run-e2e

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The E2E runner checks its Bash version and configured paths, supplies an explicit checksum input operand, and records Vitest results as JSON. It exits with an error when no tests pass. Tests cover argument forwarding and zero-test handling.

Changes

E2E runner

Layer / File(s) Summary
Runner environment and path validation
.agents/run-e2e
The script requires Bash 4 or later, validates physical vault and Obsidian home paths, and supplies - as the sha256sum input operand.
Test result capture and zero-test handling
.agents/run-e2e, tests/orb-setup.test.ts
The runner initializes and removes the temporary results file, captures Vitest JSON results, and fails when no tests pass. Tests verify Vitest arguments and the zero-test failure behavior.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 3857b

The E2E runner changes are ready to merge after normal checks; no actionable failure was found.

Architecture Summary

Architecture risk: 🔵 Low · up to 3857b

The change affects 1 system.

Changed systems: tests

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — tests (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in tests/orb-setup.test.ts: Adds a local helper that prepares a uniquely named mock E2E instance and accepts the Vitest arguments and reported passed-test count.
  • observed — Modified behavior in tests/orb-setup.test.ts: The mock pnpm now writes a JSON result containing the supplied passed-test count and zero failures when invoked for E2E tests. The helper runs runE2E with the supplied arguments, captures its result and call log, and cleans up the vault and profile instance in a finally block.
  • observed — Modified behavior in tests/orb-setup.test.ts: Replaces the standalone argument-filter test setup with a helper-based test that expects the original filters plus default and JSON reporters and a JSON output-file option. Adds a zero-passed-tests case that expects status 1, a “No spec ran” error, and a stop command.
  • observed — Modified behavior in .agents/run-e2e: Adds a Bash 4 minimum-version check; older Bash versions print an error and exit with status 1.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary changes: macOS support for .agents/run-e2e and failure when no specification runs.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

A rabbit checks the runner’s path,
And guards the tests from a false start.
JSON results hop into view,
The cleanup sweeps the temp file through.
Bash four keeps the script on track,
No passing tests? It signals back.

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

Comment thread .agents/run-e2e
@chhoumann
chhoumann merged commit 4a22d51 into master Oct 2, 2026
13 checks passed
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