Skip to content

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

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JacopoPatroclo
Copy link

@JacopoPatroclo JacopoPatroclo commented Apr 16, 2025

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.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Apr 16, 2025
@pmarchini
Copy link
Member

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

@JacopoPatroclo JacopoPatroclo marked this pull request as draft April 16, 2025 20:29
@JacopoPatroclo JacopoPatroclo changed the title test_runner: added restart log while in watch mode test_runner: emit test:watch:restarted event on watched file changes Apr 18, 2025
@JacopoPatroclo JacopoPatroclo marked this pull request as ready for review April 18, 2025 12:44
Copy link
Member

@pmarchini pmarchini left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

codecov bot commented Apr 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.28%. Comparing base (6cdcaa9) to head (9ef7789).
Report is 204 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%) ⬆️

... and 61 files with indirect coverage changes

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

@pmarchini pmarchini added commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. request-ci Add this label to start a Jenkins CI on a PR. labels Apr 18, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 19, 2025
@nodejs-github-bot
Copy link
Collaborator

@pmarchini pmarchini added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 21, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 21, 2025
@nodejs-github-bot
Copy link
Collaborator

@pmarchini pmarchini added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 21, 2025
@jakecastelli
Copy link
Member

one small nit - the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. 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

@pmarchini
Copy link
Member

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

@jakecastelli
Copy link
Member

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

@jakecastelli jakecastelli removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 21, 2025
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@pmarchini pmarchini added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels May 4, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 11, 2025
@nodejs-github-bot
Copy link
Collaborator

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. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants