Skip to content

SP-1090: Assert on real process output and exit codes in integration tests#375

Open
A. Jashari (admirjashari) wants to merge 1 commit into
mainfrom
SP-1090-content-cli-assert-on-real-process-output-and-exit-codes-in-integration-tests
Open

SP-1090: Assert on real process output and exit codes in integration tests#375
A. Jashari (admirjashari) wants to merge 1 commit into
mainfrom
SP-1090-content-cli-assert-on-real-process-output-and-exit-codes-in-integration-tests

Conversation

@admirjashari

@admirjashari A. Jashari (admirjashari) commented Jun 11, 2026

Copy link
Copy Markdown

Description

Changes

  • module-handler.ts: the shared command action wrapper now sets process.exitCode = 1 when a command throws, so errors surface as a non-zero exit code (previously thrown errors were only logged and the process still exited 0). GracefulError is preserved as exit 0.
  • package.manager.ts: fixed a bare process.exit() (exited 0) on an error branch → process.exit(1).

Tests Added

  • Added tests/utls/cli-runner.ts (runCli), which drives a command through the real Commander wiring and captures the actual stdout, stderr, and exit code.
  • Added tests/integration/cli-process-output.spec.ts asserting real output + exit codes for success and failure cases (asset-registry as the agentic-dev surface, plus version/unknown-command/required-option, and the GracefulError vs. regular-error exit-code contract).

Relevant links

Checklist

  • I have self-reviewed this PR
  • I have tested the change and proved that it works in different scenarios
  • I have updated docs if needed

@admirjashari A. Jashari (admirjashari) changed the title SP-1090: assert real CLI output and exit codes; fail commands with non-zero exit SP-1090: Assert on real process output and exit codes in integration tests Jun 11, 2026
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant