From f91b269b2af86d297ea46f3c47f85a36cc8ee038 Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Thu, 4 Oct 2018 16:16:08 -0700 Subject: [PATCH] fix test compiling --- client/allocwatcher/alloc_watcher_test.go | 2 +- client/servers/manager_internal_test.go | 6 +++--- client/servers/manager_test.go | 6 +++--- client/stats/cpu_test.go | 2 +- client/vaultclient/vaultclient_test.go | 8 ++++---- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/client/allocwatcher/alloc_watcher_test.go b/client/allocwatcher/alloc_watcher_test.go index 64509b03f..b8a3c8581 100644 --- a/client/allocwatcher/alloc_watcher_test.go +++ b/client/allocwatcher/alloc_watcher_test.go @@ -45,7 +45,7 @@ func newFakeAllocRunner(t *testing.T, logger hclog.Logger) *fakeAllocRunner { return &fakeAllocRunner{ alloc: alloc, AllocDir: allocdir.NewAllocDir(logger, path), - Broadcaster: cstructs.NewAllocBroadcaster(alloc), + Broadcaster: cstructs.NewAllocBroadcaster(), } } diff --git a/client/servers/manager_internal_test.go b/client/servers/manager_internal_test.go index dc17be1f9..f28074dea 100644 --- a/client/servers/manager_internal_test.go +++ b/client/servers/manager_internal_test.go @@ -36,14 +36,14 @@ func (cp *fauxConnPool) Ping(net.Addr) error { } func testManager(t *testing.T) (m *Manager) { - logger := testlog.Logger(t) + logger := testlog.HCLogger(t) shutdownCh := make(chan struct{}) m = New(logger, shutdownCh, &fauxConnPool{}) return m } func testManagerFailProb(t *testing.T, failPct float64) (m *Manager) { - logger := testlog.Logger(t) + logger := testlog.HCLogger(t) shutdownCh := make(chan struct{}) m = New(logger, shutdownCh, &fauxConnPool{failPct: failPct}) return m @@ -136,7 +136,7 @@ func TestManagerInternal_refreshServerRebalanceTimer(t *testing.T) { {1000000, 19, 10 * time.Minute}, } - logger := testlog.Logger(t) + logger := testlog.HCLogger(t) shutdownCh := make(chan struct{}) for _, s := range clusters { diff --git a/client/servers/manager_test.go b/client/servers/manager_test.go index 235064797..e33ab4119 100644 --- a/client/servers/manager_test.go +++ b/client/servers/manager_test.go @@ -33,14 +33,14 @@ func (cp *fauxConnPool) Ping(net.Addr) error { } func testManager(t *testing.T) (m *servers.Manager) { - logger := testlog.Logger(t) + logger := testlog.HCLogger(t) shutdownCh := make(chan struct{}) m = servers.New(logger, shutdownCh, &fauxConnPool{}) return m } func testManagerFailProb(t *testing.T, failPct float64) (m *servers.Manager) { - logger := testlog.Logger(t) + logger := testlog.HCLogger(t) shutdownCh := make(chan struct{}) m = servers.New(logger, shutdownCh, &fauxConnPool{failPct: failPct}) return m @@ -113,7 +113,7 @@ func TestServers_FindServer(t *testing.T) { } func TestServers_New(t *testing.T) { - logger := testlog.Logger(t) + logger := testlog.HCLogger(t) shutdownCh := make(chan struct{}) m := servers.New(logger, shutdownCh, &fauxConnPool{}) if m == nil { diff --git a/client/stats/cpu_test.go b/client/stats/cpu_test.go index b963d91a6..eedd66e47 100644 --- a/client/stats/cpu_test.go +++ b/client/stats/cpu_test.go @@ -26,7 +26,7 @@ func TestHostStats_CPU(t *testing.T) { assert := assert.New(t) assert.Nil(shelpers.Init()) - logger := testlog.Logger(t) + logger := testlog.HCLogger(t) cwd, err := os.Getwd() assert.Nil(err) hs := NewHostStatsCollector(logger, cwd) diff --git a/client/vaultclient/vaultclient_test.go b/client/vaultclient/vaultclient_test.go index faa9c6695..d9d334d5d 100644 --- a/client/vaultclient/vaultclient_test.go +++ b/client/vaultclient/vaultclient_test.go @@ -16,7 +16,7 @@ func TestVaultClient_TokenRenewals(t *testing.T) { v := testutil.NewTestVault(t) defer v.Stop() - logger := testlog.Logger(t) + logger := testlog.HCLogger(t) v.Config.ConnectionRetryIntv = 100 * time.Millisecond v.Config.TaskTokenTTL = "4s" c, err := NewVaultClient(v.Config, logger, nil) @@ -100,7 +100,7 @@ func TestVaultClient_Heap(t *testing.T) { conf.VaultConfig.Token = "testvaulttoken" conf.VaultConfig.TaskTokenTTL = "10s" - logger := testlog.Logger(t) + logger := testlog.HCLogger(t) c, err := NewVaultClient(conf.VaultConfig, logger, nil) if err != nil { t.Fatal(err) @@ -203,7 +203,7 @@ func TestVaultClient_RenewNonRenewableLease(t *testing.T) { v := testutil.NewTestVault(t) defer v.Stop() - logger := testlog.Logger(t) + logger := testlog.HCLogger(t) v.Config.ConnectionRetryIntv = 100 * time.Millisecond v.Config.TaskTokenTTL = "4s" c, err := NewVaultClient(v.Config, logger, nil) @@ -252,7 +252,7 @@ func TestVaultClient_RenewNonexistentLease(t *testing.T) { v := testutil.NewTestVault(t) defer v.Stop() - logger := testlog.Logger(t) + logger := testlog.HCLogger(t) v.Config.ConnectionRetryIntv = 100 * time.Millisecond v.Config.TaskTokenTTL = "4s" c, err := NewVaultClient(v.Config, logger, nil)