-
Notifications
You must be signed in to change notification settings - Fork 46
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
chore: support tests on win32 #408
Conversation
There were significant changes between 18.0.6 and 19.0.1 which I did not have on my system (I should have rebased before). Moving to draft until I resolve those. |
If you remove this line and run Fun fact: that flag was first added to template-oss because of this repo. |
This is quite a big undertaking. Even if we only get partway there it'll be worth landing changes that get us closer. If we can't get tests 100% working in windows we won't be able to enable them in CI, but it'll still be worth "moving the needle" a bit to get closer. |
The const me = t.testdir({
repo: {},
cache: {},
}) to the end of the test file in:
|
The missing coverage in file.js is something we'll need to dig into a little deeper. If there is missing coverage in windows that means we are likely missing something, and the code needs to be cleaned up in some way. Can you explain this one in more depth? What code path is missed? What ends up happening in windows when that function runs? |
This is a decent way to fix the EBUSY errors in Windows when using a tap that uses libtap https://github.com/isaacs/rimraf/blob/main/libtap-settings.js Getting pacote onto the latest tap is one of our follow-up tasks for npm 11. |
Thanks for all the feedback. Looks like It seems If this PR becomes too much, I will split it up. |
Just a heads up that we're landing a breaking change soon. So far it doesn't look like this PR will merge conflict with it, but if it does and you want help sorting it out let us know. |
This was driving me nuts but here's an interesting find: AFAICT, tests based on I think I skipped the |
Hey @mbtools we haven't forgotten about you. We're focusing on a release of npm 10 to address an audit warning, and npm 11 too. |
thanks for the note. no worry. |
Are you comfortable with git rebase? If so can you isolate the addition of |
This avoids the EBUSY issue during "spawn daemon" test mentioned in #408
🤖 I have created a release *beep* *boop* --- ## [21.0.0](v20.0.0...v21.0.0) (2024-11-25) ###⚠️ BREAKING CHANGES * `bun.lockb` files are now included in the strict ignore list during packing * this module is now compatible with the following node versions: ^20.17.0 || >=22.9.0 ### Bug Fixes * [`844dc08`](844dc08) update node engines to ^20.17.0 || >=22.9.0 (#414) (@wraithgar) ### Dependencies * [`2cb6fa7`](2cb6fa7) [#415](#415) `[email protected]` (#415) * [`47b928c`](47b928c) [#412](#412) replace node builtin rmSync with rimraf (#412) (@mbtools) ### Chores * [`b6f35a2`](b6f35a2) [#402](#402) bump @npmcli/arborist from 7.5.4 to 8.0.0 (#402) (@dependabot[bot]) * [`1ef54ba`](1ef54ba) [#408](#408) support tests on win32 (#408) (@mbtools) * [`555b000`](555b000) [#401](#401) bump @npmcli/template-oss from 4.23.3 to 4.23.4 (#401) (@dependabot[bot], @npm-cli-bot) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
The
pacote
tests don't run on Windows (surprisingly). Ergo, Windows is not included in ci.This PR ports the test cases to
win32
... almost 😃helpers/clean-snapshots.js
{VAR}
instead of${VAR}
as placeholdersscript.js
intohelpers/script-mode.js
(see below)Tests
node: 20.15.1
npm: 10.8.2
win: 10.0.19045.0
Just one failure in
git.js
. The two skips are the helpers (see above).Coverage
Almost complete
Open Issues
script.js
On my Windows 10,
script.js
is set to0o666
which stands for standard r/w access but is not executable. This difference is also responsible for the missing line in coverage offile.js
. Should this be mocked to match Unix0o111
? How?I want to avoid this change in
lib\util\npm.js
(the only one outside of/test/
). Is there a better way? How do other npm modules handle this on Windows?There's one case that I can't solve in
git.js
. Any ideas?