-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Remove the rimraf
dependency in favor of the built-in Node.js fs.rmSync
in the test folder
#17938
Conversation
…mSync` in the test folder In Node.js 14.14.0 the `fs.rmSync` function was added that removes files and directories. The `recursive` option is used to remove directories and their contents, making it a drop-in replacement for the `rimraf` dependency we use. Given that PDF.js now requires Node.js 18+ we can be sure that this option is available, so we can safely remove `rimraf` and reduce the number of project dependencies in the test folder. This commit also gets rid of the indirection via the `removeDirSync` test helper function by simply calling `fs.rmSync` directly. Co-authored-by: Wojciech Maj <kontakt@wojtekmaj.pl>
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.193.163.58:8877/89b6776f17f4038/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/ec7cba205b06e9d/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/ec7cba205b06e9d/output.txt Total script time: 26.29 mins
Image differences available at: http://54.241.84.105:8877/ec7cba205b06e9d/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/89b6776f17f4038/output.txt Total script time: 45.03 mins
|
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.
r=me, thank you.
/botio makeref (to have all code paths triggered here too) |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @timvandermeij received. Current queue size: 0 Live output at: http://54.193.163.58:8877/48ff5141ab29775/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @timvandermeij received. Current queue size: 0 Live output at: http://54.241.84.105:8877/758f51baffdf626/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/758f51baffdf626/output.txt Total script time: 18.83 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/48ff5141ab29775/output.txt Total script time: 27.29 mins
|
In Node.js 14.14.0 the
fs.rmSync
function was added that removes files and directories. Therecursive
option is used to remove directories and their contents, making it a drop-in replacement for therimraf
dependency we use.Given that PDF.js now requires Node.js 18+ we can be sure that this option is available, so we can safely remove
rimraf
and reduce the number of project dependencies in the test folder.This commit also gets rid of the indirection via the
removeDirSync
test helper function by simply callingfs.rmSync
directly.Fixes a part of #16337. Note that we deliberately only do the test folder as a first step given the complications we've had with the Gulpfile in #16337. For increased safety I'm therefore splitting the work into smaller parts to reduce the scope of each change and to make testing of each changed line of code easier. For this PR I have triggered all touched code paths, manually creating required directories with dummy contents if needed, and making sure that when
test.mjs
has run that the directories are removed like before.