Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix tests for non-crypto builds #7056

Closed
Closed
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions test/parallel/test-async-wrap-check-providers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
'use strict';

const common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps the crypto AsyncWrap test can merely be isolated instead of aborting the entire test?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, this test is basically laid out to use all providers, so I guess that would really require its own test file… I’m not sure that’s worth the trouble.

const assert = require('assert');
const crypto = require('crypto');
const dgram = require('dgram');
Expand Down
7 changes: 6 additions & 1 deletion test/parallel/test-async-wrap-post-did-throw.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
'use strict';

require('../common');
const common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}

const assert = require('assert');
const async_wrap = process.binding('async_wrap');
var asyncThrows = 0;
Expand Down
7 changes: 6 additions & 1 deletion test/parallel/test-async-wrap-throw-from-callback.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
'use strict';

require('../common');
const common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}

const async_wrap = process.binding('async_wrap');
const assert = require('assert');
const crypto = require('crypto');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-rsa-dsa.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
var common = require('../common');
var assert = require('assert');
var fs = require('fs');
var constants = require('crypto').constants;

if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}
var constants = require('crypto').constants;
var crypto = require('crypto');

// Test certificates
Expand Down
7 changes: 6 additions & 1 deletion test/parallel/test-http-invalid-urls.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
'use strict';

require('../common');
const common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}

const assert = require('assert');
const http = require('http');
const https = require('https');
Expand Down
7 changes: 6 additions & 1 deletion test/parallel/test-https-agent-getname.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
'use strict';

require('../common');
const common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}

const assert = require('assert');
const https = require('https');

Expand Down
5 changes: 5 additions & 0 deletions test/parallel/test-https-connect-address-family.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}

const assert = require('assert');
const https = require('https');

Expand Down
7 changes: 6 additions & 1 deletion test/parallel/test-https-resume-after-renew.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
'use strict';
var common = require('../common');
const common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}

var fs = require('fs');
var https = require('https');
var crypto = require('crypto');
Expand Down
6 changes: 5 additions & 1 deletion test/parallel/test-net-access-byteswritten.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
'use strict';

require('../common');
const common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}
const assert = require('assert');
const net = require('net');
const tls = require('tls');
Expand Down
4 changes: 4 additions & 0 deletions test/parallel/test-npm-install.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any crypto/tls/https usage in this test, or is it because npm uses an https-based registry by default?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mscdex Your assumption is correct; npm uses request which require()s https during its startup phase, it doesn’t even have to talk to the registry for this to fail.


const path = require('path');
const spawn = require('child_process').spawn;
Expand Down
7 changes: 6 additions & 1 deletion test/parallel/test-stream-base-no-abort.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
'use strict';

const common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}

const async_wrap = process.binding('async_wrap');
const uv = process.binding('uv');
const assert = require('assert');
const common = require('../common');
const dgram = require('dgram');
const fs = require('fs');
const net = require('net');
Expand Down
11 changes: 5 additions & 6 deletions test/parallel/test-tls-async-cb-after-socket-end.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
'use strict';

var common = require('../common');

var path = require('path');
var fs = require('fs');
const SSL_OP_NO_TICKET = require('crypto').constants.SSL_OP_NO_TICKET;

const common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}

const path = require('path');
const fs = require('fs');
const SSL_OP_NO_TICKET = require('crypto').constants.SSL_OP_NO_TICKET;

var tls = require('tls');

var options = {
Expand Down
7 changes: 6 additions & 1 deletion test/parallel/test-tls-basic-validations.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
'use strict';

require('../common');
const common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}

const assert = require('assert');
const tls = require('tls');

Expand Down
5 changes: 5 additions & 0 deletions test/parallel/test-tls-connect-address-family.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}

const assert = require('assert');
const tls = require('tls');

Expand Down
5 changes: 5 additions & 0 deletions test/parallel/test-tls-connect-stream-writes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}

const assert = require('assert');
const fs = require('fs');
const tls = require('tls');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-tls-npn-server-client.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';
const common = require('../common');
if (!process.features.tls_npn) {
common.skip('node compiled without OpenSSL or ' +
'with old OpenSSL version.');
return;
}

const common = require('../common');
const assert = require('assert');
const fs = require('fs');

Expand Down
6 changes: 5 additions & 1 deletion test/parallel/test-tls-parse-cert-string.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}

require('../common');
const assert = require('assert');
const tls = require('tls');

Expand Down
5 changes: 5 additions & 0 deletions test/parallel/test-tls-securepair-fiftharg.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
'use strict';

const common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}

const assert = require('assert');
const fs = require('fs');
const tls = require('tls');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-tls-sni-option.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';
const common = require('../common');
if (!process.features.tls_sni) {
common.skip('node compiled without OpenSSL or ' +
'with old OpenSSL version.');
return;
}

const common = require('../common');
const assert = require('assert');
const fs = require('fs');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-tls-sni-server-client.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';
const common = require('../common');
if (!process.features.tls_sni) {
common.skip('node compiled without OpenSSL or ' +
'with old OpenSSL version.');
return;
}

const common = require('../common');
const assert = require('assert');
const fs = require('fs');

Expand Down
5 changes: 5 additions & 0 deletions test/parallel/test-tls-two-cas-one-string.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
'use strict';

const common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}

const tls = require('tls');
const fs = require('fs');

Expand Down
7 changes: 6 additions & 1 deletion test/parallel/test-tls-wrap-no-abort.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
'use strict';

require('../common');
const common = require('../common');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}

const util = require('util');
const TLSWrap = process.binding('tls_wrap').TLSWrap;

Expand Down