Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 5, 2025

Problem

When npm pack or 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 all executeCommand calls 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 debugging
  • npm install - Now captures stderr for debugging
  • node add adapter - Now captures stderr and includes it in error messages

In src/tests/integration/lib/controllerSetup.ts:

  • npm install (controller) - Now captures stderr for debugging
  • node stop - Now captures stderr for debugging
  • node setup first - Now captures stderr and includes it in error messages

Example

Before this change, when npm pack failed, users would see:

Error: Packing the adapter tarball failed!

After this change, they will see:

Error: Packing the adapter tarball failed!
stderr: npm ERR! Invalid package.json: "version" field is required

Testing

  • ✅ All existing tests pass
  • ✅ TypeScript compilation successful
  • ✅ Linting passes
  • ✅ Manual verification confirms stderr capture works correctly
  • ✅ No breaking changes - only adds additional debugging information

Fixes the issue raised in https://github.com/ioBroker/testing/blame/53c18912d6c1b3aa73eedfb6c6439079adcaa359/src/tests/integration/lib/adapterSetup.ts#L52

Original prompt

This section details on the original issue you should resolve

<issue_title>Add error output to npm pack</issue_title>
<issue_description>To debug issues with npm pack, it would be good to also have stderr piped to the console:

https://github.com/ioBroker/testing/blame/53c18912d6c1b3aa73eedfb6c6439079adcaa359/src/tests/integration/lib/adapterSetup.ts#L52

Please also check other places that don't have both forwarded yet.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #681

💡 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.

Copilot AI changed the title [WIP] Add error output to npm pack Add stderr output to npm pack and other executeCommand calls for better debugging Oct 5, 2025
Copilot AI requested a review from Apollon77 October 5, 2025 07:48
Copilot finished work on behalf of Apollon77 October 5, 2025 07:48
@Apollon77 Apollon77 marked this pull request as ready for review October 12, 2025 12:11
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.

Add error output to npm pack

2 participants