Skip to content

Commit 779ce29

Browse files
Trottaddaleax
authored andcommitted
test: add check for wrk to test-keep-alive
test/pummel/test-keep-alive.js requires `wrk` to be installed. Check if it is, and skip the test if it isn't. This is yet another step in preparation for running pummel tests in CI daily. PR-URL: #25516 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 4170230 commit 779ce29

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎test/pummel/test-keep-alive.js‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@
2323

2424
// This test requires the program 'wrk'.
2525
constcommon=require('../common');
26-
if(common.isWindows)
27-
common.skip('no `wrk` on windows');
26+
27+
constchild_process=require('child_process');
28+
constresult=child_process.spawnSync('wrk',['-h']);
29+
if(result.error&&result.error.code==='ENOENT')
30+
common.skip('test requires `wrk` to be installed first');
2831

2932
constassert=require('assert');
30-
constspawn=require('child_process').spawn;
3133
consthttp=require('http');
3234
consturl=require('url');
3335

@@ -60,7 +62,7 @@ const runAb = (opts, callback) => {
6062
args.push(url.format({hostname: '127.0.0.1',
6163
port: opts.port,protocol: 'http'}));
6264

63-
constchild=spawn('wrk',args);
65+
constchild=child_process.spawn('wrk',args);
6466
child.stderr.pipe(process.stderr);
6567
child.stdout.setEncoding('utf8');
6668

0 commit comments

Comments
 (0)