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

Remove the rimraf dependency in favor of the built-in Node.js fs.rmSync in the test folder #17938

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

timvandermeij
Copy link
Contributor

@timvandermeij timvandermeij commented Apr 14, 2024

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.

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.

…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>
@timvandermeij
Copy link
Contributor Author

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://54.193.163.58:8877/89b6776f17f4038/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://54.241.84.105:8877/ec7cba205b06e9d/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/ec7cba205b06e9d/output.txt

Total script time: 26.29 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 15
  different first/second rendering: 1

Image differences available at: http://54.241.84.105:8877/ec7cba205b06e9d/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/89b6776f17f4038/output.txt

Total script time: 45.03 mins

  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: Passed

Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a 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.

@timvandermeij timvandermeij merged commit 1008a53 into mozilla:master Apr 15, 2024
9 checks passed
@timvandermeij
Copy link
Contributor Author

/botio makeref (to have all code paths triggered here too)

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_makeref from @timvandermeij received. Current queue size: 0

Live output at: http://54.193.163.58:8877/48ff5141ab29775/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_makeref from @timvandermeij received. Current queue size: 0

Live output at: http://54.241.84.105:8877/758f51baffdf626/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/758f51baffdf626/output.txt

Total script time: 18.83 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/48ff5141ab29775/output.txt

Total script time: 27.29 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants