Skip to content

Commit

Permalink
Fix compilation fail in test after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
preetapan committed Mar 28, 2018
1 parent 57872ff commit 09fa5f5
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions command/agent/config_parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ package agent

import (
"path/filepath"
"reflect"
"strings"
"testing"
"time"

"github.com/hashicorp/nomad/helper"
"github.com/hashicorp/nomad/nomad/structs/config"
"github.com/kr/pretty"
"github.com/stretchr/testify/require"
)

func TestConfig_Parse(t *testing.T) {
Expand Down Expand Up @@ -224,11 +222,11 @@ func TestConfig_Parse(t *testing.T) {
Enabled: false,
StateDir: "",
AllocDir: "",
Servers: []string{},
Servers: nil,
NodeClass: "",
Meta: map[string]string{},
Options: map[string]string{},
ChrootEnv: map[string]string{},
Meta: nil,
Options: nil,
ChrootEnv: nil,
NetworkInterface: "",
NetworkSpeed: 0,
CpuCompute: 0,
Expand All @@ -251,19 +249,20 @@ func TestConfig_Parse(t *testing.T) {
LeaveOnTerm: false,
EnableSyslog: false,
SyslogFacility: "",
DisableUpdateCheck: false,
DisableUpdateCheck: nil,
DisableAnonymousSignature: false,
Consul: nil,
Vault: nil,
TLSConfig: nil,
HTTPAPIResponseHeaders: map[string]string{},
HTTPAPIResponseHeaders: nil,
Sentinel: nil,
},
false,
},
}

for _, tc := range cases {
require := require.New(t)
t.Run(tc.File, func(t *testing.T) {
path, err := filepath.Abs(filepath.Join("./config-test-fixtures", tc.File))
if err != nil {
Expand All @@ -274,10 +273,7 @@ func TestConfig_Parse(t *testing.T) {
if (err != nil) != tc.Err {
t.Fatalf("file: %s\n\n%s", tc.File, err)
}

if !reflect.DeepEqual(actual, tc.Result) {
t.Errorf("file: %s diff: (actual vs expected)\n\n%s", tc.File, strings.Join(pretty.Diff(actual, tc.Result), "\n"))
}
require.EqualValues(actual, tc.Result)
})
}
}

0 comments on commit 09fa5f5

Please sign in to comment.