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

test_runner: ensure test watcher picks up new test files #54225

Merged
merged 17 commits into from
Aug 29, 2024

Conversation

pmarchini
Copy link
Member

This is the initial implementation addressing issue #53077.

I've noticed the issue has been inactive for a while, so I attempted to resolve it by following the provided suggestions.

While this solution seems to work, I'm not entirely satisfied with the implementation.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Aug 6, 2024
Copy link

codecov bot commented Aug 6, 2024

Codecov Report

Attention: Patch coverage is 72.41379% with 8 lines in your changes missing coverage. Please review.

Project coverage is 87.31%. Comparing base (05bd3cf) to head (67f8998).
Report is 321 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/test_runner/runner.js 71.42% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #54225      +/-   ##
==========================================
- Coverage   87.33%   87.31%   -0.02%     
==========================================
  Files         649      649              
  Lines      182622   182638      +16     
  Branches    35037    35040       +3     
==========================================
- Hits       159494   159479      -15     
- Misses      16393    16418      +25     
- Partials     6735     6741       +6     
Files with missing lines Coverage Δ
lib/internal/watch_mode/files_watcher.js 75.74% <100.00%> (+1.23%) ⬆️
lib/internal/test_runner/runner.js 87.76% <71.42%> (-0.66%) ⬇️

... and 24 files with indirect coverage changes

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

Thanks for contributing! I've left a few notes and questions.

You'll also need to add a test to https://github.com/nodejs/node/blob/main/test/parallel/test-runner-run-watch.mjs.

lib/internal/test_runner/runner.js Outdated Show resolved Hide resolved
test/parallel/test-runner-run.mjs Outdated Show resolved Hide resolved
lib/internal/test_runner/runner.js Outdated Show resolved Hide resolved
lib/internal/test_runner/runner.js Outdated Show resolved Hide resolved
@mcollina
Copy link
Member

mcollina commented Aug 9, 2024

@cjihrig PTAL

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

Good work!

* if (this.#mode !== 'filter') {
* return;
* }
*/
Copy link
Member

Choose a reason for hiding this comment

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

Which PR introduced this? Can you ping the original author?

Copy link
Member Author

Choose a reason for hiding this comment

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

If I'm not mistaken, this change is from @MoLow

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure what to make of this change 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it would be great to know if that logic was there for a specific reason. Removing it didn't disrupt any tests.

I added the comment just to ensure that the change didn’t go unnoticed.

Copy link
Member

Choose a reason for hiding this comment

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

Il need to get back from vacation to be in front of a computer to be sure of my answer, but using a single watcher (i.e all mode is probably more efficient and peformant) so creating additional watchers when they are not needed just adds more overhead that is unneeded

Copy link
Member Author

@pmarchini pmarchini Aug 21, 2024

Choose a reason for hiding this comment

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

I removed the comment in the last commit @cjihrig.
I think we should wait for @MoLow to be back 🚀

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with this.

lib/internal/test_runner/runner.js Outdated Show resolved Hide resolved
@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 12, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 12, 2024
@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 12, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 12, 2024
@nodejs-github-bot
Copy link
Collaborator

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

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

LGTM. It would be good to get @MoLow's review on this though.

@jakecastelli
Copy link
Member

will start CI again as soon as this PR lands (just make sure there are no false positive test results) thanks for your patient 🙏

@pmarchini
Copy link
Member Author

I've seen that we now have conflicts, gonna fix them ASAP 🚀

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

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

This adds a new option to run(), so it needs to have docs.

lib/internal/test_runner/runner.js Outdated Show resolved Hide resolved
@pmarchini pmarchini force-pushed the issue/53077 branch 2 times, most recently from f848750 to 17b7ce1 Compare August 16, 2024 05:12
@pmarchini pmarchini requested a review from cjihrig August 16, 2024 06:04
@pmarchini
Copy link
Member Author

@jakecastelli, I had to rebase again cause of conflicts 🚀

@jakecastelli jakecastelli added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 27, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 27, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Aug 27, 2024

Copy link
Member

@jakecastelli jakecastelli left a comment

Choose a reason for hiding this comment

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

Great work

@cjihrig cjihrig added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. and removed needs-ci PRs that need a full CI run. labels Aug 27, 2024
@pmarchini
Copy link
Member Author

Also, I hope you're still planning to add the cwd option 😄

@cjihrig, if this PR lands, I'll start working on it 😁
Should I open an issue before beginning?

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 29, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 29, 2024
@nodejs-github-bot nodejs-github-bot merged commit dcf50f1 into nodejs:main Aug 29, 2024
58 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in dcf50f1

@cjihrig
Copy link
Contributor

cjihrig commented Aug 29, 2024

@pmarchini no need to open an issue.

RafaelGSS pushed a commit that referenced this pull request Aug 30, 2024
PR-URL: #54225
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
RafaelGSS pushed a commit that referenced this pull request Aug 30, 2024
PR-URL: #54225
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
RafaelGSS pushed a commit that referenced this pull request Aug 30, 2024
PR-URL: #54225
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
@RafaelGSS RafaelGSS mentioned this pull request Aug 30, 2024
@targos targos added the dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. label Sep 22, 2024
louwers pushed a commit to louwers/node that referenced this pull request Nov 2, 2024
PR-URL: nodejs#54225
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. test_runner Issues and PRs related to the test runner subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants