Skip to content

Commit

Permalink
Generate local Fabric with correct port configuration - integration t…
Browse files Browse the repository at this point in the history
…est changes (contributes to IBM-Blockchain#776)

Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
  • Loading branch information
Simon Stone committed Apr 23, 2019
1 parent 1506256 commit 4de3923
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions client/integrationTest/hlfv1/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ services:
- CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/peer/msp
- CORE_LEDGER_STATE_STATEDATABASE=CouchDB
- CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb:5984
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: peer node start
ports:
Expand Down
2 changes: 1 addition & 1 deletion client/integrationTest/integrationTestUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ export class IntegrationTestUtil {
await vscode.commands.executeCommand(ExtensionCommands.DELETE_IDENTITY);
}

this.showCertificateAuthorityQuickPickStub.withArgs('Choose certificate authority to create a new identity with').resolves('ca.example.com');
this.showCertificateAuthorityQuickPickStub.withArgs('Choose certificate authority to create a new identity with').resolves('ca.org1.example.com');
this.inputBoxStub.withArgs('Provide a name for the identity').resolves(name);
await vscode.commands.executeCommand(ExtensionCommands.CREATE_NEW_IDENTITY);
}
Expand Down
6 changes: 3 additions & 3 deletions client/integrationTest/nodeTests/integrationNode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ describe('Integration Tests for Node Smart Contracts', () => {
const nodesChildren: Array<SmartContractsTreeItem> = await myExtension.getBlockchainRuntimeExplorerProvider().getChildren(allChildren[2]) as Array<SmartContractsTreeItem>;
nodesChildren.length.should.equal(3);
nodesChildren[0].label.should.equal('peer0.org1.example.com');
nodesChildren[1].label.should.equal('ca.example.com');
nodesChildren[1].label.should.equal('ca.org1.example.com');
nodesChildren[2].label.should.equal('orderer.example.com');

let instantiatedChaincodesItems: Array<InstantiatedContractTreeItem> = await myExtension.getBlockchainRuntimeExplorerProvider().getChildren(smartContractsChildren[0]) as Array<InstantiatedContractTreeItem>;
Expand Down Expand Up @@ -297,7 +297,7 @@ describe('Integration Tests for Node Smart Contracts', () => {
const nodesChildren: Array<SmartContractsTreeItem> = await myExtension.getBlockchainRuntimeExplorerProvider().getChildren(allChildren[2]) as Array<SmartContractsTreeItem>;
nodesChildren.length.should.equal(3);
nodesChildren[0].label.should.equal('peer0.org1.example.com');
nodesChildren[1].label.should.equal('ca.example.com');
nodesChildren[1].label.should.equal('ca.org1.example.com');
nodesChildren[2].label.should.equal('orderer.example.com');

const instantiatedChaincodesItems: Array<InstantiatedContractTreeItem> = await myExtension.getBlockchainRuntimeExplorerProvider().getChildren(smartContractsChildren[0]) as Array<InstantiatedContractTreeItem>;
Expand All @@ -317,7 +317,7 @@ describe('Integration Tests for Node Smart Contracts', () => {
installedSmartContract.should.not.be.null;

integrationTestUtil.showIdentitiesQuickPickStub.withArgs('Choose an identity to connect with').resolves(FabricRuntimeUtil.ADMIN_USER);
await integrationTestUtil.connectToFabric(FabricRuntimeUtil.LOCAL_FABRIC, FabricWalletUtil.LOCAL_WALLET, 'Admin@org1.example.com');
await integrationTestUtil.connectToFabric(FabricRuntimeUtil.LOCAL_FABRIC, FabricWalletUtil.LOCAL_WALLET, 'admin');

allChildren = await myExtension.getBlockchainGatewayExplorerProvider().getChildren();

Expand Down
8 changes: 4 additions & 4 deletions client/integrationTest/tests/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ describe('Integration Tests for Fabric and Go/Java Smart Contracts', () => {

nodesChildren.length.should.equal(3);
nodesChildren[0].label.should.equal('peer0.org1.example.com');
nodesChildren[1].label.should.equal('ca.example.com');
nodesChildren[1].label.should.equal('ca.org1.example.com');
nodesChildren[2].label.should.equal('orderer.example.com');

const orgsChildren: Array<OrgTreeItem> = await myExtension.getBlockchainRuntimeExplorerProvider().getChildren(allChildren[3]) as Array<OrgTreeItem>;
Expand Down Expand Up @@ -400,7 +400,7 @@ describe('Integration Tests for Fabric and Go/Java Smart Contracts', () => {

const identitities: Array<BlockchainTreeItem> = await myExtension.getBlockchainWalletExplorerProvider().getChildren(wallets[0]);
identitities.length.should.equal(3);
identitities[0].label.should.equal('Admin@org1.example.com ⭑');
identitities[0].label.should.equal('admin ⭑');
identitities[1].label.should.equal(anotherIdentityName);
identitities[2].label.should.equal(otherUserName);

Expand Down Expand Up @@ -431,7 +431,7 @@ describe('Integration Tests for Fabric and Go/Java Smart Contracts', () => {
const nodesChildren: Array<PeerTreeItem> = await myExtension.getBlockchainRuntimeExplorerProvider().getChildren(allChildren[2]) as Array<PeerTreeItem>;
nodesChildren.length.should.equal(3);
nodesChildren[0].label.should.equal('peer0.org1.example.com');
nodesChildren[1].label.should.equal('ca.example.com');
nodesChildren[1].label.should.equal('ca.org1.example.com');
nodesChildren[2].label.should.equal('orderer.example.com');

let instantiatedChaincodesItems: Array<InstantiatedChaincodeTreeItem> = await myExtension.getBlockchainRuntimeExplorerProvider().getChildren(smartContractsChildren[0]) as Array<InstantiatedChaincodeTreeItem>;
Expand All @@ -443,7 +443,7 @@ describe('Integration Tests for Fabric and Go/Java Smart Contracts', () => {
instantiatedSmartContract.should.not.be.null;

integrationTestUtil.showIdentitiesQuickPickStub.resolves(FabricRuntimeUtil.ADMIN_USER);
await integrationTestUtil.connectToFabric(FabricRuntimeUtil.LOCAL_FABRIC, FabricWalletUtil.LOCAL_WALLET, 'Admin@org1.example.com');
await integrationTestUtil.connectToFabric(FabricRuntimeUtil.LOCAL_FABRIC, FabricWalletUtil.LOCAL_WALLET, 'admin');
await integrationTestUtil.submitTransactionToChaincode(smartContractName, '0.0.1', 'transaction1', 'hello,world');
await vscode.commands.executeCommand(ExtensionCommands.DISCONNECT);

Expand Down

0 comments on commit 4de3923

Please sign in to comment.