Skip to content

Commit

Permalink
[FAB-6356] Setting logprovider in advance for SDK tests
Browse files Browse the repository at this point in the history
Some tests directly call SDK api in advance before calling
fabapi.NewSDK() function for testing. Just to make sure
related log lines are not skipped, setting a login provider
in advance in main_test.


Change-Id: Ie83029764ad8e37f856fd53f853fbee30d308dcd
Signed-off-by: Sudesh Shetty <sudesh.shetty@securekey.com>
  • Loading branch information
sudeshrshetty committed Nov 14, 2017
1 parent 73a1e9b commit b930c3b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/integration/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"testing"

config "github.com/hyperledger/fabric-sdk-go/api/apiconfig"
"github.com/hyperledger/fabric-sdk-go/pkg/logging"
"github.com/hyperledger/fabric-sdk-go/pkg/logging/deflogger"
)

var testFabricConfig config.Config
Expand All @@ -23,6 +25,12 @@ func TestMain(m *testing.M) {
}

func setup() {

//Setup logging provider in advance for tests to make sure none of the test logs are being skipped
if !logging.IsLoggerInitialized() {
logging.InitLogger(deflogger.GetLoggingProvider())
}

// do any test setup for all tests here...
var err error

Expand Down

0 comments on commit b930c3b

Please sign in to comment.