From 60f72366e85fc2324e4dc9415fcf1d5e776a6d43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Og=C3=B3rek?= Date: Wed, 30 Aug 2017 14:45:21 +0200 Subject: [PATCH] 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. --- test/instrumentation/http.test.js | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/test/instrumentation/http.test.js b/test/instrumentation/http.test.js index 671243f..22ab13f 100644 --- a/test/instrumentation/http.test.js +++ b/test/instrumentation/http.test.js @@ -12,17 +12,31 @@ var testFiles = fs.readdirSync(testRoot).filter(function (filename) { return filename.indexOf('test-http') === 0; }); +var defaultFlags = [ + '--allow-natives-syntax', + '--expose_gc', + '--expose-internals', + '--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) {