Skip to content

Commit 78a02ad

Browse files
denyeartjt-nti
authored andcommitted
Add fv test chaincode deploy logging
Previously if chaincode deploy failed during fvt tests no message was logged making it impossible to troubleshoot. Now the chaincode deploy commands and results and logged. Signed-off-by: David Enyeart <enyeart@us.ibm.com>
1 parent 341956d commit 78a02ad

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

test/fv/utils.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88
const util = require('util');
99
const childProcess = require('child_process');
10+
const execSync = require('child_process').execSync;
1011
const exec = util.promisify(childProcess.exec);
1112
const fs = require('fs');
1213
const path = require('path');
1314
const ip = require('ip');
14-
const execSync = require('child_process').execSync;
1515

1616
const ordererCA = '/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem';
1717
const dir = path.join(__dirname, '..', '..', 'fabric-samples');
@@ -43,7 +43,16 @@ async function install(ccName, transient) {
4343
const CCDir = path.join(__dirname, '..', 'chaincodes', ccName);
4444
const collectionConfig = transient ? `-cccg ${CCDir}/collection-config/collection.json` : '';
4545
const cmd = `cd ${networkScriptDir} && ./network.sh deployCC -ccn ${ccName} -ccp ${CCDir} -ccl javascript ${collectionConfig} -ccep "OR('Org1MSP.peer','Org2MSP.peer')"`;
46-
await exec(cmd);
46+
47+
const {error, stderr, stdout} = await exec(cmd);
48+
if (error) {
49+
console.log(`error: ${error.message}`);
50+
}
51+
if (stderr) {
52+
console.log(`stderr: ${stderr}`);
53+
}
54+
console.log(`stdout: ${stdout}`);
55+
4756
} finally {
4857
fs.unlinkSync(npmrc);
4958
}

0 commit comments

Comments
 (0)