PMM-4278 Replace bson to official mongo-driver.

This commit is contained in:
Anton Kucherov
2019-07-01 12:53:15 +03:00
parent 32fb3bb3f2
commit f955451fe5
12 changed files with 88 additions and 51 deletions

View File

@@ -9,10 +9,11 @@ import (
"testing"
"github.com/Masterminds/semver"
"github.com/percona/pmgo"
"go.mongodb.org/mongo-driver/bson"
"github.com/percona/percona-toolkit/src/go/lib/tutil"
"github.com/percona/percona-toolkit/src/go/mongolib/proto"
"github.com/percona/pmgo"
"gopkg.in/mgo.v2/bson"
)
const (
@@ -137,7 +138,7 @@ func TestExplain(t *testing.T) {
if err != nil {
t.Fatalf("cannot load sample %s: %s", dir+file.Name(), err)
}
query, err := bson.MarshalJSON(eq)
query, err := bson.MarshalExtJSON(eq, true, true)
if err != nil {
t.Fatalf("cannot marshal json %s: %s", dir+file.Name(), err)
}
@@ -150,7 +151,7 @@ func TestExplain(t *testing.T) {
if err == nil {
result := proto.BsonD{}
err = bson.UnmarshalJSON(got, &result)
err = bson.UnmarshalExtJSON(got, true, &result)
if err != nil {
t.Fatalf("cannot unmarshal json explain result: %s", err)
}