Skip to content

test: one CLI runner for the tests that execute the built bundle (code, stdout, stderr, diagnostics on failure) #1100

Open

Description

@debugmcpdev

Two doctor tests, two CLI runners. tests/e2e/doctor-smoke.test.ts has its own runCli that resolves { code, stdout, stderr } and rejects only on a spawn failure or a timeout; tests/integration/cli/doctor-codelldb-version.test.ts runs the bundle through promisify(execFile) and, since #1099, rethrows a failure with the exit code, signal, killed flag, stdout and stderr attached. Both shapes are right; having both is the odd part, and the other bare promisify(execFile) test sites would lose their output the same way #1098 did:

  • tests/integration/cli/package-contents.test.ts (tar -czf)
  • tests/e2e/docker/docker-smoke-cobol-attach.test.ts (docker exec)
  • tests/e2e/npx/npx-test-utils.ts (tar -tzf)

Proposal, small: one runCli(command, args, options) in tests/test-utils/helpers/cli-bundle.ts (beside requireCliBundle) returning { code, signal, stdout, stderr }, rejecting only on a spawn failure or a kill with #1099's diagnostic shape (exit code, signal, killed, stdout, stderr, cause), windowsHide: true and a maxBuffer suited to a JSON report. The two doctor tests adopt it; the tar/docker sites can follow when touched. No behaviour change in the tests' assertions — this is about what a failure prints.

Not urgent: nothing fails today. Filed from the #1099 review so the pattern lands in one place instead of five.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions