Skip to content

Commit

Permalink
[FAB-1390] Move tape util file
Browse files Browse the repository at this point in the history
- Removes tape unit dir

Signed-off-by: heatherlp <heatherpollard0@gmail.com>
Change-Id: Ied6f5b7708658ab1392a7e2952b62ad4483def85
  • Loading branch information
heatherlp committed Oct 24, 2019
1 parent 03f6bbf commit 104ecd5
Show file tree
Hide file tree
Showing 37 changed files with 38 additions and 43 deletions.
7 changes: 1 addition & 6 deletions build/tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/integration/channel-event-hub.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/integration/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: ';
Expand Down
2 changes: 1 addition & 1 deletion test/integration/couchdb-fabricca-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
2 changes: 1 addition & 1 deletion test/integration/create-configtx-channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/integration/discovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {

Expand Down
2 changes: 1 addition & 1 deletion test/integration/e2e/create-channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');


Expand Down
2 changes: 1 addition & 1 deletion test/integration/e2e/e2eUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/integration/e2e/getCollectionsConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/integration/e2e/install-chaincode-fail.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion test/integration/e2e/install-chaincode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion test/integration/e2e/instantiate-chaincode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/e2e/invoke-transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/e2e/join-channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/integration/e2e/private-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/integration/e2e/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/e2e/updateAnchorPeers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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=<name>" to control the channel name from command line
const anchorPeerTXFile = path.join(__dirname, '../../fixtures/crypto-material/channel-config/mychannel-org1anchor.tx');
Expand Down
2 changes: 1 addition & 1 deletion test/integration/e2e/upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/fabric-ca-services-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/integration/fileKeyValueStore-fabricca-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion test/integration/get-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
2 changes: 1 addition & 1 deletion test/integration/grpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion test/integration/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/instantiate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/integration/invoke.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
2 changes: 1 addition & 1 deletion test/integration/network-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/network-e2e/install-chaincode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/network-e2e/instantiate-chaincode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');



Expand Down
2 changes: 1 addition & 1 deletion test/integration/network-e2e/invoke-hsm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion test/integration/network-e2e/updateAnchorPeers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
2 changes: 1 addition & 1 deletion test/integration/only-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion test/integration/orderer-channel-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion test/integration/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion test/integration/upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
2 changes: 1 addition & 1 deletion test/unit/util.js → test/integration/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion test/typescript/integration/network-e2e/invoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/typescript/integration/network-e2e/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 104ecd5

Please sign in to comment.