Skip to content

Commit

Permalink
Include google compare library
Browse files Browse the repository at this point in the history
  • Loading branch information
dadgar committed Sep 5, 2017
1 parent b3c9acb commit 4c60d05
Show file tree
Hide file tree
Showing 22 changed files with 2,998 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Developing Nomad

If you wish to work on Nomad itself or any of its built-in systems,
you will first need [Go](https://www.golang.org) installed on your
machine (version 1.8+ is *required*).
machine (version 1.9+ is *required*).

**Developing with Vagrant**
There is an included Vagrantfile that can help bootstrap the process. The
Expand Down
10 changes: 6 additions & 4 deletions nomad/fsm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"testing"
"time"

"github.com/google/go-cmp/cmp"
memdb "github.com/hashicorp/go-memdb"
"github.com/hashicorp/nomad/helper"
"github.com/hashicorp/nomad/nomad/mock"
Expand Down Expand Up @@ -1745,11 +1746,12 @@ func TestFSM_SnapshotRestore_PeriodicLaunches(t *testing.T) {
ws := memdb.NewWatchSet()
out1, _ := state2.PeriodicLaunchByID(ws, launch1.ID)
out2, _ := state2.PeriodicLaunchByID(ws, launch2.ID)
if !reflect.DeepEqual(launch1, out1) {
t.Fatalf("bad: \n%#v\n%#v", out1, job1)

if !cmp.Equal(launch1, out1) {
t.Fatalf("bad: %v", cmp.Diff(launch1, out1))
}
if !reflect.DeepEqual(launch2, out2) {
t.Fatalf("bad: \n%#v\n%#v", out2, job2)
if !cmp.Equal(launch2, out2) {
t.Fatalf("bad: %v", cmp.Diff(launch2, out2))
}
}

Expand Down
10 changes: 7 additions & 3 deletions nomad/timetable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ package nomad

import (
"bytes"
"reflect"
"sync"
"testing"
"time"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/hashicorp/nomad/nomad/structs"
"github.com/ugorji/go/codec"
)
Expand Down Expand Up @@ -122,8 +124,10 @@ func TestTimeTable_SerializeDeserialize(t *testing.T) {
t.Fatalf("err: %v", err)
}

if !reflect.DeepEqual(tt.table, tt2.table) {
t.Fatalf("bad: %#v %#v", tt, tt2)
o := cmp.AllowUnexported(TimeTable{})
o2 := cmpopts.IgnoreTypes(sync.RWMutex{})
if !cmp.Equal(tt.table, tt2.table, o, o2) {
t.Fatalf("bad: %s", cmp.Diff(tt, tt2, o, o2))
}
}

Expand Down
27 changes: 27 additions & 0 deletions vendor/github.com/google/go-cmp/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

89 changes: 89 additions & 0 deletions vendor/github.com/google/go-cmp/cmp/cmpopts/equate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

148 changes: 148 additions & 0 deletions vendor/github.com/google/go-cmp/cmp/cmpopts/ignore.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4c60d05

Please sign in to comment.