Skip to content
Closed
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
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.
  • Loading branch information
Trott committed Jan 15, 2019
commit ced7f0927464e097d6a2eb58b1e5ee780ab9c61e
10 changes: 6 additions & 4 deletions test/pummel/test-keep-alive.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@

// This test requires the program 'wrk'
const common = require('../common');
if (common.isWindows)
common.skip('no `wrk` on windows');

const child_process = require('child_process');
const result = child_process.spawnSync('wrk', ['-h']);
if (result.error && result.error.code === 'ENOENT')
common.skip('test requires `wrk` to be installed first');

const assert = require('assert');
const spawn = require('child_process').spawn;
const http = require('http');
const url = require('url');

Expand Down Expand Up @@ -60,7 +62,7 @@ const runAb = (opts, callback) => {
args.push(url.format({ hostname: '127.0.0.1',
port: common.PORT, protocol: 'http' }));

const child = spawn('wrk', args);
const child = child_process.spawn('wrk', args);
child.stderr.pipe(process.stderr);
child.stdout.setEncoding('utf8');

Expand Down