diff --git a/build/tasks/test.js b/build/tasks/test.js index 90d1722c0e..c501017fbe 100644 --- a/build/tasks/test.js +++ b/build/tasks/test.js @@ -19,7 +19,7 @@ const fs = require('fs-extra'); const path = require('path'); const util = require('util'); const shell = require('gulp-shell'); -const tapeUtil = require('../../test/unit/util.js'); +const tapeUtil = require('../../test/integration/util.js'); // Debug level of Docker containers used in scenario tests process.env.DOCKER_DEBUG = 'INFO'; @@ -288,16 +288,11 @@ gulp.task('run-tape-e2e', ['docker-ready'], }); // Filter out tests that should not be run on specific operating systems since only the x64 CI jobs are configured with SoftHSM -// - disable the pkcs11 (HSM) tests for s390 (non x86) // - may be enabled manually with an environment variable, (actually left enabled, but disable the non HSM version of the e2e test) function shouldRunTests(tests) { if (arch.startsWith('s390')) { - // for now always disable the pkcs11 testing on s390 - tests.push('!test/unit/pkcs11.js'); tests.push('!test/integration/network-e2e/e2e-hsm.js'); } else if (typeof process.env.PKCS11_TESTS === 'string' && process.env.PKCS11_TESTS.toLowerCase() === 'false') { - // Disable HSM tests if not doing PKCS11 testing - tests.push('!test/unit/pkcs11.js'); tests.push('!test/integration/network-e2e/e2e-hsm.js'); } else { // default is to run the PKCS11 tests so we need to disable the non HSM version diff --git a/test/integration/channel-event-hub.js b/test/integration/channel-event-hub.js index 199da4b535..c2049b93a4 100644 --- a/test/integration/channel-event-hub.js +++ b/test/integration/channel-event-hub.js @@ -18,7 +18,7 @@ const fs = require('fs'); const Long = require('long'); const Client = require('fabric-client'); -const testUtil = require('../unit/util.js'); +const testUtil = require('./util.js'); const e2eUtils = require('./e2e/e2eUtils.js'); // When running this as a standalone test, be sure to create and join a channel called 'mychannel' @@ -1033,7 +1033,7 @@ function createChaincodeRegistrationAsArray(t, message, event_hub, chaincode_id, t.fail('Failed to receive the ' + message + ' ::' + error); reject(error); }, - {as_array: true} + {as_array: true} ); }); return event_monitor; diff --git a/test/integration/client.js b/test/integration/client.js index 66199ca3a6..851d466789 100644 --- a/test/integration/client.js +++ b/test/integration/client.js @@ -16,7 +16,7 @@ const path = require('path'); const fs = require('fs-extra'); const Client = require('fabric-client'); -const testUtil = require('../unit/util.js'); +const testUtil = require('./util.js'); const couchdbUtil = require('./couchdb-util.js'); const tag = 'integration.client: '; diff --git a/test/integration/couchdb-fabricca-tests.js b/test/integration/couchdb-fabricca-tests.js index 8497b5b68a..d050f9157b 100644 --- a/test/integration/couchdb-fabricca-tests.js +++ b/test/integration/couchdb-fabricca-tests.js @@ -15,7 +15,7 @@ const path = require('path'); const Client = require('fabric-client'); const FabricCAServices = require('fabric-ca-client/lib/FabricCAServices'); -const testUtil = require('../unit/util.js'); +const testUtil = require('./util.js'); const couchdbUtil = require('./couchdb-util.js'); diff --git a/test/integration/create-configtx-channel.js b/test/integration/create-configtx-channel.js index 87ad76578b..78b762c191 100644 --- a/test/integration/create-configtx-channel.js +++ b/test/integration/create-configtx-channel.js @@ -16,7 +16,7 @@ const Client = require('fabric-client'); const fs = require('fs'); const path = require('path'); -const testUtil = require('../unit/util.js'); +const testUtil = require('./util.js'); const e2eUtils = require('./e2e/e2eUtils.js'); let ORGS; diff --git a/test/integration/discovery.js b/test/integration/discovery.js index 95c58e7cb5..990a3e68ae 100644 --- a/test/integration/discovery.js +++ b/test/integration/discovery.js @@ -15,7 +15,7 @@ const test = _test(tape); const fs = require('fs'); const path = require('path'); -const testUtil = require('../unit/util.js'); +const testUtil = require('./util.js'); test('\n\n***** D I S C O V E R Y *****\n\n', async (t) => { diff --git a/test/integration/e2e/create-channel.js b/test/integration/e2e/create-channel.js index 944fa1fe5b..f235eba30f 100644 --- a/test/integration/e2e/create-channel.js +++ b/test/integration/e2e/create-channel.js @@ -16,7 +16,7 @@ const Client = require('fabric-client'); const fs = require('fs'); const path = require('path'); -const testUtil = require('../../unit/util.js'); +const testUtil = require('../util.js'); const e2eUtils = require('./e2eUtils.js'); diff --git a/test/integration/e2e/e2eUtils.js b/test/integration/e2e/e2eUtils.js index cfa72002a4..f9c625385c 100644 --- a/test/integration/e2e/e2eUtils.js +++ b/test/integration/e2e/e2eUtils.js @@ -16,7 +16,7 @@ const fs = require('fs'); const util = require('util'); const Client = require('fabric-client'); -const testUtil = require('../../unit/util.js'); +const testUtil = require('../util.js'); const e2eUtils = require('./e2eUtils.js'); const e2e = testUtil.END2END; diff --git a/test/integration/e2e/getCollectionsConfig.js b/test/integration/e2e/getCollectionsConfig.js index 7c0fd445c8..8370f763a0 100644 --- a/test/integration/e2e/getCollectionsConfig.js +++ b/test/integration/e2e/getCollectionsConfig.js @@ -9,7 +9,7 @@ const _test = require('tape-promise').default; const test = _test(tape); const e2eUtils = require('./e2eUtils.js'); -const testUtil = require('../../unit/util.js'); +const testUtil = require('../util.js'); test('getCollectionsConfig from peer', async (t) => { const chaincodeId = testUtil.END2END.chaincodeIdPrivateData; diff --git a/test/integration/e2e/install-chaincode-fail.js b/test/integration/e2e/install-chaincode-fail.js index d685277f0e..2a60b34d21 100644 --- a/test/integration/e2e/install-chaincode-fail.js +++ b/test/integration/e2e/install-chaincode-fail.js @@ -16,7 +16,7 @@ const _test = require('tape-promise').default; const test = _test(tape); const e2eUtils = require('./e2eUtils.js'); -const testUtil = require('../../unit/util.js'); +const testUtil = require('../util.js'); test('\n\n***** End-to-end flow: chaincode install *****\n\n', (t) => { testUtil.setupChaincodeDeploy(); diff --git a/test/integration/e2e/install-chaincode.js b/test/integration/e2e/install-chaincode.js index b18a6091f2..5118a4f1f1 100644 --- a/test/integration/e2e/install-chaincode.js +++ b/test/integration/e2e/install-chaincode.js @@ -16,7 +16,7 @@ const _test = require('tape-promise').default; const test = _test(tape); const e2eUtils = require('./e2eUtils.js'); -const testUtil = require('../../unit/util.js'); +const testUtil = require('../util.js'); const version = 'v0'; diff --git a/test/integration/e2e/instantiate-chaincode.js b/test/integration/e2e/instantiate-chaincode.js index 0adea99ea8..c82c9b7ee2 100644 --- a/test/integration/e2e/instantiate-chaincode.js +++ b/test/integration/e2e/instantiate-chaincode.js @@ -16,7 +16,7 @@ const _test = require('tape-promise').default; const test = _test(tape); const e2eUtils = require('./e2eUtils.js'); -const testUtil = require('../../unit/util.js'); +const testUtil = require('../util.js'); test('\n\n***** End-to-end flow: instantiate chaincode *****\n\n', async (t) => { try { diff --git a/test/integration/e2e/invoke-transaction.js b/test/integration/e2e/invoke-transaction.js index 2830fb708b..cf68a15e06 100755 --- a/test/integration/e2e/invoke-transaction.js +++ b/test/integration/e2e/invoke-transaction.js @@ -12,7 +12,7 @@ const tape = require('tape'); const _test = require('tape-promise').default; const test = _test(tape); const e2eUtils = require('./e2eUtils.js'); -const testUtils = require('../../unit/util'); +const testUtils = require('../util.js'); const chaincodeId = testUtils.END2END.chaincodeId; test('\n\n***** End-to-end flow: invoke transaction to move money *****\n\n', async (t) => { diff --git a/test/integration/e2e/join-channel.js b/test/integration/e2e/join-channel.js index 300496fee0..39ae9a76e9 100644 --- a/test/integration/e2e/join-channel.js +++ b/test/integration/e2e/join-channel.js @@ -18,7 +18,7 @@ const fs = require('fs'); const Client = require('fabric-client'); -const testUtil = require('../../unit/util.js'); +const testUtil = require('../util.js'); const e2eUtils = require('./e2eUtils.js'); let tx_id = null; diff --git a/test/integration/e2e/private-data.js b/test/integration/e2e/private-data.js index 58947f80fd..8256ca13ff 100755 --- a/test/integration/e2e/private-data.js +++ b/test/integration/e2e/private-data.js @@ -18,7 +18,7 @@ const _test = require('tape-promise').default; const test = _test(tape); const e2eUtils = require('./e2eUtils.js'); -const testUtil = require('../../unit/util.js'); +const testUtil = require('../util.js'); const version = 'v0'; const chaincodeId = testUtil.END2END.chaincodeIdPrivateData; diff --git a/test/integration/e2e/query.js b/test/integration/e2e/query.js index dca6a182cb..d2dd7ed0ba 100644 --- a/test/integration/e2e/query.js +++ b/test/integration/e2e/query.js @@ -12,7 +12,7 @@ const tape = require('tape'); const _test = require('tape-promise').default; const test = _test(tape); const e2eUtils = require('./e2eUtils.js'); -const testUtils = require('../../unit/util'); +const testUtils = require('../util.js'); const chaincodeId = testUtils.END2END.chaincodeId; test('\n\n***** End-to-end flow: query chaincode *****\n\n', async (t) => { diff --git a/test/integration/e2e/updateAnchorPeers.js b/test/integration/e2e/updateAnchorPeers.js index b56936c64d..e88b6ed0e4 100644 --- a/test/integration/e2e/updateAnchorPeers.js +++ b/test/integration/e2e/updateAnchorPeers.js @@ -15,7 +15,7 @@ const fs = require('fs'); const path = require('path'); const _commonProto = require('fabric-protos').common; -const testUtil = require('../../unit/util.js'); +const testUtil = require('../util.js'); const e2eUtils = require('./e2eUtils.js'); const channel_name = process.env.channel ? process.env.channel : 'mychannel';// can use "channel=" to control the channel name from command line const anchorPeerTXFile = path.join(__dirname, '../../fixtures/crypto-material/channel-config/mychannel-org1anchor.tx'); diff --git a/test/integration/e2e/upgrade.js b/test/integration/e2e/upgrade.js index d64f4cd50e..06c6cedbf5 100644 --- a/test/integration/e2e/upgrade.js +++ b/test/integration/e2e/upgrade.js @@ -12,7 +12,7 @@ const tape = require('tape'); const _test = require('tape-promise').default; const test = _test(tape); const e2eUtils = require('./e2eUtils.js'); -const testUtil = require('../../unit/util.js'); +const testUtil = require('../util.js'); const chaincodeId = testUtil.END2END.chaincodeId; test('\n\n***** U P G R A D E flow: chaincode install *****\n\n', (t) => { diff --git a/test/integration/fabric-ca-services-tests.js b/test/integration/fabric-ca-services-tests.js index 15b4c0106a..85344bbe36 100644 --- a/test/integration/fabric-ca-services-tests.js +++ b/test/integration/fabric-ca-services-tests.js @@ -27,7 +27,7 @@ const fs = require('fs-extra'); const path = require('path'); const http = require('http'); -const testUtil = require('../unit/util.js'); +const testUtil = require('./util.js'); // var keyValStorePath = testUtil.KVS; diff --git a/test/integration/fileKeyValueStore-fabricca-tests.js b/test/integration/fileKeyValueStore-fabricca-tests.js index a71b9aeffd..55048dc7ff 100644 --- a/test/integration/fileKeyValueStore-fabricca-tests.js +++ b/test/integration/fileKeyValueStore-fabricca-tests.js @@ -11,7 +11,7 @@ const tape = require('tape'); const _test = require('tape-promise').default; const test = _test(tape); -const testUtil = require('../unit/util.js'); +const testUtil = require('./util.js'); const fs = require('fs-extra'); const path = require('path'); diff --git a/test/integration/get-config.js b/test/integration/get-config.js index f5a1faeab6..1770b8e3af 100644 --- a/test/integration/get-config.js +++ b/test/integration/get-config.js @@ -20,7 +20,7 @@ const fs = require('fs'); const e2eUtils = require('./e2e/e2eUtils.js'); const Client = require('fabric-client'); -const testUtil = require('../unit/util.js'); +const testUtil = require('./util.js'); const Peer = require('fabric-client/lib/Peer.js'); const Orderer = require('fabric-client/lib/Orderer.js'); diff --git a/test/integration/grpc.js b/test/integration/grpc.js index 48e4c5be64..e355914419 100644 --- a/test/integration/grpc.js +++ b/test/integration/grpc.js @@ -17,7 +17,7 @@ const fs = require('fs'); const crypto = require('crypto'); const e2eUtils = require('./e2e/e2eUtils.js'); -const testUtil = require('../unit/util.js'); +const testUtil = require('./util.js'); const Client = require('fabric-client'); const GRPC_SEND = 'grpc.max_send_message_length'; diff --git a/test/integration/install.js b/test/integration/install.js index e338f837d5..a124687507 100644 --- a/test/integration/install.js +++ b/test/integration/install.js @@ -20,7 +20,7 @@ const fs = require('fs'); const e2eUtils = require('./e2e/e2eUtils.js'); const Client = require('fabric-client'); -const testUtil = require('../unit/util.js'); +const testUtil = require('./util.js'); let ORGS; diff --git a/test/integration/instantiate.js b/test/integration/instantiate.js index 07b326b176..c2a7d6074a 100644 --- a/test/integration/instantiate.js +++ b/test/integration/instantiate.js @@ -17,7 +17,7 @@ const util = require('util'); const Client = require('fabric-client'); const {Utils:utils} = require('fabric-common'); const e2eUtils = require('./e2e/e2eUtils.js'); -const testUtil = require('../unit/util.js'); +const testUtil = require('./util.js'); const logger = utils.getLogger('instantiate-chaincode'); const e2e = testUtil.END2END; diff --git a/test/integration/invoke.js b/test/integration/invoke.js index b847edb333..774b56f350 100644 --- a/test/integration/invoke.js +++ b/test/integration/invoke.js @@ -17,7 +17,7 @@ const test = _test(tape); const Client = require('fabric-client'); const {Utils:utils} = require('fabric-common'); -const testUtil = require('../unit/util.js'); +const testUtil = require('./util.js'); const e2e = testUtil.END2END; const e2eUtils = require('./e2e/e2eUtils.js'); diff --git a/test/integration/network-config.js b/test/integration/network-config.js index f1d626228c..1dfe8af218 100644 --- a/test/integration/network-config.js +++ b/test/integration/network-config.js @@ -19,7 +19,7 @@ const fsx = require('fs-extra'); const path = require('path'); -const testUtil = require('../unit/util.js'); +const testUtil = require('./util.js'); test('\n\n***** clean up the connection profile testing stores *****\n\n', async (t) => { diff --git a/test/integration/network-e2e/install-chaincode.js b/test/integration/network-e2e/install-chaincode.js index 256823997e..5e5389a197 100644 --- a/test/integration/network-e2e/install-chaincode.js +++ b/test/integration/network-e2e/install-chaincode.js @@ -16,7 +16,7 @@ const _test = require('tape-promise').default; const test = _test(tape); const e2eUtils = require('../e2e/e2eUtils.js'); -const testUtil = require('../../unit/util.js'); +const testUtil = require('../util.js'); const version = 'v0'; test('\n\n***** Network End-to-end flow: chaincode install *****\n\n', (t) => { diff --git a/test/integration/network-e2e/instantiate-chaincode.js b/test/integration/network-e2e/instantiate-chaincode.js index 5405c89099..762850ca26 100644 --- a/test/integration/network-e2e/instantiate-chaincode.js +++ b/test/integration/network-e2e/instantiate-chaincode.js @@ -17,7 +17,7 @@ const _test = require('tape-promise').default; const test = _test(tape); const e2eUtils = require('../e2e/e2eUtils.js'); -const testUtil = require('../../unit/util.js'); +const testUtil = require('../util.js'); diff --git a/test/integration/network-e2e/invoke-hsm.js b/test/integration/network-e2e/invoke-hsm.js index 0ef5fbf60a..5b310af8c3 100644 --- a/test/integration/network-e2e/invoke-hsm.js +++ b/test/integration/network-e2e/invoke-hsm.js @@ -11,7 +11,7 @@ const {Gateway, HsmX509Provider, Wallets} = require('fabric-network'); const fs = require('fs-extra'); const e2eUtils = require('../e2e/e2eUtils.js'); -const testUtils = require('../../unit/util'); +const testUtils = require('../util.js'); const channelName = testUtils.NETWORK_END2END.channel; const chaincodeId = testUtils.NETWORK_END2END.chaincodeId; diff --git a/test/integration/network-e2e/updateAnchorPeers.js b/test/integration/network-e2e/updateAnchorPeers.js index 13786a098d..c588783e48 100644 --- a/test/integration/network-e2e/updateAnchorPeers.js +++ b/test/integration/network-e2e/updateAnchorPeers.js @@ -13,7 +13,7 @@ const test = _test(tape); const fs = require('fs'); const path = require('path'); -const testUtil = require('../../unit/util.js'); +const testUtil = require('../util.js'); const channel_name = testUtil.NETWORK_END2END.channel; const anchorPeerTXFileOrg1 = path.join(__dirname, '../../fixtures/crypto-material/channel-config/mychannel-org1anchor.tx'); diff --git a/test/integration/only-admin.js b/test/integration/only-admin.js index fd341696c5..11cc5a1623 100644 --- a/test/integration/only-admin.js +++ b/test/integration/only-admin.js @@ -15,7 +15,7 @@ const test = _test(tape); const fs = require('fs'); const path = require('path'); -const testUtil = require('../unit/util.js'); +const testUtil = require('./util.js'); // Testing will demostrate how the connetion profile configuration may hold a // admin user identity and it will be used for all fabric interactions. diff --git a/test/integration/orderer-channel-tests.js b/test/integration/orderer-channel-tests.js index d72448bf35..097ac1512f 100644 --- a/test/integration/orderer-channel-tests.js +++ b/test/integration/orderer-channel-tests.js @@ -16,7 +16,7 @@ const e2eUtils = require('./e2e/e2eUtils.js'); const fs = require('fs'); const path = require('path'); -const testUtil = require('../unit/util.js'); +const testUtil = require('./util.js'); const Client = require('fabric-client'); const Orderer = require('fabric-client/lib/Orderer.js'); diff --git a/test/integration/query.js b/test/integration/query.js index cf85cf2ed5..b480fc4567 100644 --- a/test/integration/query.js +++ b/test/integration/query.js @@ -25,7 +25,7 @@ const util = require('util'); const e2eUtils = require('./e2e/e2eUtils.js'); const fs = require('fs'); -const testUtil = require('../unit/util.js'); +const testUtil = require('./util.js'); const Client = require('fabric-client'); const Peer = require('fabric-client/lib/Peer.js'); const Orderer = require('fabric-client/lib/Orderer.js'); diff --git a/test/integration/upgrade.js b/test/integration/upgrade.js index eff23ff6c3..da093f1738 100644 --- a/test/integration/upgrade.js +++ b/test/integration/upgrade.js @@ -15,7 +15,7 @@ const fs = require('fs'); const Client = require('fabric-client'); const {Utils:utils} = require('fabric-common'); -const testUtil = require('../unit/util.js'); +const testUtil = require('./util.js'); const e2eUtils = require('./e2e/e2eUtils.js'); const logger = utils.getLogger('upgrade-chaincode'); diff --git a/test/unit/util.js b/test/integration/util.js similarity index 99% rename from test/unit/util.js rename to test/integration/util.js index b0f8dd59ca..d6c6bbf96b 100644 --- a/test/unit/util.js +++ b/test/integration/util.js @@ -117,7 +117,7 @@ module.exports.existsSync = function(absolutePath /* string*/) { module.exports.readFile = readFile; -Client.addConfigFile(path.join(__dirname, '../integration/e2e/config.json')); +Client.addConfigFile(path.join(__dirname, './e2e/config.json')); const ORGS = Client.getConfigSetting('test-network'); const tlsOptions = { diff --git a/test/typescript/integration/network-e2e/invoke.ts b/test/typescript/integration/network-e2e/invoke.ts index 3fa5d56061..1340bbb116 100644 --- a/test/typescript/integration/network-e2e/invoke.ts +++ b/test/typescript/integration/network-e2e/invoke.ts @@ -34,7 +34,7 @@ import { import e2eUtils = require('../../../integration/e2e/e2eUtils.js'); import sampleEventStrategy = require('../../../integration/network-e2e/sample-transaction-event-handler'); -import testUtils = require('../../../unit/util'); +import testUtils = require('../../../integration/util.js'); const test: any = tapePromise.default(tape); const channelName: string = testUtils.NETWORK_END2END.channel; diff --git a/test/typescript/integration/network-e2e/query.ts b/test/typescript/integration/network-e2e/query.ts index 8c2d5eedb9..388140e95d 100644 --- a/test/typescript/integration/network-e2e/query.ts +++ b/test/typescript/integration/network-e2e/query.ts @@ -28,7 +28,7 @@ import { import sampleQueryStrategy = require('./sample-query-handler'); import e2eUtils = require('../../../integration/e2e/e2eUtils.js'); -import testUtils = require('../../../unit/util.js'); +import testUtils = require('../../../integration/util.js'); const test: any = tapePromise.default(tape); const channelName: string = testUtils.NETWORK_END2END.channel;