From d1626a7a51848776b71d58e24cb33ad71bcfb315 Mon Sep 17 00:00:00 2001 From: Daniel Huigens Date: Mon, 30 Jul 2018 18:54:08 +0200 Subject: [PATCH] Disable some tests on Sauce Labs Since we still run the full test suite on Node.js, this would only no longer catch bugs which are specific to - Browser non-draft04 GCM (and don't manifest in draft04 GCM, and don't manifest in Node.js non-draft04 GCM) - Browser OCB (which is not natively implemented in the browser) - Browser V5 Keys --- test/general/key.js | 19 ++++++++++--------- test/general/openpgp.js | 4 ++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/test/general/key.js b/test/general/key.js index 703b1a64..e9d8a803 100644 --- a/test/general/key.js +++ b/test/general/key.js @@ -1,3 +1,5 @@ +/* globals tryTests: true */ + const openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp'); const stub = require('sinon/lib/sinon/stub'); @@ -1652,21 +1654,20 @@ describe('Key', function() { describe('V4', versionSpecificTests); - describe('V5', function() { - let aead_protectVal; - let aead_protect_versionVal; - beforeEach(function() { + let aead_protectVal; + let aead_protect_versionVal; + tryTests('V5', versionSpecificTests, { + if: !openpgp.config.saucelabs, + beforeEach: function() { aead_protectVal = openpgp.config.aead_protect; aead_protect_versionVal = openpgp.config.aead_protect_version; openpgp.config.aead_protect = true; openpgp.config.aead_protect_version = 4; - }); - afterEach(function() { + }, + afterEach: function() { openpgp.config.aead_protect = aead_protectVal; openpgp.config.aead_protect_version = aead_protect_versionVal; - }); - - versionSpecificTests(); + } }); it('Parsing armored text with RSA key and ECC subkey', async function() { diff --git a/test/general/openpgp.js b/test/general/openpgp.js index 3560ad02..bbbdee72 100644 --- a/test/general/openpgp.js +++ b/test/general/openpgp.js @@ -767,7 +767,7 @@ describe('OpenPGP.js public api tests', function() { }); tryTests('GCM mode', tests, { - if: true, + if: !openpgp.config.saucelabs, beforeEach: function() { openpgp.config.aead_protect = true; openpgp.config.aead_protect_version = 0; @@ -801,7 +801,7 @@ describe('OpenPGP.js public api tests', function() { }); tryTests('OCB mode', tests, { - if: true, + if: !openpgp.config.saucelabs, beforeEach: function() { openpgp.config.aead_protect = true; openpgp.config.aead_mode = openpgp.enums.aead.ocb;