Moved dependencies management to glide

This commit is contained in:
Carlos Salguero
2017-02-15 14:37:32 -03:00
parent b28799f8d2
commit a9dba7a9bf
7 changed files with 112 additions and 8 deletions

3
.gitignore vendored
View File

@@ -14,4 +14,5 @@ bin/pt-mongodb-*
!src/go/pt-mongodb-summary/vendor/vendor.json
src/go/pt-mongodb-query-digest/vendor/
src/go/pt-mongodb-summary/vendor/
!vendor/vendor.json
vendor/

75
glide.lock generated Normal file
View File

@@ -0,0 +1,75 @@
hash: 2ff7c989fb0fde1375999fded74ae44e10be513a21416571f026390b679924e4
updated: 2017-02-15T13:56:15.338996189-03:00
imports:
- name: github.com/bradfitz/slice
version: d9036e2120b5ddfa53f3ebccd618c4af275f47da
- name: github.com/go-ole/go-ole
version: de8695c8edbf8236f30d6e1376e20b198a028d42
subpackages:
- oleutil
- name: github.com/golang/mock
version: bd3c8e81be01eef76d4b503f5e687d2d1354d2d9
subpackages:
- gomock
- name: github.com/hashicorp/go-version
version: 03c5bf6be031b6dd45afec16b1cf94fc8938bc77
- name: github.com/howeyc/gopass
version: bf9dde6d0d2c004a008c27aaee91170c786f6db8
- name: github.com/kr/pretty
version: cfb55aafdaf3ec08f0db22699ab822c50091b1c4
- name: github.com/kr/text
version: 7cafcd837844e784b526369c9bce262804aebc60
- name: github.com/montanaflynn/stats
version: eeaced052adbcfeea372c749c281099ed7fdaa38
- name: github.com/pborman/getopt
version: 7148bc3a4c3008adfcab60cbebfd0576018f330b
- name: github.com/percona/pmgo
version: 27d979df6c6885ff16abe375aead061a86da6df8
subpackages:
- pmgomock
- name: github.com/pkg/errors
version: 645ef00459ed84a119197bfb8d8205042c6df63d
- name: github.com/satori/go.uuid
version: 879c5887cd475cd7864858769793b2ceb0d44feb
- name: github.com/shirou/gopsutil
version: 70a1b78fe69202d93d6718fc9e3a4d6f81edfd58
subpackages:
- cpu
- host
- internal/common
- mem
- net
- process
- name: github.com/shirou/w32
version: bb4de0191aa41b5507caa14b0650cdbddcd9280b
- name: github.com/sirupsen/logrus
version: c078b1e43f58d563c74cebe63c85789e76ddb627
- name: github.com/StackExchange/wmi
version: e542ed97d15e640bdc14b5c12162d59e8fc67324
- name: go4.org
version: 7ce08ca145dbe0e66a127c447b80ee7914f3e4f9
subpackages:
- reflectutil
- name: golang.org/x/crypto
version: 453249f01cfeb54c3d549ddb75ff152ca243f9d8
subpackages:
- ssh/terminal
- name: golang.org/x/net
version: 61557ac0112b576429a0df080e1c2cef5dfbb642
subpackages:
- context
- name: golang.org/x/sys
version: e24f485414aeafb646f6fca458b0bf869c0880a1
subpackages:
- unix
- name: gopkg.in/mgo.v2
version: 3f83fa5005286a7fe593b055f0d7771a7dce4655
subpackages:
- bson
- dbtest
- internal/json
- internal/sasl
- internal/scram
- name: gopkg.in/tomb.v2
version: d5d1b5820637886def9eef33e03a27a9f166942c
testImports: []

27
glide.yaml Normal file
View File

@@ -0,0 +1,27 @@
package: github.com/percona/percona-toolkit
import:
- package: github.com/bradfitz/slice
- package: github.com/hashicorp/go-version
- package: github.com/howeyc/gopass
- package: github.com/kr/pretty
- package: github.com/montanaflynn/stats
version: ^0.2.0
- package: github.com/pborman/getopt
- package: github.com/percona/pmgo
- package: github.com/pkg/errors
version: ^0.8.0
- package: github.com/satori/go.uuid
version: ^1.1.0
- package: github.com/shirou/gopsutil
version: ^2.17.1
subpackages:
- process
- package: github.com/sirupsen/logrus
version: ^0.11.2
- package: gopkg.in/mgo.v2
subpackages:
- bson
testImport:
- package: github.com/golang/mock
subpackages:
- gomock

View File

@@ -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)
}

View File

@@ -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"

View File

@@ -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)

View File

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