Skip to content

test(cli): remove duplicate, dead-code and vacuous CLI tests - #2141

Merged
mishushakov merged 2 commits into
mainfrom
devin/1794604309-prune-cli-tests
Nov 13, 2026
Merged

mishushakov merged 2 commits into
mainfrom
devin/1794604309-prune-cli-tests

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Applied the TDD skill (skills/tdd/SKILL.md) to packages/cli/tests and removed tests that don't catch any regression the remaining suite wouldn't. Tests only, plus deletion of dead helpers, so no changeset needed.

Dead code (tests + source removed)

  • readStdinIfPiped / readStdinFrom in exec_helpers.ts have had no production caller since exec switched to streamStdinChunks. Deleted them and their 5 tests.
  • chunkBytesBySize is now module-private. Its 5 direct tests duplicated the streamStdinChunks splitting and empty-chunk tests; maxBytes is a constant in production.

Duplicates

  • sandbox/list.test.ts: dropped the JSON default-asc sort and "does not mutate input" tests. The table-path locale/tie-break/desc tests already go through sortSandboxes. Also dropped startedAt === startedAt.toLocaleString(), which just restated the implementation, and renamed that test to "formats state and metadata for display".
  • create_lifecycle.test.ts: "lifecycle and timeout together" combined two mappings already tested on their own. "omits empty envs" was already asserted by the explicit-timeout test.
  • fork.test.ts: dropped --count 101; 21 already covers values above the max.

Vacuous / never-run integration code

  • backend_integration.test.ts "exec runs a command with piped stdin" accepted either 6 or 0, so it could not fail. Real piping coverage lives in exec_pipe.test.ts.
  • exec_pipe.test.ts: removed the binary_random_sha256 case. It only ran behind E2B_PIPE_INTEGRATION_STRICT/BINARY/STRICT, which no workflow sets, and binary_nul_ff_hex already covers binary.
  • Both integration files read userConfig.E2B_DOMAIN / userConfig.domain, fields that don't exist on UserConfig. Simplified to process.env.E2B_DOMAIN || 'e2b.app'.

Net: 265 → 249 tests. Offline, everything passes except template/create.test.ts, which fails the same way on main without E2B_API_KEY. backend_integration and exec_pipe were also run live with a key and passed.

Kept after review: the auth.test.ts stale-lock test, because it is the only test that runs the production CONFIG_LOCK. Also the table-path buildTableRows(..., 'desc') test.

Not changed (follow-up candidates): exec_passthrough, exec_stdin_flag, exec_close_stdin, create_lifecycle and project.test.ts mock the CLI's own modules (exec_helpers, src/terminal, src/utils/urls, src/api). They cover real behavior, but they are coupled to internals and would be better rewritten against a local HTTP server, as attribution.test.ts and template/delete.test.ts already do.

Link to Devin session: https://app.devin.ai/sessions/ba0ccf3e32064be4ad6191007b87c968
Open in Devin Desktop: https://app.devin.ai/desktop/session/ba0ccf3e32064be4ad6191007b87c968?variant=devin
Requested by: @mishushakov


🟢 Devin Review found nothing to fix · View findings

Devin Review

Co-Authored-By: mish@e2b.dev <mish@e2b.dev>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@cla-bot cla-bot Bot added the cla-signed label Nov 13, 2026
@changeset-bot

changeset-bot Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ad7ce5e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mishushakov
mishushakov marked this pull request as ready for review November 13, 2026 21:13
@mishushakov
mishushakov self-requested a review as a code owner November 13, 2026 21:13
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T21:15:14.995805Z cb76f8c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Package Artifacts

Built from c5d16df. Download artifacts from this workflow run.

JS SDK (e2b@2.64.1-devin-1794604309-prune-cli-tests.0, with @e2b/dockerfile-utils@0.1.3-devin-1794604309-prune-cli-tests.0):

npm install ./e2b-dockerfile-utils-0.1.3-devin-1794604309-prune-cli-tests.0.tgz ./e2b-2.64.1-devin-1794604309-prune-cli-tests.0.tgz

CLI (@e2b/cli@2.24.1-devin-1794604309-prune-cli-tests.0):

npm install ./e2b-cli-2.24.1-devin-1794604309-prune-cli-tests.0.tgz

Code Interpreter JS SDK (@e2b/code-interpreter@2.9.2-devin-1794604309-prune-cli-tests.0):

npm install ./e2b-code-interpreter-2.9.2-devin-1794604309-prune-cli-tests.0.tgz

Desktop JS SDK (@e2b/desktop@2.5.1-devin-1794604309-prune-cli-tests.0):

npm install ./e2b-desktop-2.5.1-devin-1794604309-prune-cli-tests.0.tgz

Python SDK (e2b==2.64.0+devin.1794604309.prune.cli.tests, with e2b-dockerfile-utils==0.1.2+devin.1794604309.prune.cli.tests):

pip install ./e2b_dockerfile_utils-0.1.2+devin.1794604309.prune.cli.tests-py3-none-any.whl ./e2b-2.64.0+devin.1794604309.prune.cli.tests-py3-none-any.whl

Code Interpreter Python SDK (e2b-code-interpreter==2.11.10+devin.1794604309.prune.cli.tests):

pip install ./e2b_code_interpreter-2.11.10+devin.1794604309.prune.cli.tests-py3-none-any.whl

Desktop Python SDK (e2b-desktop==2.7.2+devin.1794604309.prune.cli.tests):

pip install ./e2b_desktop-2.7.2+devin.1794604309.prune.cli.tests-py3-none-any.whl

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TASTE.md review: no violations (0). Checked T-49/T-50 (the new process.env.E2B_DOMAIN || 'e2b.app' treats an empty env var as unset), T-59/T-63 (chunkBytesBySize is now module-private, so its plain Error falls under the internal-helper exemption) and T-54 (the removed exec_helpers exports were never part of a package entry point). The rest of the diff only deletes tests.

Written by Devin

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.

Apart from the inline findings, I checked two other things and neither is a problem.

  • The removed exec_helpers exports have no importers left in packages/, and the CLI package publishes only a bin entry. Removing them doesn't change the public surface, so no changeset is needed.
  • The integration tests no longer read the domain from ~/.e2b/config.json. This loses nothing: UserConfig (src/user.ts) has no E2B_DOMAIN or domain field, so that fallback could never supply a value.
Extended reasoning...

This change deletes tests in packages/cli and removes dead stdin helpers from exec_helpers.ts. It touches no security-sensitive production code paths. The inline findings already cover the coverage gaps, so this note only records the concerns that were checked and ruled out.

Comment thread packages/cli/tests/auth.test.ts Resolved
@mishushakov

Copy link
Copy Markdown
Member

check findings ^

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Both findings were valid and are fixed in ad7ce5e:

  • I restored the auth.test.ts stale-lock test, because it is the only test that runs the production CONFIG_LOCK.
  • I restored the buildTableRows(..., 'desc') table test, because it is the only test that sends --order through the table path.

I didn't put back the toLocaleString() check: it just recomputes what the code does. That test is now named "formats state and metadata for display".

@mishushakov
mishushakov merged commit 6dc8d5a into main Nov 13, 2026
26 checks passed
@mishushakov
mishushakov deleted the devin/1794604309-prune-cli-tests branch November 13, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant