| name | run-e2e |
| description | Run the full end-to-end test suite against a custom sandbox image deployed locally or on Blaxel. Use before merging significant changes to validate the complete sandbox-api binary, not just unit/integration tests. |
Run End-to-End Tests
E2E tests build a real Docker image from the current source, deploy it, and run the test suite against it. This validates the full binary, not just the in-process unit tests.
Architecture
- Custom sandbox:
e2e/custom-sandbox/ — a Docker image that embeds the full sandbox-api source and builds it at image-build time
- Simple custom sandbox:
e2e/simple-custom-sandbox/ — a leaner image that takes a pre-compiled binary
- Test scripts:
e2e/scripts/ — Node.js tests run with npm run test:local
Option 1: Full Local E2E (Build + Run + Test)
make e2e
This single command:
- Removes any existing
sandbox-dev container
- Builds the custom sandbox image (
make build-custom-sandbox)
- Starts the container (
make run-custom-sandbox) on ports 8080-8083
- Waits 5 seconds for startup
- Logs open file descriptors (leak detection)
- Runs the e2e test suite (
make test-custom-sandbox)
- Logs file descriptors again after tests
Note: Watches for file descriptor leaks — the count before and after tests should not grow significantly.
Option 2: Step-by-Step
Build the Custom Sandbox Image
make build-custom-sandbox
Copies sandbox-api/ into e2e/custom-sandbox/ and builds custom-sandbox:latest.
Run It Locally
make run-custom-sandbox
Starts custom-sandbox:latest as sandbox-dev container with ports 8080-8083 exposed.
Run Tests Against It
make test-custom-sandbox
Runs e2e/scripts/npm run test:local against the running container.
Option 3: Deploy to Blaxel and Test
Deploy the custom sandbox to the Blaxel platform, wait for it to be DEPLOYED, then run tests:
make deploy-custom-sandbox
Then wait and test:
make test-custom-sandbox
Option 4: Simple Custom Sandbox (Pre-Compiled Binary)
Compile for Linux first, then deploy:
make deploy-simple-custom-sandbox
This:
- Cross-compiles
sandbox-api for linux/amd64
- Copies the binary to
e2e/simple-custom-sandbox/
- Deploys to Blaxel with
bl deploy
- Cleans up the binary
Useful for faster iteration when you don't need to rebuild the full Docker image.
Troubleshooting
- Build fails: Check
sandbox-api/ compiles cleanly first with make test
- Container exits immediately: Run
docker logs sandbox-dev to see the error
- Tests fail with connection refused: Container may still be starting; increase the sleep or poll
/health
- File descriptor count grows: There is a resource leak in the code path being tested — investigate with
lsof -p <pid> inside the container
bl command not found: Install the Blaxel CLI (brew install blaxel-ai/tap/bl or equivalent)