mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 21:51:21 +00:00
Moved dependencies management to glide
This commit is contained in:
@@ -7,12 +7,12 @@ import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/percona/percona-toolkit/src/go/lib/util"
|
||||
"github.com/percona/percona-toolkit/src/go/lib/tutil"
|
||||
)
|
||||
|
||||
func TestReadConfig(t *testing.T) {
|
||||
|
||||
rootPath, err := util.RootPath()
|
||||
rootPath, err := tutil.RootPath()
|
||||
if err != nil {
|
||||
t.Errorf("cannot get root path: %s", err)
|
||||
}
|
||||
@@ -70,7 +70,7 @@ func TestReadConfig(t *testing.T) {
|
||||
|
||||
func TestOverrideConfig(t *testing.T) {
|
||||
|
||||
rootPath, err := util.RootPath()
|
||||
rootPath, err := tutil.RootPath()
|
||||
if err != nil {
|
||||
t.Errorf("cannot get root path: %s", err)
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/percona/toolkit-go/mongolib/proto"
|
||||
"github.com/percona/percona-toolkit/src/go/mongolib/proto"
|
||||
|
||||
mgo "gopkg.in/mgo.v2"
|
||||
"gopkg.in/mgo.v2/bson"
|
||||
|
@@ -8,7 +8,7 @@ import (
|
||||
"gopkg.in/mgo.v2/bson"
|
||||
|
||||
"github.com/golang/mock/gomock"
|
||||
lutil "github.com/percona/percona-toolkit/src/go/lib/util"
|
||||
"github.com/percona/percona-toolkit/src/go/lib/tutil"
|
||||
"github.com/percona/percona-toolkit/src/go/mongolib/proto"
|
||||
"github.com/percona/pmgo/pmgomock"
|
||||
)
|
||||
@@ -125,7 +125,7 @@ func TestGetReplicasetMembers(t *testing.T) {
|
||||
|
||||
database := pmgomock.NewMockDatabaseManager(ctrl)
|
||||
ss := proto.ServerStatus{}
|
||||
lutil.LoadJson("test/sample/serverstatus.json", &ss)
|
||||
tutil.LoadJson("test/sample/serverstatus.json", &ss)
|
||||
|
||||
dialer.EXPECT().DialWithInfo(gomock.Any()).Return(session, nil)
|
||||
session.EXPECT().Run(bson.M{"replSetGetStatus": 1}, gomock.Any()).SetArg(1, mockrss)
|
||||
|
@@ -79,7 +79,6 @@ func GetHostnames(dialer pmgo.Dialer, di *mgo.DialInfo) ([]string, error) {
|
||||
if err != nil {
|
||||
return hostnames, err
|
||||
}
|
||||
defer session.Close()
|
||||
session.SetMode(mgo.Monotonic, true)
|
||||
|
||||
// Probably we are connected to an individual member of a replica set
|
||||
@@ -88,6 +87,8 @@ func GetHostnames(dialer pmgo.Dialer, di *mgo.DialInfo) ([]string, error) {
|
||||
return buildHostsListFromReplStatus(rss), nil
|
||||
}
|
||||
|
||||
defer session.Close()
|
||||
|
||||
// Try getShardMap first. If we are connected to a mongos it will return
|
||||
// all hosts, including config hosts
|
||||
var shardsMap proto.ShardsMap
|
||||
|
Reference in New Issue
Block a user