test: add integration tests for the shipped action - #766
Conversation
Cover commit, tag, push, and pathspec flows against temp git fixtures with local bare remotes (#479). Co-authored-by: Cursor <cursoragent@cursor.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds isolated Git fixtures and helpers for running the built action. Adds integration tests for commits, no-ops, identities, tags, pushes, branches, and pathspec behavior. Updates contribution instructions to run unit and integration tests after building. ChangesIntegration testing
Estimated code review effort: 3 (Moderate) | ~30 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/integration/helpers.ts`:
- Around line 61-80: Update the default-branch lookup in the fixture setup to
handle a missing init.defaultBranch without letting git config failure abort
execution, using the intended fallback branch. Ensure the seed checkout and push
use that resolved branch, then explicitly set the bare remote’s HEAD to it after
the push so the remote default matches the fixture branch.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 9519cf21-2810-4633-b120-97cc22511562
📒 Files selected for processing (3)
CONTRIBUTING.mdtest/integration/action.test.tstest/integration/helpers.ts
GitHub runners often have no init.defaultBranch set, so git config --get exits 1 and broke fixture setup. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
lib/index.jsagainst temporary git fixtures with local bare remotes (covers commit, tag, push, new branch, remove, selective add).os.tmpdir()with an allowlisted spawn env so CI never pushes to GitHub or touches the checked-out repo.npm testinstead of manually testing in a separate repo.Closes #479
Test plan
npm test(unit + integration + lint) passes locallyMade with Cursor
Summary by CodeRabbit
Tests
Documentation