-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
test: #5555 - move to node test runner #440
base: master
Are you sure you want to change the base?
test: #5555 - move to node test runner #440
Conversation
I did not move all the tests yet, only the ones under commonjs and typescript esm |
Thanks for your PR.
This plugin is a bit tricky regarding testing, we might discover later then the changes are difficult to apply. |
Got it! So would you prefer that I try to update all the tests in this PR? |
I think it's a good idea, you might want some more reviews before going forward. |
@climba03003 @Fdawgs wdyt? |
since |
I believe we can do incremental one, but it should be green before land.
If you were mentioning |
I should have changed all the tests from tap to node test runner (at least searching for tap there are no occurences 😁 ) |
scripts/unit.js
Outdated
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.
I am having some problems running tests using patterns, because windows is not managing them automatically
Before, when using tap
, I think it was using the glob on which the library depends
I tried using the glob
library by myself, but it failed.
The last idea I have is trying with fast-glob
, but if it doesn't work I have to ask: do you have any clue about this?
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.
I tried using the glob library by myself, but it failed.
The link you are sharing is not a failure, this test suite has been cancelled because the Node 20 on latest MacOS failed: https://github.com/fastify/fastify-autoload/actions/runs/12870529340/job/35882162556
"Exceeded timeout of 30000 ms for a test.
This is a timeout failure we had for a long time with Jest, I am not even sure we fixed it since.
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.
I will perform a more precise review during the day before accepting, but looks good. |
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.
lgtm
Could be a good idea to use a LLM to check this diff, to be sure we didn't miss anything. |
Curious about the laugh emoji, I had a good experience with LLM catching omissions while refactoring. |
I have zero confidence those things will provide anything useful, particularly in this context. |
Strong opinion if you think this about programming more broadly (I do not suggest using it for Fastify projects in general). @climba03003 |
My bad, forget my previous comment. |
scripts/unit.js
Outdated
...globSync('test/module/*.js'), | ||
] | ||
|
||
const args = ['node', '--test', ...testFiles] |
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.
We should use borp
here @jsumners?
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.
This project already has a scripts/
directory and uses them for running tests. I assume it's due to the way the module works. I don't really know; I don't pay much attention to this module. So I'm not overly concerned about using borp
here. If it simplifies things, go for it.
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.
I moved the tests to borp as done in avvio
I used the same patterns as used in the master branch with tap
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.
I am worry the coverage is not checked anymore, can you please try with -C --check-coverage
on your machine? What happen if you remove one of these tests?
Checklist
Moving the tests from
tap
to the node test runner, based on what requested in the following issueFastify #5555
npm run test
andnpm run benchmark
and the Code of conduct