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

Update Node flags for v8.X instrumentation tests #366

Merged
merged 2 commits into from
Aug 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions test/instrumentation/http.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,33 @@ var testFiles = fs.readdirSync(testRoot).filter(function (filename) {
return filename.indexOf('test-http') === 0;
});

var defaultFlags = [
'--allow-natives-syntax',
'--expose-gc',
'--expose-internals'
];

if (process.version >= 'v8') defaultFlags.push('--expose-http2');

var failedTests = [];
var numSuccesses = 0;
testFiles.forEach(function (filename) {
var testModulePath = path.join(testRoot, filename);
var singleTestFlags = defaultFlags.concat([
'run-node-http-test.js',
testModulePath
]);

// this is the only test, that actually asserts the lack of http2 flag
// therefore we have to remove it from the process we are about to run
if (filename === 'test-http2-noflag.js') {
singleTestFlags = singleTestFlags.filter(function (flag) {
return flag !== '--expose-http2';
});
}

try {
child_process.execFileSync('node', [
'--allow-natives-syntax',
'--expose_gc',
'run-node-http-test.js',
testModulePath
], { stdio: 'ignore' });
child_process.execFileSync('node', singleTestFlags, { stdio: 'ignore' });
console.log('✓ ' + filename);
numSuccesses++;
} catch (e) {
Expand Down
1 change: 1 addition & 0 deletions test/instrumentation/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ if [ ! -d $nodeRoot ]; then
url="https://codeload.github.com/nodejs/node/tar.gz/$version"
curl $url -o "$version.tar.gz"
tar -xf "$version.tar.gz"
rm "$version.tar.gz"
fi
exec node http.test.js `pwd`/$nodeRoot