node icon indicating copy to clipboard operation
node copied to clipboard

test_runner: emit test:watch:restarted event on watched file changes

Open JacopoPatroclo opened this issue 9 months ago • 11 comments

The goal of this PR is to add a test:watch:restarted event to signal to the reporter that some tests have restarted while in watch mode.

This will enable a trivial fix for nodejs/node#57206, which I plan to address later.

JacopoPatroclo avatar Apr 16 '25 20:04 JacopoPatroclo

Review requested:

  • [ ] @nodejs/test_runner

nodejs-github-bot avatar Apr 16 '25 20:04 nodejs-github-bot

Hey @JacopoPatroclo, thanks for the PR. Could you please add tests to cover the new behaviour? Also, could you please update the documentation?

pmarchini avatar Apr 16 '25 20:04 pmarchini

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 90.28%. Comparing base (6cdcaa9) to head (9ef7789). :warning: Report is 1092 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #57903      +/-   ##
==========================================
+ Coverage   90.26%   90.28%   +0.01%     
==========================================
  Files         630      630              
  Lines      185933   186331     +398     
  Branches    36447    36508      +61     
==========================================
+ Hits       167840   168233     +393     
- Misses      10971    10976       +5     
  Partials     7122     7122              
Files with missing lines Coverage Δ
lib/internal/test_runner/runner.js 92.49% <100.00%> (+3.61%) :arrow_up:

... and 61 files with indirect coverage changes

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Apr 18 '25 13:04 codecov[bot]

CI: https://ci.nodejs.org/job/node-test-pull-request/66357/

nodejs-github-bot avatar Apr 19 '25 07:04 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/66401/

nodejs-github-bot avatar Apr 21 '25 08:04 nodejs-github-bot

one small nit - the https://github.com/nodejs/node/labels/commit-queue-squash label would squash all your commits and use the first one upon landing - the first commit message in this case is test_runner: added restart log while in watch mode which seems not very accurate, I think since the CI is already green, we can manually land this, wdyt @pmarchini

jakecastelli avatar Apr 21 '25 11:04 jakecastelli

@jakecastelli thanks for pointing it out!!! there's no rush, I'd say we could just ask @JacopoPatroclo to manually rewrite the history!

pmarchini avatar Apr 21 '25 11:04 pmarchini

Ahh no worries at all! Happy to do another approval / CI once the commit message is fixed 👍

jakecastelli avatar Apr 21 '25 11:04 jakecastelli

CI: https://ci.nodejs.org/job/node-test-pull-request/66418/

nodejs-github-bot avatar Apr 23 '25 02:04 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/66432/

nodejs-github-bot avatar Apr 24 '25 08:04 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/66471/

nodejs-github-bot avatar Apr 26 '25 16:04 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/66761/

nodejs-github-bot avatar May 11 '25 18:05 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/66928/

nodejs-github-bot avatar May 19 '25 08:05 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/67197/

nodejs-github-bot avatar May 30 '25 17:05 nodejs-github-bot

Landed in 95249083ea5e4aaf9d2827af60c2ac52f50ec1a4

nodejs-github-bot avatar May 30 '25 19:05 nodejs-github-bot

This doesn't land cleanly on v22.x-staging so a manual backport will be necessary if this is to be released there.

richardlau avatar Sep 19 '25 16:09 richardlau