Skip to content

Commit 9a5049c

Browse files
committed
[FAB-3160] Move core/config to core/testutil
This will pave the way for avoiding a circular reference once we add the real support for config-relative pathing as part of FAB-3160 Change-Id: Ie01790862f0945816e74ca263ef96d342d3506be Signed-off-by: Greg Haskins <[email protected]>
1 parent bd14ee7 commit 9a5049c

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

core/chaincode/platforms/car/test/platform_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ import (
2121
"testing"
2222

2323
"github.com/hyperledger/fabric/common/util"
24-
"github.com/hyperledger/fabric/core/config"
2524
"github.com/hyperledger/fabric/core/container"
25+
"github.com/hyperledger/fabric/core/testutil"
2626
pb "github.com/hyperledger/fabric/protos/peer"
2727
)
2828

2929
func TestMain(m *testing.M) {
30-
config.SetupTestConfig("../../../../../peer")
30+
testutil.SetupTestConfig("../../../../../peer")
3131
os.Exit(m.Run())
3232
}
3333

core/chaincode/platforms/java/test/java_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ import (
2121
"testing"
2222

2323
"github.com/hyperledger/fabric/common/util"
24-
"github.com/hyperledger/fabric/core/config"
2524
"github.com/hyperledger/fabric/core/container"
25+
"github.com/hyperledger/fabric/core/testutil"
2626
pb "github.com/hyperledger/fabric/protos/peer"
2727
)
2828

2929
func TestMain(m *testing.M) {
30-
config.SetupTestConfig("../../../../../peer")
30+
testutil.SetupTestConfig("../../../../../peer")
3131
os.Exit(m.Run())
3232
}
3333

core/comm/connection_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
"github.com/spf13/viper"
2626

27-
"github.com/hyperledger/fabric/core/config"
27+
"github.com/hyperledger/fabric/core/testutil"
2828
"github.com/stretchr/testify/assert"
2929
"google.golang.org/grpc"
3030
)
@@ -52,7 +52,7 @@ VQQLDAtIeXBlcmxlZGdlcjESMBAGA1UEAwwJbG9jYWxob3N0MFkwEwYHKoZIzj0C
5252
`
5353

5454
func TestConnection_Correct(t *testing.T) {
55-
config.SetupTestConfig("./../../peer")
55+
testutil.SetupTestConfig("./../../peer")
5656
viper.Set("ledger.blockchain.deploy-system-chaincode", "false")
5757
peerAddress := GetPeerTestingAddress("7051")
5858
var tmpConn *grpc.ClientConn
@@ -69,7 +69,7 @@ func TestConnection_Correct(t *testing.T) {
6969
}
7070

7171
func TestConnection_WrongAddress(t *testing.T) {
72-
config.SetupTestConfig("./../../peer")
72+
testutil.SetupTestConfig("./../../peer")
7373
viper.Set("ledger.blockchain.deploy-system-chaincode", "false")
7474
peerAddress := GetPeerTestingAddress("7052")
7575
var tmpConn *grpc.ClientConn

core/container/dockercontroller/dockercontroller_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ import (
2525
"github.com/spf13/viper"
2626

2727
"github.com/hyperledger/fabric/common/ledger/testutil"
28-
"github.com/hyperledger/fabric/core/config"
28+
coreutil "github.com/hyperledger/fabric/core/testutil"
2929
)
3030

3131
func TestHostConfig(t *testing.T) {
32-
config.SetupTestConfig("./../../../peer")
32+
coreutil.SetupTestConfig("./../../../peer")
3333
var hostConfig = new(docker.HostConfig)
3434
err := viper.UnmarshalKey("vm.docker.hostConfig", hostConfig)
3535
if err != nil {
@@ -44,7 +44,7 @@ func TestHostConfig(t *testing.T) {
4444
func TestGetDockerHostConfig(t *testing.T) {
4545
os.Setenv("HYPERLEDGER_VM_DOCKER_HOSTCONFIG_NETWORKMODE", "overlay")
4646
os.Setenv("HYPERLEDGER_VM_DOCKER_HOSTCONFIG_CPUSHARES", fmt.Sprint(1024*1024*1024*2))
47-
config.SetupTestConfig("./../../../peer")
47+
coreutil.SetupTestConfig("./../../../peer")
4848
hostConfig := getDockerHostConfig()
4949
testutil.AssertNotNil(t, hostConfig)
5050
testutil.AssertEquals(t, hostConfig.NetworkMode, "overlay")

core/config/config.go core/testutil/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package config
17+
package testutil
1818

1919
import (
2020
"flag"

0 commit comments

Comments
 (0)