Skip to content
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

test: fix embedding test for Windows #53659

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vmoroz
Copy link
Member

@vmoroz vmoroz commented Jun 30, 2024

PR #52905 had added a new test case for embedding test which was failing for Windows.
The reason was that the expected error message has the Posix-specific line ending \n while on Windows the output string contains \r\n:

stderr: `${binary}: NODE_REPL_EXTERNAL_MODULE can't be used with kDisableNodeOptionsEnv\n`,

PR #52905 temporary disabled this new test case for Windows.

This PR removes the temporary test disablement for Windows and implements the fix by replacing \r\n in the the output string with \n before comparison.
After this change the embedding test is passing for Windows.

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Jun 30, 2024
@anonrig anonrig added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Jun 30, 2024
@vmoroz vmoroz added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Jun 30, 2024
Copy link
Member

@joyeecheung joyeecheung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM although I think it's fine to simply use a looser regexp in test-embedding.js and just match

stderr: /NODE_REPL_EXTERNAL_MODULE can't be used with kDisableNodeOptionsEnv/
@vmoroz
Copy link
Member Author

vmoroz commented Jul 1, 2024

LGTM although I think it's fine to simply use a looser regexp in test-embedding.js and just match

stderr: /NODE_REPL_EXTERNAL_MODULE can't be used with kDisableNodeOptionsEnv/

Thanks! I had considered it initially, but decided on the str.replaceAll solution mostly to avoid similar issues in future. Developers who do not have access to Windows machines can use the \n in any other tests and not to be blocked anymore.

@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 3, 2024
@vmoroz vmoroz added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 12, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 12, 2024
@vmoroz vmoroz force-pushed the PR/fix_embdedtest_on_windows branch from 8632afa to e747896 Compare July 12, 2024 15:05
@vmoroz vmoroz added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 12, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.
9 participants