Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
test: skip quic tests if no quic
Browse files Browse the repository at this point in the history
PR-URL: #83
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
jasnell committed Aug 22, 2019
1 parent bc02d74 commit 262c16b
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 22 deletions.
2 changes: 2 additions & 0 deletions test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ if (isMainThread)
const noop = () => {};

const hasCrypto = Boolean(process.versions.openssl);
const hasQuic = Boolean(process.versions.ngtcp2);

// Check for flags. Skip this for workers (both, the `cluster` module and
// `worker_threads`) and child processes.
Expand Down Expand Up @@ -756,6 +757,7 @@ module.exports = {
getTTYfd,
hasIntl,
hasCrypto,
hasQuic,
hasIPv6,
hasMultiLocalhost,
isAIX,
Expand Down
5 changes: 3 additions & 2 deletions test/parallel/test-quic-binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
'use strict';

const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
if (!common.hasQuic)
common.skip('missing quic');

const assert = require('assert');
const { internalBinding } = require('internal/test/binding');

Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-quic-client-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
// Tests a simple QUIC client/server round-trip

const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
if (!common.hasQuic)
common.skip('missing quic');

const { internalBinding } = require('internal/test/binding');
const {
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-quic-createsocket-err.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// Test QuicSocket constructor option errors

const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
if (!common.hasQuic)
common.skip('missing quic');

const assert = require('assert');

Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-quic-packetloss.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// retransmission and the requisite data buffering is
// not yet working correctly
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
if (!common.hasQuic)
common.skip('missing quic');

const Countdown = require('../common/countdown');
const assert = require('assert');
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-quic-quicsocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
// Test QuicSocket constructor option errors.

const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
if (!common.hasQuic)
common.skip('missing quic');

const assert = require('assert');

Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-quic-serverbusy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
// Tests QUIC server busy support

const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
if (!common.hasQuic)
common.skip('missing quic');

// TODO(@jasnell): Marking a server as busy will cause all new
// connection attempts to fail with a SERVER_BUSY CONNECTION_CLOSE.
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-quic-session-destroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// abruptly on both ends of the connection.

const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
if (!common.hasQuic)
common.skip('missing quic');

const fs = require('fs');
const fixtures = require('../common/fixtures');
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-quic-simple-client-migrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
'use strict';

const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
if (!common.hasQuic)
common.skip('missing quic');

const Countdown = require('../common/countdown');
const assert = require('assert');
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-quic-stream-close-early.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
'use strict';

const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
if (!common.hasQuic)
common.skip('missing quic');

const Countdown = require('../common/countdown');
const assert = require('assert');
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-quic-stream-destroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// abruptly on both ends of the connection.

const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
if (!common.hasQuic)
common.skip('missing quic');

const assert = require('assert');
const fs = require('fs');
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-quic-stream-identifiers.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
// +------+----------------------------------+

const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
if (!common.hasQuic)
common.skip('missing quic');

const Countdown = require('../common/countdown');
const assert = require('assert');
Expand Down

0 comments on commit 262c16b

Please sign in to comment.