Repository navigation
test: add acceptance tests for rr get - #66
Conversation
Releases can be fetched from GitHub Enterprise, a mirror or a mock server. The variable is not `GITHUB_API_URL` because GitHub Actions sets that one in every job. Releases are requested 100 per page, so listing them takes 2 requests instead of about 7. Assisted-By: Claude Opus 5.5
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (21)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe CLI can use a configurable GitHub releases API endpoint. The change adds acceptance tests for ChangesGitHub API and
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Other Suggested reviewers: Merge Risk: ⚪ Minimal · up to The acceptance workflow has no identified blocker and is ready to merge after normal checks. Pre-merge checks |
|
The tests run `bin/rr` as a separate process against a fake GitHub API served by `php -S`, reached through RR_GITHUB_API_URL, and check the exit code, the installed binary, `.rr.yaml` and the requests made. They run on Linux and Windows in their own workflow and are kept out of Infection, since mutants in a child process are never covered. A live suite against the real GitHub runs only on manual dispatch. Six cases that expose bugs are skipped with the reason: RC tags sort below beta ones, an unknown --os/--arch still fetches the releases, and a kept binary still exits with 0. Assisted-By: Claude Opus 5.5
0e4c78a to
dee4c5f
Compare
Assisted-By: Claude Opus 5.5
What was changed
AcceptanceTesto suite: black-box tests that runbin/rr getas a separate process in a temporary directory with a clean environment, against a fake GitHub API (tests/Acceptance/Server/router.phpunderphp -S) reached throughRR_GITHUB_API_URL.fake rr <version> <os> <arch>marker),.rr.yamland the request log; console text is only matched loosely.--filter,--stability, other OS/arch (rr.exefrom a zip, darwin tar.gz), fallback past a release without the assembly (.deb/protoc assets ignored), unknown versions,--no-config/-p/--preset, existing.rr.yamland binary, interactive answers, 403 rate limit, 404 asset, unreachable API, pagination, request budget,get/get-binary.Acceptance Testsworkflow runs the suite on Ubuntu and Windows (PHP 8.2 and 8.5); thetestoworkflow and Infection run only theUnitsuite.Livesuite downloads real binaries from GitHub; it is registered only withRR_CLI_LIVE_TESTS=1and runs onworkflow_dispatchonly.Review notes
--stability=rcmeansdev(--stability=rc is treated as dev #67); an unknown--os/--archstill fetches the releases (Unknown --os or --arch still fetches the releases before failing #68); a kept existing binary exits with 0 (get-binary exits with 0 when the existing binary is kept #69).SHELL_INTERACTIVE=1; all other runs pass--no-interactionexplicitly.Checklist