test: log the sandbox ID for every sandbox fixture - #1866
test: log the sandbox ID for every sandbox fixture#1866devin-ai-integration[bot] wants to merge 3 commits into
Conversation
Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Package ArtifactsBuilt from 1610ea2. Download artifacts from this workflow run. JS SDK ( npm install ./e2b-2.49.1-devin-1789052412-log-sandbox-id.0.tgzCLI ( npm install ./e2b-cli-2.19.1-devin-1789052412-log-sandbox-id.0.tgzCode Interpreter JS SDK ( npm install ./e2b-code-interpreter-2.8.1-devin-1789052412-log-sandbox-id.0.tgzDesktop JS SDK ( npm install ./e2b-desktop-2.4.1-devin-1789052412-log-sandbox-id.0.tgzPython SDK ( pip install ./e2b-2.49.0+devin.1789052412.log.sandbox.id-py3-none-any.whlCode Interpreter Python SDK ( pip install ./e2b_code_interpreter-2.10.0+devin.1789052412.log.sandbox.id-py3-none-any.whlDesktop Python SDK ( pip install ./e2b_desktop-2.5.0+devin.1789052412.log.sandbox.id-py3-none-any.whl |
There was a problem hiding this comment.
Checked the diff against TASTE.md (e2b-dev/sdk-harness): the document governs the public API surface of packages/js-sdk and packages/python-sdk — parity (T-1/T-2), API shape (T-3–T-25), streaming/handles (T-26–T-30), lifecycle (T-31–T-36), naming/casing (T-10–T-12, T-22–T-23), errors (T-57–T-64), deprecation (T-65–T-68), and docs (T-69–T-74).
Violations found: 0. The PR only changes test infrastructure (packages/js-sdk/tests/setup.ts, packages/js-sdk/vitest.config.mts, packages/python-sdk/tests/conftest.py) — it touches no public API surface, so none of the rules apply. Minor notes, not violations: both SDKs emit the same sandbox_id= label, which is consistent; JS relies on the CI-only verbose reporter while Python always writes via a custom reporter plugin, so the two harnesses surface the ID through different mechanics (test-infra divergence, outside TASTE scope).
Summary
The sandbox fixtures in
js-sdkandpython-sdkonly printed the sandbox ID after a test had failed ([TEST FAILED] Sandbox ID: …), so the ID was missing for passing, slow, or timed-out tests, and in pytest also when a later fixture failed during setup (the_test_failedflag was only set for thecallphase). Every sandbox created by a fixture is now reported, in every outcome.Python — instead of printing in teardown, the factories attach the ID to the test report and a tiny plugin prints it next to the result line on the controller.
user_propertiesis what makes this work underpytest-xdist: captured stdout of a worker is only shown for failures, while report properties are always forwarded.JS — the fixture does
console.log(\sandbox_id=${sandbox.sandboxId}`)right afterSandbox.create. Vitest's default reporter only replays console output for failed tests, sopackages/js-sdk/vitest.config.mtsswitches to['verbose', 'github-actions']whenGITHUB_ACTIONS` is set; local runs keep the default reporter (IDs still appear for failures).Not covered: tests that call
Sandbox.createdirectly instead of using the fixtures, and thecode-interpreter-*/desktop-*package fixtures.Link to Devin session: https://app.devin.ai/sessions/cf4d5f1653574607b936e276b2acb02a
Open in Devin Desktop: https://app.devin.ai/desktop/session/cf4d5f1653574607b936e276b2acb02a?variant=devin
Requested by: @mishushakov