chore(e2e): run .agents/run-e2e on macOS and fail when no spec ran - #2138
Conversation
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.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe 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. ChangesE2E runner
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~12 minutes Change: Other Merge Risk: ⚪ Minimal · up to The E2E runner changes are ready to merge after normal checks; no actionable failure was found. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. A rabbit checks the runner’s path, Comment |
Summary
.agents/run-e2ecould not run on macOS, and anywhere it could pass while running no spec.realpath -e(realpath: illegal option -- e, exit 1, after starting and stopping the instance). Paths are now resolved withcd -P … && pwd -P. The check stays as strict as before: only the fixed profile root/tmp/quickadd-obsidian-e2eis resolved first (on macOS/tmplinks to/private/tmp, and the runner prints the/tmpform); 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./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 bashfinds Homebrew's bash when it is on PATH.sha256sumneeds an operand for--check; it now reads-, which GNU's accepts too.-tfilter 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):
.agents/run-e2e tests/e2e/phone-keyboard.test.ts.agents/run-e2e tests/e2e/drag-pill-touch.test.ts tests/e2e/phone-keyboard.test.ts… -t "multi-select"… -t "no test has this name".agents/run-e2e tests/e2e/does-not-exist.test.tschoice-list-layout -t "New choice menu", fails in this local instance on master too)/bin/bash .agents/run-e2e …(bash 3.2)../ home../ home through a link //private/tmpspelling / home outside the roottest:e2eLinux:
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 usingcd -P/pwd -Pinstead ofrealpath -e(same result for existing directories, empty for missing ones, which the check rejects) andsha256sum … -.pnpm run test: 6607 passed, 34 skipped.pnpm run build-with-lint: clean.Release impact
None: tooling only (
chore).Note
Make
.agents/run-e2emacOS-compatible and fail when no spec ranrealpath -ewith a portablecd -P/pwd -Pphysical_dirhelper so path validation works on macOS.sha256sum.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