Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 2 additions & 24 deletions .github/workflows/code_interpreter_js_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@ on:
required: false
type: string
default: ''
run_recovery_tests:
required: false
type: boolean
default: true
node-only:
description: 'Run only the Node leg (skip Bun, Deno and Cloudflare)'
required: false
type: boolean
default: false
secrets:
E2B_API_KEY:
required: true
Expand All @@ -35,15 +26,8 @@ jobs:
# Each runtime keeps one live-test worker. This matrix has four legs, so
# it naturally stays below the shared six-job cap.
max-parallel: 6
# With node-only (set by staging callers) the matrix collapses to the
# Node leg: the other legs re-run the suite the Node leg already covers
# and add sandbox load without extra backend signal, so the other
# runtimes are exercised against production only.
matrix:
runtime: >-
${{ inputs.node-only
&& fromJSON('["node"]')
|| fromJSON('["node", "bun", "deno", "cloudflare"]') }}
runtime: [node, bun, deno, cloudflare]
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
Expand Down Expand Up @@ -95,20 +79,14 @@ jobs:
with:
deno-version: 'v${{ env.TOOL_VERSION_DENO }}'

# The interrupt suite exercises sandbox recovery paths that staging
# cannot serve, so callers can opt out of it.
- name: Run test suite under ${{ matrix.runtime }}
run: |
case "${{ matrix.runtime }}" in
node) script=test ;;
cloudflare) script=test:cf ;;
*) script=test:${{ matrix.runtime }} ;;
esac
if [[ "${{ inputs.run_recovery_tests }}" == "true" ]]; then
pnpm "$script"
else
pnpm "$script" --exclude tests/interrupt.test.ts
fi
pnpm "$script"
env:
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
E2B_DOMAIN: ${{ inputs.E2B_DOMAIN }}
Expand Down
13 changes: 1 addition & 12 deletions .github/workflows/code_interpreter_python_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ on:
required: false
type: string
default: ''
run_recovery_tests:
required: false
type: boolean
default: true
secrets:
E2B_API_KEY:
required: true
Expand Down Expand Up @@ -51,14 +47,7 @@ jobs:
run: uv build

- name: Run tests
run: |
if [[ "${{ inputs.run_recovery_tests }}" == "true" ]]; then
uv run pytest --verbose --numprocesses=1
else
uv run pytest --verbose --numprocesses=1 \
--ignore=tests/async/test_async_interrupt.py \
--ignore=tests/sync/test_interrupt.py
fi
run: uv run pytest --verbose --numprocesses=1
env:
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
E2B_DOMAIN: ${{ inputs.E2B_DOMAIN }}
18 changes: 4 additions & 14 deletions .github/workflows/desktop_js_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ on:
required: false
type: string
default: ''
run_tests:
required: false
type: boolean
default: true
secrets:
E2B_API_KEY:
required: true
Expand All @@ -24,19 +20,14 @@ jobs:
run:
working-directory: ./packages/desktop-js
shell: bash
name: Desktop JS SDK - ${{ inputs.run_tests && matrix.runtime || 'build' }}
name: Desktop JS SDK - ${{ matrix.runtime }}
strategy:
fail-fast: false
# Each runtime keeps one live-test worker. This matrix has four legs, so
# it naturally stays below the shared six-job cap.
max-parallel: 6
# Callers that only build (staging) collapse the matrix to a single job;
# the runtime legs are exercised against production.
matrix:
runtime: >-
${{ inputs.run_tests
&& fromJSON('["node", "bun", "deno", "cloudflare"]')
|| fromJSON('["node"]') }}
runtime: [node, bun, deno, cloudflare]
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
Expand Down Expand Up @@ -77,21 +68,20 @@ jobs:
run: pnpm build

- name: Install Bun
if: inputs.run_tests && matrix.runtime == 'bun'
if: matrix.runtime == 'bun'
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: '${{ env.TOOL_VERSION_BUN }}'

- name: Install Deno
if: inputs.run_tests && matrix.runtime == 'deno'
if: matrix.runtime == 'deno'
uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2.0.5
with:
deno-version: 'v${{ env.TOOL_VERSION_DENO }}'

