forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test_runner: report failures in filtered suites
This commit updates the test runner's filter logic to handle test suite failures during the build phase. Prior to this commit, these suites were silently filtered. PR-URL: nodejs#54387 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Jake Yuesong Li <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
- Loading branch information
Showing
4 changed files
with
80 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Flags: --test-name-pattern=enabled | ||
'use strict'; | ||
const common = require('../../../common'); | ||
const { suite, test } = require('node:test'); | ||
|
||
suite('suite 1', () => { | ||
throw new Error('boom 1'); | ||
test('enabled - should not run', common.mustNotCall()); | ||
}); | ||
|
||
suite('suite 2', () => { | ||
test('enabled - should get cancelled', common.mustNotCall()); | ||
throw new Error('boom 1'); | ||
}); |
62 changes: 62 additions & 0 deletions
62
test/fixtures/test-runner/output/filtered-suite-throws.snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
TAP version 13 | ||
# Subtest: suite 1 | ||
not ok 1 - suite 1 | ||
--- | ||
duration_ms: * | ||
type: 'suite' | ||
location: '/test/fixtures/test-runner/output/filtered-suite-throws.js:(LINE):1' | ||
failureType: 'testCodeFailure' | ||
error: 'boom 1' | ||
code: 'ERR_TEST_FAILURE' | ||
stack: |- | ||
* | ||
* | ||
* | ||
* | ||
* | ||
* | ||
* | ||
* | ||
* | ||
* | ||
... | ||
# Subtest: suite 2 | ||
# Subtest: enabled - should get cancelled | ||
not ok 1 - enabled - should get cancelled | ||
--- | ||
duration_ms: * | ||
location: '/test/fixtures/test-runner/output/filtered-suite-throws.js:(LINE):3' | ||
failureType: 'cancelledByParent' | ||
error: 'test did not finish before its parent and was cancelled' | ||
code: 'ERR_TEST_FAILURE' | ||
... | ||
1..1 | ||
not ok 2 - suite 2 | ||
--- | ||
duration_ms: * | ||
type: 'suite' | ||
location: '/test/fixtures/test-runner/output/filtered-suite-throws.js:(LINE):1' | ||
failureType: 'testCodeFailure' | ||
error: 'boom 1' | ||
code: 'ERR_TEST_FAILURE' | ||
stack: |- | ||
* | ||
* | ||
* | ||
* | ||
* | ||
* | ||
* | ||
* | ||
* | ||
* | ||
... | ||
1..2 | ||
# tests 1 | ||
# suites 2 | ||
# pass 0 | ||
# fail 0 | ||
# cancelled 1 | ||
# skipped 0 | ||
# todo 0 | ||
# duration_ms * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters