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

[BUG] Unable to generate test class on Windows (test class generation script bugs) #988

Open
3 tasks done
utybo opened this issue Dec 29, 2023 · 0 comments · May be fixed by #990
Open
3 tasks done

[BUG] Unable to generate test class on Windows (test class generation script bugs) #988

utybo opened this issue Dec 29, 2023 · 0 comments · May be fixed by #990
Labels
bug something not go good

Comments

@utybo
Copy link
Contributor

utybo commented Dec 29, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Have you read the CONTRIBUTING guide on posting bugs, and CODE_OF_CONDUCT?

  • yes I read the things

This issue exists in the latest tap version

  • I am using the latest tap

Description

There are two issues in the src/test/scripts/build.mts that lead to being unable to generate the test class on Windows:

  • The call to npm run prepare fails silently if it fails
  • On platforms that do not have a literal npm available on the path (i.e. Windows, which has a npm.cmd instead), the script fails with a ENOENT, which is never shown to the user

Because a) the fail is silent and b) there is an existing test-built in the packages distributed on npm, this leads to the user being able to run tests but unable to install 3rd-party plugins.

The fixes are respectively:

  • Add a check on the result of spawnSync and fail if the script if something happens
  • Use cross-spawn instead of Node's spawn, or manually add a .cmd if on Windows

Reproduction

Main symptom:

  • On Windows Install a plugin via your package manager, add it to your config manually
  • Run tap build
  • Run console.log(t.pluginSignature) in a test file

Your plugin will not be there.

Environment

On Windows, latest tap

@utybo utybo added the bug something not go good label Dec 29, 2023
@utybo utybo linked a pull request Dec 29, 2023 that will close this issue
isaacs added a commit that referenced this issue Jan 19, 2024
Re: #988

Similar to #990, but without adding cross-spawn as a dep.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something not go good
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant