Skip to content

Commit 72e2782

Browse files
committed
test: split test-runner-output
This test has been flaky for months. As it squeezes too many independent test cases together in one file, split this up before marking any persistent flaky cases as flaky, to avoid masking regressions in other non-flaky cases.
1 parent aee022c commit 72e2782

File tree

72 files changed

+991
-278
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+991
-278
lines changed

test/parallel/test-runner-output.mjs

Lines changed: 0 additions & 278 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Flags: --expose-internals
2+
// Test that the output of test-runner/output/abort_hooks.js matches test-runner/output/abort_hooks.snapshot
3+
import '../common/index.mjs';
4+
import * as fixtures from '../common/fixtures.mjs';
5+
import { spawnAndAssert, defaultTransform, ensureCwdIsProjectRoot } from '../common/assertSnapshot.js';
6+
7+
ensureCwdIsProjectRoot();
8+
await spawnAndAssert(
9+
fixtures.path('test-runner/output/abort_hooks.js'),
10+
defaultTransform,
11+
{ flags: ['--test-reporter=tap'] },
12+
);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Flags: --expose-internals
2+
// Test that the output of test-runner/output/abort-runs-after-hook.js matches
3+
// test-runner/output/abort-runs-after-hook.snapshot
4+
import '../common/index.mjs';
5+
import * as fixtures from '../common/fixtures.mjs';
6+
import { spawnAndAssert, defaultTransform, ensureCwdIsProjectRoot } from '../common/assertSnapshot.js';
7+
8+
ensureCwdIsProjectRoot();
9+
await spawnAndAssert(
10+
fixtures.path('test-runner/output/abort-runs-after-hook.js'),
11+
defaultTransform,
12+
{ flags: ['--test-reporter=tap'] },
13+
);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Flags: --expose-internals
2+
// Test that the output of test-runner/output/abort_suite.js matches test-runner/output/abort_suite.snapshot
3+
import '../common/index.mjs';
4+
import * as fixtures from '../common/fixtures.mjs';
5+
import { spawnAndAssert, defaultTransform, ensureCwdIsProjectRoot } from '../common/assertSnapshot.js';
6+
7+
ensureCwdIsProjectRoot();
8+
await spawnAndAssert(
9+
fixtures.path('test-runner/output/abort_suite.js'),
10+
defaultTransform,
11+
{ flags: ['--test-reporter=tap'] },
12+
);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Flags: --expose-internals
2+
// Test that the output of test-runner/output/abort.js matches test-runner/output/abort.snapshot
3+
import '../common/index.mjs';
4+
import * as fixtures from '../common/fixtures.mjs';
5+
import { spawnAndAssert, defaultTransform, ensureCwdIsProjectRoot } from '../common/assertSnapshot.js';
6+
7+
ensureCwdIsProjectRoot();
8+
await spawnAndAssert(
9+
fixtures.path('test-runner/output/abort.js'),
10+
defaultTransform,
11+
{ flags: ['--test-reporter=tap'] },
12+
);
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Flags: --expose-internals
2+
// Test that the output of test-runner/output/arbitrary-output-colored.js matches
3+
// test-runner/output/arbitrary-output-colored.snapshot
4+
import * as common from '../common/index.mjs';
5+
import * as fixtures from '../common/fixtures.mjs';
6+
import {
7+
spawnAndAssert,
8+
specTransform,
9+
replaceTestDuration,
10+
transform,
11+
ensureCwdIsProjectRoot,
12+
} from '../common/assertSnapshot.js';
13+
14+
const skipForceColors =
15+
process.config.variables.icu_gyp_path !== 'tools/icu/icu-generic.gyp' ||
16+
process.config.variables.node_shared_openssl;
17+
18+
if (skipForceColors) {
19+
// https://github.com/nodejs/node/pull/48057
20+
common.skip('Forced colors not supported in this build');
21+
}
22+
23+
ensureCwdIsProjectRoot();
24+
await spawnAndAssert(
25+
fixtures.path('test-runner/output/arbitrary-output-colored.js'),
26+
transform(specTransform, replaceTestDuration),
27+
{ tty: true },
28+
);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Flags: --expose-internals
2+
// Test that the output of test-runner/output/arbitrary-output.js matches
3+
// test-runner/output/arbitrary-output.snapshot
4+
import '../common/index.mjs';
5+
import * as fixtures from '../common/fixtures.mjs';
6+
import { spawnAndAssert, defaultTransform, ensureCwdIsProjectRoot } from '../common/assertSnapshot.js';
7+
8+
ensureCwdIsProjectRoot();
9+
await spawnAndAssert(
10+
fixtures.path('test-runner/output/arbitrary-output.js'),
11+
defaultTransform,
12+
{ flags: ['--test-reporter=tap'] },
13+
);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Flags: --expose-internals
2+
// Test that the output of test-runner/output/assertion-color-tty.mjs matches
3+
// test-runner/output/assertion-color-tty.snapshot
4+
import * as common from '../common/index.mjs';
5+
import * as fixtures from '../common/fixtures.mjs';
6+
import { spawnAndAssert, specTransform, canColorize, ensureCwdIsProjectRoot } from '../common/assertSnapshot.js';
7+
8+
if (!canColorize()) {
9+
common.skip('TTY colors not supported');
10+
}
11+
12+
ensureCwdIsProjectRoot();
13+
await spawnAndAssert(
14+
fixtures.path('test-runner/output/assertion-color-tty.mjs'),
15+
specTransform,
16+
{ flags: ['--test', '--stack-trace-limit=0'], tty: true },
17+
);

0 commit comments

Comments
 (0)