GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: check that benchmark tests are minimal · nodejs/node@23f22bc

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/common
    • benchmark.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/common/benchmark.js‎

Copy file name to clipboardExpand all lines: test/common/benchmark.js
+18-1Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,27 @@ function runBenchmark(name, args, env) {
2020

2121
const mergedEnv = Object.assign({}, process.env, env);
2222

23-
const child = fork(runjs, argv, { env: mergedEnv });
23+
const child = fork(runjs, argv, { env: mergedEnv, stdio: 'pipe' });
24+
child.stdout.setEncoding('utf8');
25+
26+
let stdout = '';
27+
child.stdout.on('data', (line) => {
28+
stdout += line;
29+
});
30+
2431
child.on('exit', (code, signal) => {
2532
assert.strictEqual(code, 0);
2633
assert.strictEqual(signal, null);
34+
// This bit makes sure that each benchmark file is being sent settings such
35+
// that the benchmark file runs just one set of options. This helps keep the
36+
// benchmark tests from taking a long time to run. Therefore, each benchmark
37+
// file should result in three lines of output: a blank line, a line with
38+
// the name of the benchmark file, and a line with the only results that we
39+
// get from testing the benchmark file.
40+
assert.ok(
41+
/^(?:\n.+?\n.+?\n)+$/.test(stdout),
42+
`benchmark file not running exactly one configuration in test: ${stdout}`
43+
);
2744
});
2845
}
2946

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.