CI/CD Tests That Don't Flake
Spin up a sandbox per PR. Run unit tests, integration tests, and fuzz paths in true isolation. No shared state, no flaky tests, no "it worked on my machine."
Why Tests Flake in CI
CI environments are shared, messy, and unpredictable:
- ✗Previous test runs leave behind state (files, DBs, caches)
- ✗Parallel jobs interfere with each other
- ✗CI runner environment differs from dev and prod
- ✗Resource contention causes timing-dependent failures
With Hopx Sandboxes
- ✓Fresh micro-VM for every test run — zero leftover state
- ✓Each PR gets its own isolated environment
- ✓Identical to production — deterministic results
- ✓Dedicated resources per sandbox — no contention
Works With Your CI/CD Platform
Hopx integrates with any CI platform. Just call our API from your workflow.
Run Any Type of Test
Unit Tests
Run pytest, jest, go test in isolated environments
Integration Tests
Test with real databases, queues, and services
E2E Tests
Browser testing with Playwright/Selenium
Fuzz Testing
Run fuzzing tools without risking CI infrastructure
Security Scanning
Static analysis and vulnerability scanning
Performance Tests
Benchmark on consistent, isolated hardware
Why Hopx for CI/CD
True Isolation
Each test run gets a fresh micro-VM. No shared state, no flaky tests from leftover data, no interference.
Parallel Execution
Spin up hundreds of sandboxes in parallel. Run your entire test suite faster with ~100ms cold starts.
Identical Environments
Every sandbox is identical to production. No more 'works on my machine' or CI-specific bugs.
Deterministic Results
Same code, same environment, same results. Reproduce any test failure locally or in CI.
Add to Your CI in Minutes
Simple integration with GitHub Actions, GitLab CI, or any CI platform. Just call the Hopx API from your workflow.
Per-PR Isolation
Each pull request gets its own isolated sandbox
Fast Feedback
~100ms cold start means tests run immediately
Safe Execution
Run untrusted code from PRs without risking CI infra
1# GitHub Actions workflow example
2# .github/workflows/test.yml
3
4name: Tests
5on: [push, pull_request]
6
7jobs:
8 test:
9 runs-on: ubuntu-latest
10 steps:
11 - uses: actions/checkout@v4
12
13 - name: Run tests in Hopx sandbox
14 env:
15 HOPX_API_KEY: ${{ secrets.HOPX_API_KEY }}
16 run: |
17 pip install hopx-ai
18 python run_tests.py
19
20# run_tests.py
21from hopx_ai import Sandbox
22import sys
23
24def run_tests_in_sandbox():
25 # Create isolated sandbox
26 sandbox = Sandbox.create(template="code-interpreter")
27
28 # Upload project files
29 sandbox.files.upload("./", "/workspace/project/")
30
31 # Install dependencies
32 result = sandbox.commands.run(
33 "cd /workspace/project && pip install -r requirements.txt"
34 )
35
36 if result.exit_code != 0:
37 print(f"Dependency install failed: {result.stderr}")
38 sys.exit(1)
39
40 # Run tests
41 result = sandbox.commands.run(
42 "cd /workspace/project && pytest tests/ -v --tb=short"
43 )
44
45 print(result.stdout)
46
47 if result.exit_code != 0:
48 print(f"Tests failed: {result.stderr}")
49 sandbox.kill()
50 sys.exit(1)
51
52 # Run linting
53 lint_result = sandbox.commands.run(
54 "cd /workspace/project && ruff check ."
55 )
56
57 print(lint_result.stdout)
58
59 # Cleanup
60 sandbox.kill()
61
62 print("✅ All tests passed!")
63 sys.exit(0)
64
65if __name__ == "__main__":
66 run_tests_in_sandbox()