Skip to content

Commit

Permalink
[FABG-773] Update to fabric 1.3.0
Browse files Browse the repository at this point in the history
Change-Id: I0595580fa98e6c60ac76e5e2d5f07e318eea303a
Signed-off-by: Sudesh Shetty <sudesh.shetty@securekey.com>
  • Loading branch information
sudeshrshetty committed Oct 10, 2018
1 parent f7ae259 commit 8e44ac8
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 25 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?=
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ 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.

### 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

Expand Down
10 changes: 5 additions & 5 deletions test/fixtures/dockerenv/.env
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions test/fixtures/dockerenv/prev-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion test/integration/negative/revoked/revoked_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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 (
Expand All @@ -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{}))
Expand Down Expand Up @@ -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
}
Expand Down
3 changes: 2 additions & 1 deletion test/scripts/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 8e44ac8

Please sign in to comment.