-
Notifications
You must be signed in to change notification settings - Fork 296
[WIP] Fix tests to use index.js #15628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -53,7 +53,7 @@ cat /tmp/copilot-client-test/config.json | |||||
| # Run the client with debug logging | ||||||
| echo "" | ||||||
| echo "Running copilot-client..." | ||||||
| DEBUG=copilot-client cat /tmp/copilot-client-test/config.json | node dist/cli.js | ||||||
| DEBUG=copilot-client cat /tmp/copilot-client-test/config.json | node -e "import('./dist/index.js').then(m => m.main())" | ||||||
|
||||||
| DEBUG=copilot-client cat /tmp/copilot-client-test/config.json | node -e "import('./dist/index.js').then(m => m.main())" | |
| DEBUG=copilot-client node -e 'import("./dist/index.js").then(m => m.main()).catch(err => { console.error(err); process.exit(1); });' < /tmp/copilot-client-test/config.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEBUG=copilot-clientis being set forcatrather than the Node process because of the pipe, so the client won't actually run with debug logging as the comment suggests. Prefer feeding the config via stdin redirection into thenodecommand (or otherwise applyDEBUGtonode), and add a.catch(...)on theimport(...).then(...)chain to ensure module load / execution failures consistently fail the step with a non-zero exit code.