# Every leg runs the same suite; the cloudflare one inside workerd
# (vitest-pool-workers).
- name: Run test suite under ${{ matrix.runtime }}
if: inputs.run_tests
run: |
case "${{ matrix.runtime }}" in
node) script=test ;;
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/desktop_python_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ on:
required: false
type: string
default: ''
run_tests:
required: false
type: boolean
default: true
secrets:
E2B_API_KEY:
required: true
Expand Down Expand Up @@ -51,7 +47,6 @@ jobs:
run: uv build

- name: Run tests
if: inputs.run_tests
run: uv run pytest --verbose --numprocesses=4
env:
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
Expand Down
31 changes: 15 additions & 16 deletions .github/workflows/js_sdk_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ on:
required: false
type: string
default: ''
node-only:
description: 'Run only the Node legs (skip Bun, Deno, Cloudflare, and the browser)'
required: false
type: boolean
default: false
secrets:
E2B_API_KEY:
required: true
Expand All @@ -32,18 +27,22 @@ jobs:
# can run together without restoring Vitest's default worker
# multiplication.
max-parallel: 7
# With node-only (set by staging callers) the matrix collapses to the
# Node legs: the Bun/Deno/Cloudflare/browser legs re-run suites the Node
# legs already cover and add sandbox/build load, so the other runtimes
# are exercised against production only. Note this does drop backend
# signal for the browser leg specifically — it's the only one that
# depends on the API's CORS headers — so a staging-only CORS regression
# surfaces on the production run rather than before merge.
matrix:
include: >-
${{ inputs.node-only
&& fromJSON('[{"runtime": "node", "os": "ubuntu-22.04"}, {"runtime": "node", "os": "windows-latest"}]')
|| fromJSON('[{"runtime": "node", "os": "ubuntu-22.04"}, {"runtime": "node", "os": "windows-latest"}, {"runtime": "bun", "os": "ubuntu-22.04"}, {"runtime": "deno", "os": "ubuntu-22.04"}, {"runtime": "cloudflare", "os": "ubuntu-22.04"}, {"runtime": "cloudflare-deploy", "os": "ubuntu-22.04"}, {"runtime": "browser", "os": "ubuntu-22.04"}]') }}
include:
- runtime: node
os: ubuntu-22.04
- runtime: node
os: windows-latest
- runtime: bun
os: ubuntu-22.04
- runtime: deno
os: ubuntu-22.04
- runtime: cloudflare
os: ubuntu-22.04
- runtime: cloudflare-deploy
os: ubuntu-22.04
- runtime: browser
os: ubuntu-22.04
runs-on: ${{ matrix.os }}
env:
E2B_TEST_MAX_WORKERS: 1
Expand Down
100 changes: 10 additions & 90 deletions .github/workflows/sdk_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,141 +113,61 @@ jobs:
- 'packages/dockerfile-utils-python/**/!(*.md)'

