Gürgün Dayıoğlu
cc4d33842b
lib: limit split function calls to prevent excessive array length
...
PR-URL: https://github.com/nodejs/node/pull/57501
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
2025-04-17 10:51:46 -03:00
Pietro Marchini
1b33b976ec
test_runner: refactor testPlan counter increse
...
PR-URL: https://github.com/nodejs/node/pull/56765
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2025-04-17 10:51:37 -03:00
Eddie Abbondanzio
d860f2bf42
test_runner: differentiate test types in enqueue dequeue events
...
PR-URL: https://github.com/nodejs/node/pull/54049
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2025-04-17 10:51:37 -03:00
Pietro Marchini
993bab646c
test_runner: print formatted errors on summary
...
PR-URL: https://github.com/nodejs/node/pull/56911
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: James M Snell <jasnell@gmail.com >
2025-04-17 10:51:36 -03:00
Carlos Espa
3ed3ba438f
test_runner: allow special characters in snapshot keys
...
Fixes: https://github.com/nodejs/node/issues/56836
PR-URL: https://github.com/nodejs/node/pull/57017
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2025-04-17 10:51:00 -03:00
dependabot[bot]
998b2ae3cd
tools: bump eslint version
...
Bumps the eslint group in /tools/eslint with 5 updates:
| Package | From | To |
| --- | --- | --- |
| `@babel/core` | `7.26.0` | `7.26.7` |
| `@babel/eslint-parser` | `7.25.9` | `7.26.5` |
| `@stylistic/eslint-plugin-js` | `2.12.1` | `3.0.1` |
| `eslint` | `9.17.0` | `9.19.0` |
| `eslint-plugin-jsdoc` | `50.6.1` | `50.6.3` |
Signed-off-by: dependabot[bot] <support@github.com >
PR-URL: https://github.com/nodejs/node/pull/56869
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2025-04-17 10:50:47 -03:00
Pietro Marchini and Llorx
8cbb7cc838
test_runner: print failing assertion only once with spec reporter
...
Co-authored-by: Llorx <dallorx@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/56662
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2025-02-06 01:10:44 +01:00
Colin Ihrig
697a851fb3
test_runner: add TestContext.prototype.waitFor()
...
This commit adds a waitFor() method to the TestContext class in
the test runner. As the name implies, this method allows tests to
more easily wait for things to happen.
PR-URL: https://github.com/nodejs/node/pull/56595
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2025-02-03 20:10:03 +01:00
Colin Ihrig
047537b48c
test_runner: add t.assert.fileSnapshot()
...
This commit adds a t.assert.fileSnapshot() API to the test runner.
This is similar to how snapshot tests work in core, as well as
userland options such as toMatchFileSnapshot().
PR-URL: https://github.com/nodejs/node/pull/56459
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2025-02-03 20:09:57 +01:00
Colin Ihrig
926cf84e95
test_runner: add assert.register() API
...
This commit adds a top level assert.register() API to the test
runner. This function allows users to define their own custom
assertion functions on the TestContext.
Fixes: https://github.com/nodejs/node/issues/52033
PR-URL: https://github.com/nodejs/node/pull/56434
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com >
2025-02-03 20:09:53 +01:00
Colin Ihrig
fb4661a4cf
test_runner: finish marking snapshot testing as stable
...
Snapshot testing was marked stable in #55897 . These were
overlooked at the time.
Refs: https://github.com/nodejs/node/pull/55897
PR-URL: https://github.com/nodejs/node/pull/56425
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2025-02-03 20:09:53 +01:00
cjihrig
fb98fa4967
test_runner: refactor Promise chain in run()
...
This commit refactors the chain of functions in run() to use an
async function instead of creating an awkward primordial-based
Promise chain.
PR-URL: https://github.com/nodejs/node/pull/55958
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2025-01-05 12:57:26 -05:00
cjihrig
18c94961f8
test_runner: refactor build Promise in Suite()
...
This commit refactors the buildSuite Promise logic in the Suite
constructor to use an async function instead of creating an
awkward primordial-based Promise chain.
PR-URL: https://github.com/nodejs/node/pull/55958
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2025-01-05 12:57:26 -05:00
Colin Ihrig
bf3967fd3a
test_runner: simplify hook running logic
...
This commit removes some asynchronous logic from the runHook()
method and replaces ArrayPrototypeReduce() with a for loop.
PR-URL: https://github.com/nodejs/node/pull/55963
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2025-01-05 12:57:26 -05:00
Giovanni Bucci and Cristian Barlutiu
05d6227a88
assert: add partialDeepStrictEqual
...
Fixes: https://github.com/nodejs/node/issues/50399
Co-Authored-By: Cristian Barlutiu <cristian.barlutiu@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/54630
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Jithil P Ponnan <jithil@outlook.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
2025-01-05 12:57:25 -05:00
Colin Ihrig
8ff082cf48
test_runner: mark snapshot testing as stable
...
This commit marks the test runner's snapshot testing API as
stable.
PR-URL: https://github.com/nodejs/node/pull/55897
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2025-01-05 12:57:22 -05:00
Aviv Keller
6e3e99c81e
lib: prefer logical assignment
...
PR-URL: https://github.com/nodejs/node/pull/55044
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
2024-11-27 11:03:39 -05:00
Yagiz Nizipli
03902ebb74
lib: replace createDeferredPromise util with Promise.withResolvers
...
PR-URL: https://github.com/nodejs/node/pull/54836
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2024-11-27 11:03:39 -05:00
Aviv Keller
363e7d5a76
test_runner: error on mocking an already mocked date
...
Fixes #55849
PR-URL: https://github.com/nodejs/node/pull/55858
Reviewed-By: Jacob Smith <jacob@frende.me >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2024-11-27 11:03:37 -05:00
Erick Wendel
f41d329e98
test_runner: add support for scheduler.wait on mock timers
...
This adds support for nodetimers.promises.scheduler.wait on Mocktimers
Refs: https://github.com/nodejs/node/pull/55244
PR-URL: https://github.com/nodejs/node/pull/55244
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
2024-11-27 01:37:51 -05:00
BadKey
29f7325e73
lib: test_runner#mock:timers respeced timeout_max behaviour
...
PR-URL: https://github.com/nodejs/node/pull/55375
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Claudio Wunder <cwunder@gnome.org >
2024-11-27 01:23:22 -05:00
Aviv Keller
b9200c33ae
test_runner: require --enable-source-maps for sourcemap coverage
...
PR-URL: https://github.com/nodejs/node/pull/55359
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2024-11-27 01:23:19 -05:00
Aviv Keller
800f7c44ed
test_runner: throw on invalid source map
...
PR-URL: https://github.com/nodejs/node/pull/55055
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2024-10-09 22:57:22 +02:00
Edigleysson Silva (Edy)
0f7e3f017f
test_runner: assert entry is a valid object
...
PR-URL: https://github.com/nodejs/node/pull/55231
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2024-10-09 22:57:21 +02:00
Antoine du Hamel
c308862d2e
test_runner: avoid spread operator on arrays
...
PR-URL: https://github.com/nodejs/node/pull/55143
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-10-04 19:20:18 +02:00
Aviv Keller
12401972b7
test_runner: support typescript files in default glob
...
PR-URL: https://github.com/nodejs/node/pull/55081
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-10-04 19:20:17 +02:00
Colin Ihrig
19cfa3140f
test_runner: close and flush destinations on forced exit
...
This commit updates the test runner to explicitly close and flush
all destination file streams when the --test-force-exit flag is
used.
Fixes: https://github.com/nodejs/node/issues/54327
PR-URL: https://github.com/nodejs/node/pull/55099
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com >
2024-10-04 19:20:16 +02:00
Aviv Keller
86f7cb802d
test_runner: support custom arguments in run()
...
PR-URL: https://github.com/nodejs/node/pull/55126
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2024-10-04 19:20:15 +02:00
Antoine du Hamel
7eaeba499a
test_runner: fix mocking modules with quote in their URL
...
PR-URL: https://github.com/nodejs/node/pull/55083
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Tierney Cyren <hello@bnb.im >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2024-10-04 10:20:27 +02:00
Nathan Baulch
bf7d7aef4b
lib: fix typos
...
PR-URL: https://github.com/nodejs/node/pull/55065
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
2024-10-04 10:20:26 +02:00
8818c6c88a
test_runner: report error on missing sourcemap source
...
Co-Authored-By: Jayden Seric <me@jaydenseric.com >
Co-Authored-By: Colin Ihrig <cjihrig@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/55037
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2024-10-04 10:20:20 +02:00
Colin Ihrig
b62f2f8259
test_runner: add 'test:summary' event
...
This commit adds a new 'test:summary' event to the test runner's
reporting interface. This new event serves two purposes:
- In the future, the test runner internals will no longer need to
change the process exit code. This may be important to run()
users. Unfortunately, this is a breaking change, so it needs to
be changed in a major version.
- The reporting interface now has a single event that can identify
passing or failing test runs.
Refs: https://github.com/nodejs/node/issues/53867
Refs: https://github.com/nodejs/node/issues/54812
PR-URL: https://github.com/nodejs/node/pull/54851
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2024-10-04 10:20:18 +02:00
RedYetiDev
449dad0db0
test_runner: use test: symbol on second print of parent test
...
PR-URL: https://github.com/nodejs/node/pull/54956
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-10-04 10:20:17 +02:00
Pietro Marchini
4b962a78c7
test_runner: replace ansi clear with ansi reset
...
PR-URL: https://github.com/nodejs/node/pull/55013
Fixes: https://github.com/nodejs/node/issues/55009
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2024-10-04 10:20:14 +02:00
Chemi Atlow
d7c708aec5
test_runner: add support for coverage via run()
...
PR-URL: https://github.com/nodejs/node/pull/53937
Fixes: https://github.com/nodejs/node/issues/53867
Refs: https://github.com/nodejs/node/issues/53924
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2024-10-04 10:20:12 +02:00
Marco Ippolito
93c6c90219
test_runner: support typescript module mocking
...
PR-URL: https://github.com/nodejs/node/pull/54878
Fixes: https://github.com/nodejs/node/issues/54428
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Erick Wendel <erick.workspace@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
2024-10-04 10:20:10 +02:00
Pietro Marchini
1daec9a63f
test_runner: avoid coverage report partial file names
...
Co-author: Medhansh404 <21ucs126@lnmiit.ac.in >
PR-URL: https://github.com/nodejs/node/pull/54379
Fixes: https://github.com/nodejs/node/issues/51299
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2024-10-04 10:20:08 +02:00
Aviv Keller
de0f445a7f
test_runner: reimplement assert.ok to allow stack parsing
...
PR-URL: https://github.com/nodejs/node/pull/54776
Refs: https://github.com/nodejs/help/issues/4461
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2024-09-17 11:18:27 -03:00
Aviv Keller
a52c199d9d
test_runner: report coverage thresholds in test:coverage
...
PR-URL: https://github.com/nodejs/node/pull/54813
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2024-09-16 23:20:16 -03:00
Pietro Marchini
6552fddef5
test_runner: update kPatterns
...
PR-URL: https://github.com/nodejs/node/pull/54728
Fixes: https://github.com/nodejs/node/issues/54726
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2024-09-16 23:20:16 -03:00
cjihrig
3396a4954d
test_runner: detect only tests when isolation is off
...
This commit updates the way the test runner processes 'only'
tests when process-based test isolation is disabled. The
--test-only flag is no longer necessary in this scenario. The
test runner will automatically detect 'only' tests and apply the
appropriate filtering.
PR-URL: https://github.com/nodejs/node/pull/54832
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2024-09-16 23:20:16 -03:00
cjihrig
021f59b6bc
test_runner: apply filtering when tests begin
...
This commit updates the way filtering is applied to tests and
suites. After this change, filters are applied just before the
test/suite is started. The results are the same, but this allows
us to eventually move away from the --test-only flag except
when process level isolation is used.
PR-URL: https://github.com/nodejs/node/pull/54832
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2024-09-16 23:20:16 -03:00
Aviv Keller and Colin Ihrig
36da793350
test_runner: allow --import with no isolation
...
Co-Authored-By: Colin Ihrig <cjihrig@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/54697
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
2024-09-16 23:20:12 -03:00
Colin Ihrig
de73d1ee4b
test_runner: improve code coverage cleanup
...
The test runner's code coverage leaves old coverage data in the
temp directory. This commit updates the cleanup logic to:
- Stop code collection. Otherwise V8 would write collection data
again when the process exits.
- Remove the temp directory containing the coverage data.
- Attempt to clean up the coverage data even if parsing the
data resulted in an error.
With this change, I no longer see any coverage data left behind
in the system temp directory.
Refs: https://github.com/nodejs/build/issues/3864
Refs: https://github.com/nodejs/build/issues/3887
PR-URL: https://github.com/nodejs/node/pull/54856
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-09-14 00:20:35 +02:00
Antoine du Hamel
5f02e1b850
lib: move Symbol[Async]Dispose polyfills to internal/util
...
PR-URL: https://github.com/nodejs/node/pull/54853
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-09-14 00:20:34 +02:00
Pietro Marchini
a4bebf8559
test_runner: ensure test watcher picks up new test files
...
PR-URL: https://github.com/nodejs/node/pull/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 >
2024-08-30 15:52:16 -03:00
Aviv Keller and Marco Ippolito
d4310fe9c1
test_runner: add support for coverage thresholds
...
Co-Authored-By: Marco Ippolito <marcoippolito54@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/54429
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
2024-08-30 15:52:12 -03:00
Antoine du Hamel
0cf78aa24b
test_runner: refactor mock_loader
...
PR-URL: https://github.com/nodejs/node/pull/54223
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-08-30 15:52:11 -03:00
cjihrig and Moshe Atlow
97fa075c2e
test_runner: support running tests in process
...
This commit introduces a new --experimental-test-isolation flag
that, when set to 'none', causes the test runner to execute all
tests in the same process. By default, this is the main test
runner process, but if watch mode is enabled, it spawns a separate
process that runs all of the tests.
The default value of the new flag is 'process', which uses the
existing behavior of running each test file in its own child
process.
It is worth noting that when the isolation mode is 'none', globals
and all other top level logic (such as top level before() and after()
hooks) is shared among all files.
Co-authored-by: Moshe Atlow <moshe@atlow.co.il >
PR-URL: https://github.com/nodejs/node/pull/53927
Fixes: https://github.com/nodejs/node/issues/51548
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2024-08-30 15:52:06 -03:00
cjihrig
858b583c88
test_runner: defer inheriting hooks until run()
...
This commit updates the way the test runner computes inherited
hooks. Instead of computing them when the Test/Suite is
constructed, they are now computed just prior to running the
Test/Suite. The reason is because when multiple test files are
run in the same process, it is possible for the inherited hooks
to change as more files are loaded.
PR-URL: https://github.com/nodejs/node/pull/53927
Fixes: https://github.com/nodejs/node/issues/51548
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2024-08-25 18:19:13 -03:00