From 8e44ac8c2db8147d0d01448419edf1be11ff7507 Mon Sep 17 00:00:00 2001 From: Sudesh Shetty Date: Wed, 10 Oct 2018 17:44:44 -0400 Subject: [PATCH] [FABG-773] Update to fabric 1.3.0 Change-Id: I0595580fa98e6c60ac76e5e2d5f07e318eea303a Signed-off-by: Sudesh Shetty --- Makefile | 12 +++++----- README.md | 8 +++---- test/fixtures/dockerenv/.env | 10 ++++----- test/fixtures/dockerenv/prev-env.sh | 14 ++++++------ .../negative/revoked/revoked_test.go | 2 +- .../client/channel/channel_client_pvt_test.go | 1 + .../common/selection/fabricselection_test.go | 22 ++++++++++++++++++- test/scripts/integration.sh | 3 ++- 8 files changed, 47 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index 56db38a03b..12bfc7b9c2 100644 --- a/Makefile +++ b/Makefile @@ -26,16 +26,16 @@ DOCKER_CMD ?= docker DOCKER_COMPOSE_CMD ?= docker-compose # Fabric versions used in the Makefile -FABRIC_STABLE_VERSION := 1.2.1 -FABRIC_STABLE_VERSION_MINOR := 1.2 +FABRIC_STABLE_VERSION := 1.3.0 +FABRIC_STABLE_VERSION_MINOR := 1.3 FABRIC_STABLE_VERSION_MAJOR := 1 -FABRIC_BASEIMAGE_STABLE_VERSION := 0.4.10 +FABRIC_BASEIMAGE_STABLE_VERSION := 0.4.13 -FABRIC_PRERELEASE_VERSION := 1.3.0-rc1 -FABRIC_PREV_VERSION := 1.1.0 +FABRIC_PRERELEASE_VERSION := +FABRIC_PREV_VERSION := 1.2.1 FABRIC_DEVSTABLE_VERSION_MINOR := 1.3 FABRIC_DEVSTABLE_VERSION_MAJOR := 1 -FABRIC_PREV_VERSION_MINOR := 1.1 +FABRIC_PREV_VERSION_MINOR := 1.2 # Build flags (overridable) GO_LDFLAGS ?= diff --git a/README.md b/README.md index 8c493a3542..c959147930 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,8 @@ You're good to go, happy coding! Check out the examples for usage demonstrations ### Current Compatibility The SDK's integration tests run against three tagged Fabric versions: -- prev (currently v1.1.1) -- stable (currently v1.2.1) +- prev (currently v1.2.1) +- stable (currently v1.3.0) - prerelease (currently disabled) Additionally for development purposes integration tests also run against the devstable Fabric version as needed. @@ -49,8 +49,8 @@ Additionally for development purposes integration tests also run against the dev ### Retired versions When the 'prev' code level is updated, the last tested fabric-sdk-go commit or tag is listed below. -- fabric v1.0 & fabric-ca v1.0 - - fabric-sdk-go: 5ac5226 +- fabric v1.2 & fabric-ca v1.2 +- fabric-sdk-go: ea10f6c ### Running the test suite diff --git a/test/fixtures/dockerenv/.env b/test/fixtures/dockerenv/.env index 392cf02ba4..c2200cceff 100644 --- a/test/fixtures/dockerenv/.env +++ b/test/fixtures/dockerenv/.env @@ -18,13 +18,13 @@ COMPOSE_PROJECT_NAME=fabsdkgo FABRIC_DOCKER_REGISTRY= FABRIC_BASE_DOCKER_REGISTRY= -FABRIC_FIXTURE_VERSION=v1.2 +FABRIC_FIXTURE_VERSION=v1.3 FABRIC_CRYPTOCONFIG_VERSION=v1 -FABRIC_CA_FIXTURE_TAG=1.2.1 -FABRIC_ORDERER_FIXTURE_TAG=1.2.1 -FABRIC_PEER_FIXTURE_TAG=1.2.1 -FABRIC_BUILDER_FIXTURE_TAG=1.2.1 +FABRIC_CA_FIXTURE_TAG=1.3.0 +FABRIC_ORDERER_FIXTURE_TAG=1.3.0 +FABRIC_PEER_FIXTURE_TAG=1.3.0 +FABRIC_BUILDER_FIXTURE_TAG=1.3.0 FABRIC_COUCHDB_FIXTURE_TAG=0.4.10 FABRIC_BASEOS_FIXTURE_TAG=0.4.10 FABRIC_BASEIMAGE_FIXTURE_TAG=0.4.10 diff --git a/test/fixtures/dockerenv/prev-env.sh b/test/fixtures/dockerenv/prev-env.sh index 8f08db129d..7b16426e82 100644 --- a/test/fixtures/dockerenv/prev-env.sh +++ b/test/fixtures/dockerenv/prev-env.sh @@ -9,16 +9,16 @@ # against the latest pre-release target. # Temporarily override FABRIC-ARCH until latest prev follows new naming conventions. -export FABRIC_ARCH="" -export FABRIC_ARCH_SEP="" +#export FABRIC_ARCH="amd64" +#export FABRIC_ARCH_SEP="-" -export FABRIC_FIXTURE_VERSION="v1.1" +export FABRIC_FIXTURE_VERSION="v1.2" export FABRIC_CRYPTOCONFIG_VERSION="v1" -export FABRIC_CA_FIXTURE_TAG="${ARCH}-1.1.0" -export FABRIC_ORDERER_FIXTURE_TAG="${ARCH}-1.1.1" -export FABRIC_PEER_FIXTURE_TAG="${ARCH}-1.1.1" -export FABRIC_BUILDER_FIXTURE_TAG="${ARCH}-1.1.1" +export FABRIC_CA_FIXTURE_TAG="1.2.1" +export FABRIC_ORDERER_FIXTURE_TAG="1.2.1" +export FABRIC_PEER_FIXTURE_TAG="1.2.1" +export FABRIC_BUILDER_FIXTURE_TAG="1.2.1" # override configuration that loads crypto-config export FABRIC_SDK_CLIENT_CRYPTOCONFIG_PATH='${GOPATH}'"/src/github.com/hyperledger/fabric-sdk-go/test/fixtures/fabric/${FABRIC_CRYPTOCONFIG_VERSION}/crypto-config" diff --git a/test/integration/negative/revoked/revoked_test.go b/test/integration/negative/revoked/revoked_test.go index 764246cc84..f8f01b8672 100644 --- a/test/integration/negative/revoked/revoked_test.go +++ b/test/integration/negative/revoked/revoked_test.go @@ -217,7 +217,7 @@ func testRevokedPeer(t *testing.T) { //query with revoked user queryCC(t, org1UserChannelClientContext, "exampleCC", false, "access denied") //query with valid user - queryCC(t, org2UserChannelClientContext, "exampleCC", false, "could not find chaincode with name 'exampleCC'") + queryCC(t, org2UserChannelClientContext, "exampleCC", false, "chaincode exampleCC not found") //query already instantiated chaincode with revoked user queryCC(t, org1UserChannelClientContext, "exampleCC2", false, "access denied") //query already instantiated chaincode with valid user diff --git a/test/integration/pkg/client/channel/channel_client_pvt_test.go b/test/integration/pkg/client/channel/channel_client_pvt_test.go index a1adf0303d..cf0b61866a 100644 --- a/test/integration/pkg/client/channel/channel_client_pvt_test.go +++ b/test/integration/pkg/client/channel/channel_client_pvt_test.go @@ -251,6 +251,7 @@ func TestChannelClientRollsBackPvtDataIfMvccReadConflict(t *testing.T) { Fcn: "getprivate", Args: [][]byte{[]byte(coll), []byte(key)}, }, + channel.WithRetry(retry.DefaultChannelOpts), ) require.NoErrorf(t, err, "error attempting to read private data") diff --git a/test/integration/pkg/client/common/selection/fabricselection_test.go b/test/integration/pkg/client/common/selection/fabricselection_test.go index 8a4a530288..ed28be546a 100644 --- a/test/integration/pkg/client/common/selection/fabricselection_test.go +++ b/test/integration/pkg/client/common/selection/fabricselection_test.go @@ -10,6 +10,10 @@ package selection import ( "testing" + "time" + + "github.com/hyperledger/fabric-sdk-go/pkg/common/errors/retry" + "github.com/hyperledger/fabric-sdk-go/pkg/common/errors/status" "github.com/stretchr/testify/require" @@ -24,6 +28,7 @@ import ( "github.com/hyperledger/fabric-sdk-go/test/integration" "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/common/cauthdsl" cb "github.com/hyperledger/fabric-sdk-go/third_party/github.com/hyperledger/fabric/protos/common" + grpcCodes "google.golang.org/grpc/codes" ) const ( @@ -49,6 +54,21 @@ var ( } ) +var testRetryOpts = retry.Opts{ + Attempts: 10, + InitialBackoff: 1 * time.Second, + MaxBackoff: 15 * time.Second, + BackoffFactor: 2, + RetryableCodes: map[status.Group][]status.Code{ + status.GRPCTransportStatus: { + status.Code(grpcCodes.Unavailable), + }, + status.DiscoveryServerStatus: { + status.QueryEndorsers, + }, + }, +} + func TestFabricSelection(t *testing.T) { sdk, err := fabsdk.New(integration.ConfigBackend, fabsdk.WithServicePkg(&fabricSelectionProviderFactory{})) @@ -304,7 +324,7 @@ func (cp *fabricSelectionChannelProvider) ChannelService(ctx fab.ClientContext, selection, ok := cp.services[channelID] if !ok { - selection, err = fabricselection.New(ctx, channelID, discovery) + selection, err = fabricselection.New(ctx, channelID, discovery, selectionopts.WithRetryOpts(testRetryOpts)) if err != nil { return nil, err } diff --git a/test/scripts/integration.sh b/test/scripts/integration.sh index 07a8736df5..566bf36c8a 100755 --- a/test/scripts/integration.sh +++ b/test/scripts/integration.sh @@ -18,12 +18,13 @@ set -e + GO_CMD="${GO_CMD:-go}" GOPATH="${GOPATH:-$HOME/go}" FABRIC_SDKGO_CODELEVEL_TAG="${FABRIC_SDKGO_CODELEVEL_TAG:-stable}" FABRIC_SDKGO_TESTRUN_ID="${FABRIC_SDKGO_TESTRUN_ID:-${RANDOM}}" FABRIC_CRYPTOCONFIG_VERSION="${FABRIC_CRYPTOCONFIG_VERSION:-v1}" -FABRIC_FIXTURE_VERSION="${FABRIC_FIXTURE_VERSION:-v1.2}" +FABRIC_FIXTURE_VERSION="${FABRIC_FIXTURE_VERSION:-v1.3}" CONFIG_FILE="${CONFIG_FILE:-config_test.yaml}" TEST_LOCAL="${TEST_LOCAL:-false}" TEST_CHANGED_ONLY="${TEST_CHANGED_ONLY:-false}"