Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit b930c3b

Browse files
committed
[FAB-6356] Setting logprovider in advance for SDK tests
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>
1 parent 73a1e9b commit b930c3b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/integration/main_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import (
1111
"testing"
1212

1313
config "github.com/hyperledger/fabric-sdk-go/api/apiconfig"
14+
"github.com/hyperledger/fabric-sdk-go/pkg/logging"
15+
"github.com/hyperledger/fabric-sdk-go/pkg/logging/deflogger"
1416
)
1517

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

2527
func setup() {
28+
29+
//Setup logging provider in advance for tests to make sure none of the test logs are being skipped
30+
if !logging.IsLoggerInitialized() {
31+
logging.InitLogger(deflogger.GetLoggingProvider())
32+
}
33+
2634
// do any test setup for all tests here...
2735
var err error
2836

0 commit comments

Comments
 (0)