Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit c7819f4

Browse files
committed
Update Node flags for v8.X instrumentation tests
Added flags: --expose-internals --expose-http2 Included one edge case, where we have to remove http2 flag.
1 parent ed646d5 commit c7819f4

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

test/instrumentation/http.test.js

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,33 @@ var testFiles = fs.readdirSync(testRoot).filter(function (filename) {
1212
return filename.indexOf('test-http') === 0;
1313
});
1414

15+
var defaultFlags = [
16+
'--allow-natives-syntax',
17+
'--expose-gc',
18+
'--expose-internals'
19+
];
20+
21+
if (process.version >= 'v8') defaultFlags.push('--expose-http2');
22+
1523
var failedTests = [];
1624
var numSuccesses = 0;
1725
testFiles.forEach(function (filename) {
1826
var testModulePath = path.join(testRoot, filename);
27+
var singleTestFlags = defaultFlags.concat([
28+
'run-node-http-test.js',
29+
testModulePath
30+
]);
31+
32+
// this is the only test, that actually asserts the lack of http2 flag
33+
// therefore we have to remove it from the process we are about to run
34+
if (filename === 'test-http2-noflag.js') {
35+
singleTestFlags = singleTestFlags.filter(function (flag) {
36+
return flag !== '--expose-http2';
37+
});
38+
}
39+
1940
try {
20-
child_process.execFileSync('node', [
21-
'--allow-natives-syntax',
22-
'--expose_gc',
23-
'run-node-http-test.js',
24-
testModulePath
25-
], { stdio: 'ignore' });
41+
child_process.execFileSync('node', singleTestFlags, { stdio: 'ignore' });
2642
console.log('✓ ' + filename);
2743
numSuccesses++;
2844
} catch (e) {

0 commit comments

Comments
 (0)