node icon indicating copy to clipboard operation
node copied to clipboard

test_runner: refactor runner.js

Open pmarchini opened this issue 1 year ago • 3 comments

I'm opening this PR in draft to collect feedback on a potential refactor of the runner.js file. I was planning to do some work related to the introduction of a worker pool, and I think a refactor is needed before proceeding with any new implementation.

pmarchini avatar Dec 02 '24 16:12 pmarchini

Review requested:

  • [ ] @nodejs/test_runner

nodejs-github-bot avatar Dec 02 '24 16:12 nodejs-github-bot

Codecov Report

Attention: Patch coverage is 99.39759% with 1 line in your changes missing coverage. Please review.

Project coverage is 88.53%. Comparing base (61e4ad5) to head (3e66180). Report is 596 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/test_runner/runner.js 99.39% 0 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #56113      +/-   ##
==========================================
+ Coverage   88.01%   88.53%   +0.51%     
==========================================
  Files         656      657       +1     
  Lines      188982   189932     +950     
  Branches    35997    36455     +458     
==========================================
+ Hits       166330   168149    +1819     
+ Misses      15825    14987     -838     
+ Partials     6827     6796      -31     
Files with missing lines Coverage Δ
lib/internal/test_runner/runner.js 90.35% <99.39%> (+0.84%) :arrow_up:

... and 124 files with indirect coverage changes

codecov[bot] avatar Dec 02 '24 19:12 codecov[bot]

There are large swaths of code that appear to mostly be just moved. Is it possible to re-organise the "new" to minimise the diff? That would help a lot with the review.

Hey @JakobJingleheimer, I've mostly extracted and moved source in order to prepare an already complex function to receive additional logic. I'll gladly try to minimise the diff

pmarchini avatar Dec 02 '24 20:12 pmarchini

@JakobJingleheimer I tried to minimise the diff, but the result is almost the same. The point of this refactor is to just move the logic, reducing the complexity of the "main" function (aka run).

I'm doing this because I'm trying to introduce a new type of isolation. I would prefer to avoid opening a PR with both new features and refactoring.

Do you have any suggestions?

pmarchini avatar Dec 11 '24 09:12 pmarchini