Skip to content

test: migrate tests to use node:test module for better test structure for report worker - #56038

Closed
mertcanaltin wants to merge 3 commits into
nodejs:mainfrom
mertcanaltin:test/refactor-report-worker
Closed

test: migrate tests to use node:test module for better test structure for report worker#56038
mertcanaltin wants to merge 3 commits into
nodejs:mainfrom
mertcanaltin:test/refactor-report-worker

Conversation

@mertcanaltin

Copy link
Copy Markdown
Member

Refactored report-worker tests to use the node:test module for better structure and consistency.

this is part of a long pull request: #56024

@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. report Issues and PRs related to process.report. test Issues and PRs related to the tests. labels Nov 27, 2024
@codecov

codecovBot commented Nov 27, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.99%. Comparing base (9029aec) to head (d634665).
Report is 680 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #56038 +/- ##
==========================================
+ Coverage 87.95% 87.99% +0.04% 
==========================================
Files 656 656 Lines 188372 189103 +731 Branches 35979 36003 +24 ==========================================
+ Hits 165687 166409 +722 - Misses 15851 15858 +7 - Partials 6834 6836 +2 

see 59 files with indirect coverage changes

Comment threadtest/report/test-report-worker.js Outdated
Comment on lines +11 to +12
test('Worker threads report basic information', async (t) => {
await t.test('should include basic information about Worker threads', async () => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: Could we also use describe/it to avoid using await t.test?

Not entirely sure about this: could we set concurrency: true, or is sequentiality needed?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I followed what you said, thank you, the test is more readable

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I hope I understood correctly, when I used --test-concurrency I saw that the tests were successfully synchronized

@mertcanaltinmertcanaltin added the blocked PRs that are blocked by other issues or PRs. label Dec 24, 2024
@mertcanaltin

Copy link
Copy Markdown
MemberAuthor

#54796, #56027, #55716
I added a blocker tag because it is linked

@lpincalpinca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm blocking this because there is an approval now and as discussed in other places this is not an improvement in my opinion. I will remove the block once TSC officially decides that a mass refactor to node:test is good for the project.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blockedPRs that are blocked by other issues or PRs.needs-ciPRs that need a full CI run.reportIssues and PRs related to process.report.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@mertcanaltin@jasnell@lpinca@pmarchini@nodejs-github-bot