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

chore: Minor test fixes #211

Merged
merged 2 commits into from
Aug 29, 2024
Merged

chore: Minor test fixes #211

merged 2 commits into from
Aug 29, 2024

Conversation

dpogue
Copy link
Member

@dpogue dpogue commented Aug 2, 2024

Platforms affected

None

Motivation and Context

Resolves some deprecations warnings printed to the console in Node 22.

Description

  • The fs.Stats constructor is deprecated in Node 22 and prints a warning to the console, so we want to find a way to avoid hitting that
  • We got some warnings elsewhere that temporary files weren't cleaned up properly after test runs. Try using the tmp npm module to handle this better

Testing

Ran unit tests locally on Node 22.

Checklist

  • I've run the tests to see all new and existing tests pass

Do this in the worst way possible because stuff depends on it being an
instance of fs.Stats with the right prototype, but also there's no
supported way to mock create an object of that type... so __proto__
hackery will have to suffice 😬
This should ensure that the directory is always cleaned up after tests
run.
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.40%. Comparing base (3d7f736) to head (52b849a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #211   +/-   ##
=======================================
  Coverage   88.40%   88.40%           
=======================================
  Files          20       20           
  Lines        1147     1147           
=======================================
  Hits         1014     1014           
  Misses        133      133           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dpogue dpogue requested a review from erisu August 10, 2024 20:14
Copy link
Member

@erisu erisu left a comment

Choose a reason for hiding this comment

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

LGTM

@dpogue dpogue merged commit c85b825 into apache:master Aug 29, 2024
14 checks passed
@dpogue dpogue deleted the tmp-fix branch August 29, 2024 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants