Add stderr output to npm pack and other executeCommand calls for better debugging #682
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When
npm packor other commands fail during integration tests, the error messages only show exit codes without any stderr output, making it difficult to debug the actual cause of failures.Solution
This PR adds
stderr: 'pipe'to allexecuteCommandcalls in the integration test setup files and enhances error messages to include stderr output when commands fail.Changes
In
src/tests/integration/lib/adapterSetup.ts:npm pack- Now captures stderr and includes it in error messages (main issue fix)npm uninstall- Now captures stderr for debuggingnpm install- Now captures stderr for debuggingnode add adapter- Now captures stderr and includes it in error messagesIn
src/tests/integration/lib/controllerSetup.ts:npm install(controller) - Now captures stderr for debuggingnode stop- Now captures stderr for debuggingnode setup first- Now captures stderr and includes it in error messagesExample
Before this change, when
npm packfailed, users would see:After this change, they will see:
Testing
Fixes the issue raised in https://github.com/ioBroker/testing/blame/53c18912d6c1b3aa73eedfb6c6439079adcaa359/src/tests/integration/lib/adapterSetup.ts#L52
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.