Add curl|sh install script with e2e tests#1
Merged
willisrocks merged 9 commits intomainfrom Mar 9, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use a dedicated run_detection_with_stderr helper that does not suppress stderr (no 2>/dev/null), so the "unsupported" error messages from detect_platform can be captured and asserted. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Extract case statement for mock binary OS detection into a separate
variable to avoid POSIX sh syntax ambiguity with unparenthesized
case patterns inside command substitution.
- Replace curl -fsSL -w '%{http_code}' || true pattern with a simple
if ! curl -fsSL; then error; fi — the old pattern discarded curl's
exit code and relied on empty-file detection, which could miss
servers returning HTML error bodies with 200 status.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add install.sh for downloading pre-built devproxy binaries from GitHub Releases, with OS/arch detection, curl/wget fallback, and configurable install directory. Include comprehensive shell-based test suite covering platform detection, URL construction, e2e install, error handling, and missing downloader scenarios. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix run_detection_with_stderr exit code handling: use `|| _rc=$?` pattern instead of bare `$?` after command, which was unreachable under set -eu (findings 1, 5) - Replace fragile `sed 's/^main$//'` with sentinel marker `# __DEVPROXY_INSTALL_MAIN__` and guard assertion (finding 2) - Replace flaky `sleep 1` for mock server startup with a retry loop that polls the server with curl (finding 3) - Add user-friendly error message to create_install_dir when mkdir fails, suggesting sudo or DEVPROXY_INSTALL_DIR (finding 4) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use `install -m 755` instead of mv + chmod to atomically place the binary with correct permissions, eliminating the window where an interrupt could leave a non-executable binary (finding 1) - Add writability check for existing install directories so users get a clear error instead of a cryptic mv failure (finding 2) - Remove `2>/dev/null` from wget so TLS/DNS errors are visible to users; `-q` already suppresses the progress bar (finding 3) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace `install -m 755` with `cp` + `chmod 755` for portability on minimal Linux systems like Alpine (finding 1) - Add explicit error handling for cp and chmod failures with clear messages instead of falling through to verify_installation (finding 2) - Add test cases for amd64 and arm64 architecture aliases on Linux, covering the alternate uname -m values (finding 3) - Add fallback case for _mock_os on unsupported host platforms so e2e tests skip gracefully instead of using an unset variable (finding 4) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
willisrocks
added a commit
that referenced
this pull request
Mar 10, 2026
- Update docs/spec.md and skills/setup/SKILL.md to reference login keychain instead of system keychain (finding #1) - Use distinct CN "devproxy Test CA" in roundtrip test to avoid colliding with real devproxy CAs in the login keychain (finding #3) - Update e2e test to accept trust success (no longer requires sudo fallback output since login keychain trust succeeds without sudo) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Created a POSIX shell install script (
install.sh) and comprehensive test suite (tests/test_install.sh) for downloading pre-built devproxy binaries from GitHub Releases. The install script detects OS/arch, constructs the correct download URL, supports curl/wget fallback, and allows configuration viaDEVPROXY_VERSION,DEVPROXY_INSTALL_DIR, andDEVPROXY_INSTALL_BASE_URLenvironment variables. Updatedjustfilewith atest-installrecipe andREADME.mdwith install instructions.Test Plan
sh -n install.sh-- no syntax errorsjust test-install-- 16/16 tests passed (6 platform detection, 2 unsupported OS/arch errors, 3 URL construction, 3 full e2e with mock server, 1 download 404 handling, 1 missing downloader)just check-- 23 unit tests passed, 6 e2e tests passed, clippy cleanResidual Issues
cpandchmodin install flow (cosmetic)🤖 Generated with Claude Code