js-tests:
name: Production / JS SDK Tests
name: JS SDK Tests
needs: changes
if: ${{ needs.changes.outputs.js == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/js_sdk_tests.yml
secrets:
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}

python-tests:
name: Production / Python SDK Tests
name: Python SDK Tests
needs: changes
if: ${{ needs.changes.outputs.python == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/python_sdk_tests.yml
secrets:
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}

cli-tests:
name: Production / CLI Tests
name: CLI Tests
needs: changes
if: ${{ needs.changes.outputs.cli == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/cli_tests.yml
secrets:
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}

code-interpreter-js-tests:
name: Production / Code Interpreter JS SDK Tests
name: Code Interpreter JS SDK Tests
needs: changes
if: ${{ needs.changes.outputs.code_interpreter_js == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/code_interpreter_js_tests.yml
secrets:
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}

code-interpreter-python-tests:
name: Production / Code Interpreter Python SDK Tests
name: Code Interpreter Python SDK Tests
needs: changes
if: ${{ needs.changes.outputs.code_interpreter_python == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/code_interpreter_python_tests.yml
secrets:
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}

desktop-js-tests:
name: Production / Desktop JS SDK Tests
name: Desktop JS SDK Tests
needs: changes
if: ${{ needs.changes.outputs.desktop_js == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/desktop_js_tests.yml
secrets:
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}

desktop-python-tests:
name: Production / Desktop Python SDK Tests
name: Desktop Python SDK Tests
needs: changes
if: ${{ needs.changes.outputs.desktop_python == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/desktop_python_tests.yml
secrets:
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}

js-tests-staging:
name: Staging / JS SDK Tests
needs: changes
if: ${{ needs.changes.outputs.js == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/js_sdk_tests.yml
with:
E2B_DOMAIN: ${{ vars.E2B_DOMAIN_STAGING }}
# Staging only checks backend compatibility, so the Node legs suffice;
# Bun/Deno/Cloudflare runtime coverage runs against production above.
node-only: true
secrets:
E2B_API_KEY: ${{ secrets.E2B_API_KEY_STAGING }}

python-tests-staging:
name: Staging / Python SDK Tests
needs: changes
if: ${{ needs.changes.outputs.python == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/python_sdk_tests.yml
with:
E2B_DOMAIN: ${{ vars.E2B_DOMAIN_STAGING }}
secrets:
E2B_API_KEY: ${{ secrets.E2B_API_KEY_STAGING }}

cli-tests-staging:
name: Staging / CLI Tests
needs: changes
if: ${{ needs.changes.outputs.cli == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/cli_tests.yml
with:
E2B_DOMAIN: ${{ vars.E2B_DOMAIN_STAGING }}
secrets:
E2B_API_KEY: ${{ secrets.E2B_API_KEY_STAGING }}

code-interpreter-js-tests-staging:
name: Staging / Code Interpreter JS SDK Tests
needs: changes
if: ${{ needs.changes.outputs.code_interpreter_js == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/code_interpreter_js_tests.yml
with:
E2B_DOMAIN: ${{ vars.E2B_DOMAIN_STAGING }}
run_recovery_tests: false
# Staging only checks backend compatibility, so the Node leg suffices;
# Bun/Deno runtime coverage runs against production above.
node-only: true
secrets:
E2B_API_KEY: ${{ secrets.E2B_API_KEY_STAGING }}

code-interpreter-python-tests-staging:
name: Staging / Code Interpreter Python SDK Tests
needs: changes
if: ${{ needs.changes.outputs.code_interpreter_python == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/code_interpreter_python_tests.yml
with:
E2B_DOMAIN: ${{ vars.E2B_DOMAIN_STAGING }}
run_recovery_tests: false
secrets:
E2B_API_KEY: ${{ secrets.E2B_API_KEY_STAGING }}

desktop-js-tests-staging:
name: Staging / Desktop JS SDK Tests
needs: changes
if: ${{ needs.changes.outputs.desktop_js == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/desktop_js_tests.yml
with:
E2B_DOMAIN: ${{ vars.E2B_DOMAIN_STAGING }}
run_tests: false
secrets:
E2B_API_KEY: ${{ secrets.E2B_API_KEY_STAGING }}

desktop-python-tests-staging:
name: Staging / Desktop Python SDK Tests
needs: changes
if: ${{ needs.changes.outputs.desktop_python == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ./.github/workflows/desktop_python_tests.yml
with:
E2B_DOMAIN: ${{ vars.E2B_DOMAIN_STAGING }}
run_tests: false
secrets:
E2B_API_KEY: ${{ secrets.E2B_API_KEY_STAGING }}

dockerfile-utils-js-tests:
name: Dockerfile Utils JS Tests
needs: changes
Expand Down Expand Up @@ -282,11 +202,11 @@ jobs:
run: |
echo "Job results: ${{ join(needs.*.result, ', ') }}"
if ${{ contains(needs.*.result, 'failure') }}; then
echo "::error::Change detection or a Production SDK test suite failed."
echo "::error::Change detection or an SDK test suite failed."
exit 1
fi
if ${{ contains(needs.*.result, 'cancelled') }}; then
echo "::error::Change detection or a Production SDK test suite was cancelled; tests were not verified — re-run before merging."
echo "::error::Change detection or an SDK test suite was cancelled; tests were not verified — re-run before merging."
exit 1
fi
echo "All Production SDK test suites passed or were skipped."
echo "All SDK test suites passed or were skipped."
Loading