Skip to content

Commit 7a5ff10

Browse files
committed
benchmark: add new tests for benchmarks and add new ENV
The env NODE_RUN_ALL_BENCH_TESTS was introduced to enable benchmark tests to run all configs when it is passed. Some tests that have file names different from the original benchmark were using dashes in places that needed underscores and have been renamed. Some benchmarks that did not have tests were created. These are: - test/benchmark/test-benchmark-abort_controller.js - test/benchmark/test-benchmark-error.js - test/benchmark/test-benchmark-https.js - test/benchmark/test-benchmark-perf_hooks.js - test/benchmark/test-benchmark-permission.js - test/benchmark/test-benchmark-sqlite.js - test/benchmark/test-benchmark-test_runner.js - test/benchmark/test-benchmark-webstorage.js
1 parent e155415 commit 7a5ff10

12 files changed

Lines changed: 74 additions & 4 deletions
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
3+
require('../common');
4+
5+
// Minimal test for assert benchmarks. This makes sure the benchmarks aren't
6+
// completely broken but nothing more than that.
7+
8+
const runBenchmark = require('../common/benchmark');
9+
10+
runBenchmark('abort_controller');
File renamed without changes.
File renamed without changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
require('../common');
4+
5+
const runBenchmark = require('../common/benchmark');
6+
7+
runBenchmark('error');
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
5+
if (!common.enoughTestMem)
6+
common.skip('Insufficient memory for HTTPS benchmark test');
7+
8+
// Because the http benchmarks use hardcoded ports, this should be in sequential
9+
// rather than parallel to make sure it does not conflict with tests that choose
10+
// random available ports.
11+
12+
const runBenchmark = require('../common/benchmark');
13+
14+
runBenchmark('https');
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
require('../common');
4+
5+
const runBenchmark = require('../common/benchmark');
6+
7+
runBenchmark('perf_hooks');
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
require('../common');
4+
5+
const runBenchmark = require('../common/benchmark');
6+
7+
runBenchmark('permission');
File renamed without changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
require('../common');
4+
5+
const runBenchmark = require('../common/benchmark');
6+
7+
runBenchmark('sqlite');
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
require('../common');
4+
5+
const runBenchmark = require('../common/benchmark');
6+
7+
runBenchmark('test_runner')

0 commit comments

Comments
Β (0)