Conversation
… tests Replace external httpbin.org dependency with a local Python HTTP server for the generate tool-stub e2e tests. This makes the tests more reliable, faster, and eliminates external network dependencies. Changes: - Add tool_stub_test_server.py: A lightweight HTTP server that mocks the httpbin.org endpoints (/status/200, /status/201, /status/202, /json) needed for tool-stub testing - Update test_generate_tool_stub to start the local server on a dynamic port before running tests - Replace all httpbin.org URLs with local server URLs (http://127.0.0.1:$SERVER_PORT) The test server follows the same pattern used in other e2e tests (test_http_compressed_binaries, test_task_standalone) for consistency. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull Request Overview
This PR replaces external httpbin.org dependencies with a local Python HTTP server for the generate tool-stub e2e tests. This change improves test reliability by eliminating external network dependencies and potential rate limiting issues.
Key changes:
- Added a local HTTP test server that mocks httpbin.org endpoints
- Updated all test URLs to use the local server instead of external httpbin.org
- Implemented proper server lifecycle management with cleanup on exit
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| e2e/helpers/scripts/tool_stub_test_server.py | New Python HTTP server that mocks httpbin.org endpoints needed for testing |
| e2e/generate/test_generate_tool_stub | Updated test script to use local server instead of external httpbin.org URLs |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| def start_server(port): | ||
| """Start the HTTP test server""" | ||
| with socketserver.TCPServer(("127.0.0.1", port), ToolStubTestHandler) as httpd: |
There was a problem hiding this comment.
TCPServer doesn't handle multiple concurrent connections well by default. Consider using socketserver.ThreadingTCPServer instead to handle concurrent requests during testing.
| with socketserver.TCPServer(("127.0.0.1", port), ToolStubTestHandler) as httpd: | |
| with socketserver.ThreadingTCPServer(("127.0.0.1", port), ToolStubTestHandler) as httpd: |
|
|
||
| # Ensure cleanup on exit | ||
| cleanup() { | ||
| kill "$SERVER_PID" 2>/dev/null || true |
There was a problem hiding this comment.
The cleanup function should verify the server process actually terminates. Consider adding a wait period or using kill -0 to check if the process is still running after the kill attempt.
| kill "$SERVER_PID" 2>/dev/null || true | |
| kill "$SERVER_PID" 2>/dev/null || true | |
| # Wait up to 5 seconds for process to terminate | |
| for i in {1..10}; do | |
| if ! kill -0 "$SERVER_PID" 2>/dev/null; then | |
| break | |
| fi | |
| sleep 0.5 | |
| done | |
| if kill -0 "$SERVER_PID" 2>/dev/null; then | |
| echo "Warning: server process $SERVER_PID did not terminate after kill" >&2 | |
| fi |
| # Wait for server to start | ||
| sleep 1 |
There was a problem hiding this comment.
The fixed sleep duration may be unreliable on slower systems. Consider implementing a proper health check by attempting to connect to the server or checking for a specific response before proceeding with tests.
| # Wait for server to start | |
| sleep 1 | |
| # Wait for server to start (health check) | |
| for i in {1..20}; do | |
| if curl -s "http://127.0.0.1:$SERVER_PORT/status/200" >/dev/null; then | |
| break | |
| fi | |
| sleep 0.5 | |
| done | |
| # If still not up, fail | |
| if ! curl -s "http://127.0.0.1:$SERVER_PORT/status/200" >/dev/null; then | |
| echo "Error: Test server did not start in time" >&2 | |
| exit 1 | |
| fi |
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.9.24 x -- echo |
15.3 ± 0.5 | 14.4 | 20.0 | 1.00 |
mise x -- echo |
15.5 ± 0.4 | 14.4 | 17.0 | 1.01 ± 0.04 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.9.24 env |
14.7 ± 0.4 | 14.1 | 19.1 | 1.00 |
mise env |
14.9 ± 0.4 | 14.1 | 17.8 | 1.01 ± 0.04 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.9.24 hook-env |
14.6 ± 0.3 | 13.9 | 15.9 | 1.00 |
mise hook-env |
14.7 ± 0.3 | 13.9 | 16.8 | 1.01 ± 0.03 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.9.24 ls |
13.5 ± 0.4 | 12.7 | 15.7 | 1.00 |
mise ls |
13.6 ± 0.3 | 12.9 | 14.7 | 1.01 ± 0.04 |
xtasks/test/perf
| Command | mise-2025.9.24 | mise | Variance |
|---|---|---|---|
| install (cached) | 132ms | ✅ 78ms | +69% |
| ls (cached) | 53ms | 53ms | +0% |
| bin-paths (cached) | 55ms | 56ms | -1% |
| task-ls (cached) | 368ms | 376ms | -2% |
✅ Performance improvement: install cached is 69%
### 🐛 Bug Fixes - **(auto-install)** support installing non-active backend versions by @jdx in [#6484](#6484) - **(task)** prevent hang when tasks with multiple dependencies fail by @stempler in [#6481](#6481) ### 🧪 Testing - **(e2e)** use local HTTP server instead of httpbin.org for tool-stub tests by @jdx in [#6488](#6488) ### New Contributors - @stempler made their first contribution in [#6481](#6481) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Bumps to 2025.9.25 with changelog updates (bug fixes, testing), adds `mdsf` to the aqua registry, and updates completions and packaging metadata. > > - **Release v2025.9.25** > - Update versions in `Cargo.toml`, `Cargo.lock`, `default.nix`, `packaging/rpm/mise.spec`, and `README.md`. > - Refresh shell completion cache spec filenames in `completions/_mise`, `completions/mise.bash`, and `completions/mise.fish`. > - Expand `CHANGELOG.md` with 2025.9.25 entry (bug fixes and testing notes). > - **Registry** > - Add `hougesen/mdsf` package: `crates/aqua-registry/aqua-registry/pkgs/hougesen/mdsf/registry.yaml`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6debaab. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: mise-en-dev <release@mise.jdx.dev>
Summary
httpbin.orgdependency with a local Python HTTP server for the generate tool-stub e2e teststool_stub_test_server.py: A lightweight HTTP server that mocks the httpbin.org endpoints needed for testingBenefits
test_http_compressed_binaries,test_task_standalone)Test plan
mise run test:e2e test_generate_tool_stub🤖 Generated with Claude Code
Note
Replace httpbin.org dependencies in tool-stub e2e tests with a local Python HTTP server, updating test URLs and adding a mock server script.
e2e/generate/test_generate_tool_stub):https://httpbin.org/...withhttp://127.0.0.1:$SERVER_PORT/...across tests; update corresponding assertions.hello-stubURL to local/json; retain real GitHub release test.e2e/helpers/scripts/tool_stub_test_server.py/status/200,/status/201,/status/202, and/jsonendpoints; silent logging.Written by Cursor Bugbot for commit 8a3f960. This will update automatically on new commits. Configure here.