From 5cb529ac6e96a46eedba599a10f30ea51a69031d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Og=C3=B3rek?= Date: Wed, 30 Aug 2017 14:06:52 +0200 Subject: [PATCH 1/2] Remove node archive after extracting --- test/instrumentation/run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/test/instrumentation/run.sh b/test/instrumentation/run.sh index 2449095..81582bc 100755 --- a/test/instrumentation/run.sh +++ b/test/instrumentation/run.sh @@ -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 From 95ae44c09b57a0d812ae24eab3004997168c7a5c 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 2/2] 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 | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/test/instrumentation/http.test.js b/test/instrumentation/http.test.js index 671243f..1be59ed 100644 --- a/test/instrumentation/http.test.js +++ b/test/instrumentation/http.test.js @@ -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) {