From 526c4fb122e519a60d742b58e48003b06b9522b4 Mon Sep 17 00:00:00 2001 From: Peter Somogyvari Date: Sun, 20 Jun 2021 23:09:18 +0000 Subject: [PATCH 1/3] test(connector-fabric): fix v1.4.8 golang chaincode test Pinned all the hello world chaincode's dependencies to exact versions that are known to have worked in the past for builds. We needed this because the 1.13 go version of the Fabric CLI container could no longer build (tidy+vendor) the dependencies that were built with the newer versions of go such as 1.16 and 1.17. More info about the root cause can be read here: https://github.com/golang/go/issues/40067 By locking the dependencies versions to older ones we we ensured that the older go installation of the Fabric CLI container does not fail. The known-to-be-working dependency versions are coming from packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/fixtures/go/hello-world-contract-fabric-v14/hello-world-contract-go-mod.ts Signed-off-by: Peter Somogyvari --- .../deploy-cc-from-golang-source.test.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v1-4-x/deploy-cc-from-golang-source.test.ts b/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v1-4-x/deploy-cc-from-golang-source.test.ts index 55291a77f1a..45318caacaf 100644 --- a/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v1-4-x/deploy-cc-from-golang-source.test.ts +++ b/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v1-4-x/deploy-cc-from-golang-source.test.ts @@ -55,6 +55,7 @@ test(testCase, async (t: Test) => { }); const ledger = new FabricTestLedgerV1({ emitContainerLogs: true, + logLevel, publishAllPorts: true, // imageName: "faio14x", // imageVersion: "latest", @@ -179,8 +180,26 @@ test(testCase, async (t: Test) => { moduleName: "hello-world", targetOrganizations: [org1Env, org2Env], pinnedDeps: [ + "github.com/Knetic/govaluate@v3.0.0+incompatible", + "github.com/Shopify/sarama@v1.27.0", + "github.com/fsouza/go-dockerclient@v1.6.5", + "github.com/grpc-ecosystem/go-grpc-middleware@v1.2.1", + "github.com/hashicorp/go-version@v1.2.1", "github.com/hyperledger/fabric@v1.4.8", + "github.com/hyperledger/fabric-amcl@v0.0.0-20200424173818-327c9e2cf77a", + "github.com/miekg/pkcs11@v1.0.3", + "github.com/mitchellh/mapstructure@v1.3.3", + "github.com/onsi/ginkgo@v1.14.1", + "github.com/onsi/gomega@v1.10.2", + "github.com/op/go-logging@v0.0.0-20160315200505-970db520ece7", + "github.com/pkg/errors@v0.9.1", + "github.com/spf13/viper@v1.7.1", + "github.com/stretchr/testify@v1.6.1", + "github.com/sykesm/zap-logfmt@v0.0.3", + "go.uber.org/zap@v1.16.0", + "golang.org/x/crypto@v0.0.0-20200820211705-5c72a883971a", "golang.org/x/net@v0.0.0-20210503060351-7fd8e65b6420", + "google.golang.org/grpc@v1.31.1", ], }); From b2d47d0959b9aea7f8f8a47bfd02e8c899e3141e Mon Sep 17 00:00:00 2001 From: Youngone Lee Date: Fri, 11 Jun 2021 11:25:48 -0500 Subject: [PATCH 2/3] style(linter): shipment-detail page linter fix Signed-off-by: Youngone Lee --- .../src/app/shipment/shipment-detail/shipment-detail.page.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/cactus-example-supply-chain-frontend/src/app/shipment/shipment-detail/shipment-detail.page.ts b/examples/cactus-example-supply-chain-frontend/src/app/shipment/shipment-detail/shipment-detail.page.ts index 960508d3b16..6bafdfe8d27 100644 --- a/examples/cactus-example-supply-chain-frontend/src/app/shipment/shipment-detail/shipment-detail.page.ts +++ b/examples/cactus-example-supply-chain-frontend/src/app/shipment/shipment-detail/shipment-detail.page.ts @@ -46,7 +46,7 @@ export class ShipmentDetailPage implements OnInit { } } - async ngOnInit() { + async ngOnInit(): Promise { this.log.debug("component initialized.", this.shipment); this._supplyChainApi = await this.baseClient.ofLedger( From 183ce86f30868436eea576038ef293bd540fcb0c Mon Sep 17 00:00:00 2001 From: Peter Somogyvari Date: Mon, 21 Jun 2021 11:51:46 -0700 Subject: [PATCH 3/3] test: add logLevel parameter to Fabric AIO ctor calls This is another step taken to win the epic battle that we have been waging against a particularly nasty test flake that is plaguing the Fabric tests that use the AIO ledger. This will make the test output much more verbose, but there's no other way around to making sure that we can narrow down the root cause of the flake to a specific issue. Signed-off-by: Peter Somogyvari --- .../infrastructure/supply-chain-app-dummy-infrastructure.ts | 1 + .../deploy-cc-from-golang-source-private-data.test.ts | 1 + .../fabric-v2-2-x/deploy-cc-from-golang-source.test.ts | 1 + .../fabric-v2-2-x/deploy-cc-from-javascript-source.test.ts | 1 + .../fabric-v2-2-x/deploy-cc-from-typescript-source.test.ts | 1 + 5 files changed, 5 insertions(+) diff --git a/examples/cactus-example-supply-chain-backend/src/main/typescript/infrastructure/supply-chain-app-dummy-infrastructure.ts b/examples/cactus-example-supply-chain-backend/src/main/typescript/infrastructure/supply-chain-app-dummy-infrastructure.ts index 97110b1b26e..23f6dc4abbf 100644 --- a/examples/cactus-example-supply-chain-backend/src/main/typescript/infrastructure/supply-chain-app-dummy-infrastructure.ts +++ b/examples/cactus-example-supply-chain-backend/src/main/typescript/infrastructure/supply-chain-app-dummy-infrastructure.ts @@ -109,6 +109,7 @@ export class SupplyChainAppDummyInfrastructure { publishAllPorts: true, imageName: "hyperledger/cactus-fabric-all-in-one", imageVersion: "2021-03-02-ssh-hotfix", + logLevel: level, }); if (this.options.keychain) { diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-golang-source-private-data.test.ts b/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-golang-source-private-data.test.ts index 6c144962533..9df87556f13 100644 --- a/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-golang-source-private-data.test.ts +++ b/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-golang-source-private-data.test.ts @@ -61,6 +61,7 @@ test(testCase, async (t: Test) => { imageName: "hyperledger/cactus-fabric2-all-in-one", imageVersion: "2021-04-20-nodejs", envVars: new Map([["FABRIC_VERSION", "2.2.0"]]), + logLevel, }); const tearDown = async () => { await ledger.stop(); diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-golang-source.test.ts b/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-golang-source.test.ts index 859abb44a1f..272a8bd9433 100644 --- a/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-golang-source.test.ts +++ b/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-golang-source.test.ts @@ -63,6 +63,7 @@ test(testCase, async (t: Test) => { imageName: "hyperledger/cactus-fabric2-all-in-one", imageVersion: "2021-04-20-nodejs", envVars: new Map([["FABRIC_VERSION", "2.2.0"]]), + logLevel, }); const tearDown = async () => { diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-javascript-source.test.ts b/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-javascript-source.test.ts index 039ece4fdc2..b3ea5f13222 100644 --- a/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-javascript-source.test.ts +++ b/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-javascript-source.test.ts @@ -64,6 +64,7 @@ test(testCase, async (t: Test) => { imageName: "hyperledger/cactus-fabric2-all-in-one", imageVersion: "2021-04-20-nodejs", envVars: new Map([["FABRIC_VERSION", "2.2.0"]]), + logLevel, }); const tearDown = async () => { await ledger.stop(); diff --git a/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-typescript-source.test.ts b/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-typescript-source.test.ts index cf24856829b..c5c99c56a29 100644 --- a/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-typescript-source.test.ts +++ b/packages/cactus-plugin-ledger-connector-fabric/src/test/typescript/integration/fabric-v2-2-x/deploy-cc-from-typescript-source.test.ts @@ -64,6 +64,7 @@ test(testCase, async (t: Test) => { imageName: "hyperledger/cactus-fabric2-all-in-one", imageVersion: "2021-04-20-nodejs", envVars: new Map([["FABRIC_VERSION", "2.2.0"]]), + logLevel, }); const tearDown = async () => { await ledger.stop();