Browse Source

commands: do not run cmd tests in parallel

Package level parallelization is sufficient.
pull/3584/head
Frank Schroeder 7 years ago committed by Frank Schröder
parent
commit
d54a5ef8d8
  1. 6
      command/agent/agent_test.go
  2. 1
      command/catalog/catalog_test.go
  3. 3
      command/catalog/list/dc/catalog_list_datacenters_test.go
  4. 3
      command/catalog/list/nodes/catalog_list_nodes_test.go
  5. 3
      command/catalog/list/services/catalog_list_services_test.go
  6. 1
      command/event/event_test.go
  7. 8
      command/exec/exec_test.go
  8. 5
      command/flags/flag_map_value_test.go
  9. 2
      command/flags/flag_slice_value_test.go
  10. 3
      command/forceleave/forceleave_test.go
  11. 1
      command/info/info_test.go
  12. 3
      command/join/join_test.go
  13. 1
      command/keygen/keygen_test.go
  14. 5
      command/keyring/keyring_test.go
  15. 5
      command/kv/del/kv_delete_test.go
  16. 2
      command/kv/exp/kv_export_test.go
  17. 10
      command/kv/get/kv_get_test.go
  18. 2
      command/kv/imp/kv_import_test.go
  19. 11
      command/kv/put/kv_put_test.go
  20. 3
      command/leave/leave_test.go
  21. 11
      command/lock/lock_test.go
  22. 8
      command/maint/maint_test.go
  23. 5
      command/members/members_test.go
  24. 2
      command/operator/autopilot/get/operator_autopilot_get_test.go
  25. 1
      command/operator/autopilot/operator_autopilot_test.go
  26. 2
      command/operator/autopilot/set/operator_autopilot_set_test.go
  27. 1
      command/operator/operator_test.go
  28. 2
      command/operator/raft/listpeers/operator_raft_list_test.go
  29. 1
      command/operator/raft/operator_raft_test.go
  30. 2
      command/operator/raft/removepeer/operator_raft_remove_test.go
  31. 2
      command/reload/reload_test.go
  32. 5
      command/rtt/rtt_test.go
  33. 3
      command/snapshot/inspect/snapshot_inspect_test.go
  34. 3
      command/snapshot/restore/snapshot_restore_test.go
  35. 3
      command/snapshot/save/snapshot_save_test.go
  36. 1
      command/snapshot/snapshot_command_test.go
  37. 2
      command/validate/validate_test.go
  38. 1
      command/version/version_test.go
  39. 2
      command/watch/watch_test.go

6
command/agent/agent_test.go

@ -18,7 +18,6 @@ import (
// TestConfigFail should test command line flags that lead to an immediate error.
func TestConfigFail(t *testing.T) {
t.Parallel()
dataDir := testutil.TempDir(t, "consul")
defer os.RemoveAll(dataDir)
@ -77,7 +76,6 @@ func TestConfigFail(t *testing.T) {
func TestRetryJoin(t *testing.T) {
t.Skip("fs: skipping tests that use cmd.Run until signal handling is fixed")
t.Parallel()
a := agent.NewTestAgent(t.Name(), "")
defer a.Shutdown()
@ -126,7 +124,6 @@ func TestRetryJoin(t *testing.T) {
func TestRetryJoinFail(t *testing.T) {
t.Skip("fs: skipping tests that use cmd.Run until signal handling is fixed")
t.Parallel()
cfg := agent.TestConfig()
tmpDir := testutil.TempDir(t, "consul")
defer os.RemoveAll(tmpDir)
@ -152,7 +149,6 @@ func TestRetryJoinFail(t *testing.T) {
func TestRetryJoinWanFail(t *testing.T) {
t.Skip("fs: skipping tests that use cmd.Run until signal handling is fixed")
t.Parallel()
cfg := agent.TestConfig()
tmpDir := testutil.TempDir(t, "consul")
defer os.RemoveAll(tmpDir)
@ -178,7 +174,6 @@ func TestRetryJoinWanFail(t *testing.T) {
}
func TestProtectDataDir(t *testing.T) {
t.Parallel()
dir := testutil.TempDir(t, "consul")
defer os.RemoveAll(dir)
@ -213,7 +208,6 @@ func TestProtectDataDir(t *testing.T) {
}
func TestBadDataDirPermissions(t *testing.T) {
t.Parallel()
dir := testutil.TempDir(t, "consul")
defer os.RemoveAll(dir)

1
command/catalog/catalog_test.go

@ -6,7 +6,6 @@ import (
)
func TestCatalogCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New().Help(), '\t') {
t.Fatal("usage has tabs")
}

3
command/catalog/list/dc/catalog_list_datacenters_test.go

@ -9,14 +9,12 @@ import (
)
func TestCatalogListDatacentersCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(nil).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestCatalogListDatacentersCommand_Validation(t *testing.T) {
t.Parallel()
ui := cli.NewMockUi()
c := New(ui)
@ -52,7 +50,6 @@ func TestCatalogListDatacentersCommand_Validation(t *testing.T) {
}
func TestCatalogListDatacentersCommand(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()

3
command/catalog/list/nodes/catalog_list_nodes_test.go

@ -9,14 +9,12 @@ import (
)
func TestCatalogListNodesCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(nil).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestCatalogListNodesCommand_Validation(t *testing.T) {
t.Parallel()
ui := cli.NewMockUi()
c := New(ui)
@ -30,7 +28,6 @@ func TestCatalogListNodesCommand_Validation(t *testing.T) {
}
func TestCatalogListNodesCommand(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()

3
command/catalog/list/services/catalog_list_services_test.go

@ -10,14 +10,12 @@ import (
)
func TestCatalogListServicesCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(nil).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestCatalogListServicesCommand_Validation(t *testing.T) {
t.Parallel()
ui := cli.NewMockUi()
c := New(ui)
@ -31,7 +29,6 @@ func TestCatalogListServicesCommand_Validation(t *testing.T) {
}
func TestCatalogListServicesCommand(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()

1
command/event/event_test.go

@ -15,7 +15,6 @@ func TestEventCommand_noTabs(t *testing.T) {
}
func TestEventCommand(t *testing.T) {
t.Parallel()
a1 := agent.NewTestAgent(t.Name(), ``)
defer a1.Shutdown()

8
command/exec/exec_test.go

@ -18,7 +18,6 @@ func TestExecCommand_noTabs(t *testing.T) {
}
func TestExecCommand(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), `
disable_remote_exec = false
`)
@ -39,7 +38,6 @@ func TestExecCommand(t *testing.T) {
}
func TestExecCommand_NoShell(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), `
disable_remote_exec = false
`)
@ -60,7 +58,6 @@ func TestExecCommand_NoShell(t *testing.T) {
}
func TestExecCommand_CrossDC(t *testing.T) {
t.Parallel()
a1 := agent.NewTestAgent(t.Name(), `
disable_remote_exec = false
`)
@ -102,7 +99,6 @@ func TestExecCommand_CrossDC(t *testing.T) {
}
func TestExecCommand_Validate(t *testing.T) {
t.Parallel()
conf := &rExecConf{}
err := conf.validate()
if err != nil {
@ -138,7 +134,6 @@ func TestExecCommand_Validate(t *testing.T) {
}
func TestExecCommand_Sessions(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), `
disable_remote_exec = false
`)
@ -177,7 +172,6 @@ func TestExecCommand_Sessions(t *testing.T) {
}
func TestExecCommand_Sessions_Foreign(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), `
disable_remote_exec = false
`)
@ -227,7 +221,6 @@ func TestExecCommand_Sessions_Foreign(t *testing.T) {
}
func TestExecCommand_UploadDestroy(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), `
disable_remote_exec = false
`)
@ -282,7 +275,6 @@ func TestExecCommand_UploadDestroy(t *testing.T) {
}
func TestExecCommand_StreamResults(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), `
disable_remote_exec = false
`)

5
command/flags/flag_map_value_test.go

@ -6,10 +6,8 @@ import (
)
func TestFlagMapValueSet(t *testing.T) {
t.Parallel()
t.Run("missing =", func(t *testing.T) {
t.Parallel()
f := new(FlagMapValue)
if err := f.Set("foo"); err == nil {
@ -18,7 +16,6 @@ func TestFlagMapValueSet(t *testing.T) {
})
t.Run("sets", func(t *testing.T) {
t.Parallel()
f := new(FlagMapValue)
if err := f.Set("foo=bar"); err != nil {
@ -35,7 +32,6 @@ func TestFlagMapValueSet(t *testing.T) {
})
t.Run("sets multiple", func(t *testing.T) {
t.Parallel()
f := new(FlagMapValue)
@ -63,7 +59,6 @@ func TestFlagMapValueSet(t *testing.T) {
})
t.Run("overwrites", func(t *testing.T) {
t.Parallel()
f := new(FlagMapValue)
if err := f.Set("foo=bar"); err != nil {

2
command/flags/flag_slice_value_test.go

@ -7,7 +7,6 @@ import (
)
func TestAppendSliceValue_implements(t *testing.T) {
t.Parallel()
var raw interface{}
raw = new(AppendSliceValue)
if _, ok := raw.(flag.Value); !ok {
@ -16,7 +15,6 @@ func TestAppendSliceValue_implements(t *testing.T) {
}
func TestAppendSliceValueSet(t *testing.T) {
t.Parallel()
sv := new(AppendSliceValue)
err := sv.Set("foo")
if err != nil {

3
command/forceleave/forceleave_test.go

@ -11,14 +11,12 @@ import (
)
func TestForceLeaveCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(nil).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestForceLeaveCommand(t *testing.T) {
t.Parallel()
a1 := agent.NewTestAgent(t.Name(), ``)
a2 := agent.NewTestAgent(t.Name(), ``)
defer a1.Shutdown()
@ -57,7 +55,6 @@ func TestForceLeaveCommand(t *testing.T) {
}
func TestForceLeaveCommand_noAddrs(t *testing.T) {
t.Parallel()
ui := cli.NewMockUi()
c := New(ui)
args := []string{"-http-addr=foo"}

1
command/info/info_test.go

@ -15,7 +15,6 @@ func TestInfoCommand_noTabs(t *testing.T) {
}
func TestInfoCommand(t *testing.T) {
t.Parallel()
a1 := agent.NewTestAgent(t.Name(), ``)
defer a1.Shutdown()

3
command/join/join_test.go

@ -15,7 +15,6 @@ func TestJoinCommand_noTabs(t *testing.T) {
}
func TestJoinCommandJoin_lan(t *testing.T) {
t.Parallel()
a1 := agent.NewTestAgent(t.Name(), ``)
a2 := agent.NewTestAgent(t.Name(), ``)
defer a1.Shutdown()
@ -39,7 +38,6 @@ func TestJoinCommandJoin_lan(t *testing.T) {
}
func TestJoinCommand_wan(t *testing.T) {
t.Parallel()
a1 := agent.NewTestAgent(t.Name(), ``)
a2 := agent.NewTestAgent(t.Name(), ``)
defer a1.Shutdown()
@ -64,7 +62,6 @@ func TestJoinCommand_wan(t *testing.T) {
}
func TestJoinCommand_noAddrs(t *testing.T) {
t.Parallel()
ui := cli.NewMockUi()
cmd := New(ui)
args := []string{"-http-addr=foo"}

1
command/keygen/keygen_test.go

@ -15,7 +15,6 @@ func TestKeygenCommand_noTabs(t *testing.T) {
}
func TestKeygenCommand(t *testing.T) {
t.Parallel()
ui := cli.NewMockUi()
cmd := New(ui)
code := cmd.Run(nil)

5
command/keyring/keyring_test.go

@ -9,14 +9,12 @@ import (
)
func TestKeyringCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(nil).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestKeyringCommand(t *testing.T) {
t.Parallel()
key1 := "HS5lJ+XuTlYKWaeGYyG+/A=="
key2 := "kZyFABeAmc64UMTrm9XuKA=="
@ -67,7 +65,6 @@ func TestKeyringCommand(t *testing.T) {
}
func TestKeyringCommand_help(t *testing.T) {
t.Parallel()
ui := cli.NewMockUi()
c := New(ui)
code := c.Run(nil)
@ -82,7 +79,6 @@ func TestKeyringCommand_help(t *testing.T) {
}
func TestKeyringCommand_failedConnection(t *testing.T) {
t.Parallel()
ui := cli.NewMockUi()
c := New(ui)
args := []string{"-list", "-http-addr=127.0.0.1:0"}
@ -96,7 +92,6 @@ func TestKeyringCommand_failedConnection(t *testing.T) {
}
func TestKeyringCommand_invalidRelayFactor(t *testing.T) {
t.Parallel()
ui := cli.NewMockUi()
c := New(ui)

5
command/kv/del/kv_delete_test.go

@ -11,14 +11,12 @@ import (
)
func TestKVDeleteCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(nil).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestKVDeleteCommand_Validation(t *testing.T) {
t.Parallel()
ui := cli.NewMockUi()
c := New(ui)
@ -71,7 +69,6 @@ func TestKVDeleteCommand_Validation(t *testing.T) {
}
func TestKVDeleteCommand(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()
@ -108,7 +105,6 @@ func TestKVDeleteCommand(t *testing.T) {
}
func TestKVDeleteCommand_Recurse(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()
@ -152,7 +148,6 @@ func TestKVDeleteCommand_Recurse(t *testing.T) {
}
func TestKVDeleteCommand_CAS(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()

2
command/kv/exp/kv_export_test.go

@ -13,14 +13,12 @@ import (
)
func TestKVExportCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(nil).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestKVExportCommand(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()

10
command/kv/get/kv_get_test.go

@ -11,14 +11,12 @@ import (
)
func TestKVGetCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(nil).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestKVGetCommand_Validation(t *testing.T) {
t.Parallel()
ui := cli.NewMockUi()
c := New(ui)
@ -58,7 +56,6 @@ func TestKVGetCommand_Validation(t *testing.T) {
}
func TestKVGetCommand(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()
@ -92,7 +89,6 @@ func TestKVGetCommand(t *testing.T) {
}
func TestKVGetCommand_Missing(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -111,7 +107,6 @@ func TestKVGetCommand_Missing(t *testing.T) {
}
func TestKVGetCommand_Empty(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()
@ -140,7 +135,6 @@ func TestKVGetCommand_Empty(t *testing.T) {
}
func TestKVGetCommand_Detailed(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()
@ -184,7 +178,6 @@ func TestKVGetCommand_Detailed(t *testing.T) {
}
func TestKVGetCommand_Keys(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()
@ -219,7 +212,6 @@ func TestKVGetCommand_Keys(t *testing.T) {
}
func TestKVGetCommand_Recurse(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()
@ -259,7 +251,6 @@ func TestKVGetCommand_Recurse(t *testing.T) {
}
func TestKVGetCommand_RecurseBase64(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()
@ -300,7 +291,6 @@ func TestKVGetCommand_RecurseBase64(t *testing.T) {
}
func TestKVGetCommand_DetailedBase64(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()

2
command/kv/imp/kv_import_test.go

@ -9,14 +9,12 @@ import (
)
func TestKVImportCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(nil).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestKVImportCommand(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()

11
command/kv/put/kv_put_test.go

@ -16,14 +16,12 @@ import (
)
func TestKVPutCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(nil).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestKVPutCommand_Validation(t *testing.T) {
t.Parallel()
ui := cli.NewMockUi()
c := New(ui)
@ -76,7 +74,6 @@ func TestKVPutCommand_Validation(t *testing.T) {
}
func TestKVPutCommand(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()
@ -105,7 +102,6 @@ func TestKVPutCommand(t *testing.T) {
}
func TestKVPutCommand_EmptyDataQuoted(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()
@ -134,7 +130,6 @@ func TestKVPutCommand_EmptyDataQuoted(t *testing.T) {
}
func TestKVPutCommand_Base64(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()
@ -171,7 +166,6 @@ func TestKVPutCommand_Base64(t *testing.T) {
}
func TestKVPutCommand_File(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()
@ -206,7 +200,6 @@ func TestKVPutCommand_File(t *testing.T) {
}
func TestKVPutCommand_FileNoExist(t *testing.T) {
t.Parallel()
ui := cli.NewMockUi()
c := New(ui)
@ -226,7 +219,6 @@ func TestKVPutCommand_FileNoExist(t *testing.T) {
}
func TestKVPutCommand_Stdin(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()
@ -263,7 +255,6 @@ func TestKVPutCommand_Stdin(t *testing.T) {
}
func TestKVPutCommand_NegativeVal(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()
@ -292,7 +283,6 @@ func TestKVPutCommand_NegativeVal(t *testing.T) {
}
func TestKVPutCommand_Flags(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()
@ -322,7 +312,6 @@ func TestKVPutCommand_Flags(t *testing.T) {
}
func TestKVPutCommand_CAS(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()

3
command/leave/leave_test.go

@ -9,14 +9,12 @@ import (
)
func TestLeaveCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(nil).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestLeaveCommand(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -35,7 +33,6 @@ func TestLeaveCommand(t *testing.T) {
}
func TestLeaveCommand_FailOnNonFlagArgs(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()

11
command/lock/lock_test.go

@ -26,21 +26,18 @@ func argFail(t *testing.T, args []string, expected string) {
}
func TestLockCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestLockCommand_BadArgs(t *testing.T) {
t.Parallel()
argFail(t, []string{"-try=blah", "test/prefix", "date"}, "invalid duration")
argFail(t, []string{"-try=-10s", "test/prefix", "date"}, "Timeout must be positive")
argFail(t, []string{"-monitor-retry=-5", "test/prefix", "date"}, "must be >= 0")
}
func TestLockCommand(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -63,7 +60,6 @@ func TestLockCommand(t *testing.T) {
}
func TestLockCommand_NoShell(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -86,7 +82,6 @@ func TestLockCommand_NoShell(t *testing.T) {
}
func TestLockCommand_TryLock(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -118,7 +113,6 @@ func TestLockCommand_TryLock(t *testing.T) {
}
func TestLockCommand_TrySemaphore(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -150,7 +144,6 @@ func TestLockCommand_TrySemaphore(t *testing.T) {
}
func TestLockCommand_MonitorRetry_Lock_Default(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -183,7 +176,6 @@ func TestLockCommand_MonitorRetry_Lock_Default(t *testing.T) {
}
func TestLockCommand_MonitorRetry_Semaphore_Default(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -216,7 +208,6 @@ func TestLockCommand_MonitorRetry_Semaphore_Default(t *testing.T) {
}
func TestLockCommand_MonitorRetry_Lock_Arg(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -249,7 +240,6 @@ func TestLockCommand_MonitorRetry_Lock_Arg(t *testing.T) {
}
func TestLockCommand_MonitorRetry_Semaphore_Arg(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -282,7 +272,6 @@ func TestLockCommand_MonitorRetry_Semaphore_Arg(t *testing.T) {
}
func TestLockCommand_ChildExitCode(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()

8
command/maint/maint_test.go

@ -10,14 +10,12 @@ import (
)
func TestMaintCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestMaintCommand_ConflictingArgs(t *testing.T) {
t.Parallel()
ui := cli.NewMockUi()
c := New(ui)
c.flags.SetOutput(ui.ErrorWriter)
@ -40,7 +38,6 @@ func TestMaintCommand_ConflictingArgs(t *testing.T) {
}
func TestMaintCommand_NoArgs(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -89,7 +86,6 @@ func TestMaintCommand_NoArgs(t *testing.T) {
}
func TestMaintCommand_EnableNodeMaintenance(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -113,7 +109,6 @@ func TestMaintCommand_EnableNodeMaintenance(t *testing.T) {
}
func TestMaintCommand_DisableNodeMaintenance(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -136,7 +131,6 @@ func TestMaintCommand_DisableNodeMaintenance(t *testing.T) {
}
func TestMaintCommand_EnableServiceMaintenance(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -170,7 +164,6 @@ func TestMaintCommand_EnableServiceMaintenance(t *testing.T) {
}
func TestMaintCommand_DisableServiceMaintenance(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -203,7 +196,6 @@ func TestMaintCommand_DisableServiceMaintenance(t *testing.T) {
}
func TestMaintCommand_ServiceMaintenance_NoService(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()

5
command/members/members_test.go

@ -10,14 +10,12 @@ import (
)
func TestMembersCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestMembersCommand(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -49,7 +47,6 @@ func TestMembersCommand(t *testing.T) {
}
func TestMembersCommand_WAN(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -70,7 +67,6 @@ func TestMembersCommand_WAN(t *testing.T) {
}
func TestMembersCommand_statusFilter(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -94,7 +90,6 @@ func TestMembersCommand_statusFilter(t *testing.T) {
}
func TestMembersCommand_statusFilter_failed(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()

2
command/operator/autopilot/get/operator_autopilot_get_test.go

@ -9,14 +9,12 @@ import (
)
func TestOperatorAutopilotGetConfigCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestOperatorAutopilotGetConfigCommand(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()

1
command/operator/autopilot/operator_autopilot_test.go

@ -6,7 +6,6 @@ import (
)
func TestOperatorAutopilotCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New().Help(), '\t') {
t.Fatal("usage has tabs")
}

2
command/operator/autopilot/set/operator_autopilot_set_test.go

@ -11,14 +11,12 @@ import (
)
func TestOperatorAutopilotSetConfigCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestOperatorAutopilotSetConfigCommmand(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()

1
command/operator/operator_test.go

@ -6,7 +6,6 @@ import (
)
func TestOperatorCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New().Help(), '\t') {
t.Fatal("usage has tabs")
}

2
command/operator/raft/listpeers/operator_raft_list_test.go

@ -10,14 +10,12 @@ import (
)
func TestOperatorRaftListPeersCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestOperatorRaftListPeersCommand(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()

1
command/operator/raft/operator_raft_test.go

@ -6,7 +6,6 @@ import (
)
func TestOperatorRaftCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New().Help(), '\t') {
t.Fatal("usage has tabs")
}

2
command/operator/raft/removepeer/operator_raft_remove_test.go

@ -9,14 +9,12 @@ import (
)
func TestOperatorRaftRemovePeerCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestOperatorRaftRemovePeerCommand(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()

2
command/reload/reload_test.go

@ -9,14 +9,12 @@ import (
)
func TestReloadCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestReloadCommand(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()

5
command/rtt/rtt_test.go

@ -13,14 +13,12 @@ import (
)
func TestRTTCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestRTTCommand_BadArgs(t *testing.T) {
t.Parallel()
tests := []struct {
args []string
}{
@ -33,7 +31,6 @@ func TestRTTCommand_BadArgs(t *testing.T) {
for _, tt := range tests {
t.Run(strings.Join(tt.args, " "), func(t *testing.T) {
t.Parallel()
ui := cli.NewMockUi()
c := New(ui)
if code := c.Run(tt.args); code != 1 {
@ -44,7 +41,6 @@ func TestRTTCommand_BadArgs(t *testing.T) {
}
func TestRTTCommand_LAN(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), `
consul = {
coordinate = {
@ -152,7 +148,6 @@ func TestRTTCommand_LAN(t *testing.T) {
}
func TestRTTCommand_WAN(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()

3
command/snapshot/inspect/snapshot_inspect_test.go

@ -13,14 +13,12 @@ import (
)
func TestSnapshotInpectCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestSnapshotInspectCommand_Validation(t *testing.T) {
t.Parallel()
ui := cli.NewMockUi()
c := New(ui)
@ -60,7 +58,6 @@ func TestSnapshotInspectCommand_Validation(t *testing.T) {
}
func TestSnapshotInspectCommand(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()

3
command/snapshot/restore/snapshot_restore_test.go

@ -13,14 +13,12 @@ import (
)
func TestSnapshotRestoreCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestSnapshotRestoreCommand_Validation(t *testing.T) {
t.Parallel()
ui := cli.NewMockUi()
c := New(ui)
@ -60,7 +58,6 @@ func TestSnapshotRestoreCommand_Validation(t *testing.T) {
}
func TestSnapshotRestoreCommand(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()

3
command/snapshot/save/snapshot_save_test.go

@ -12,13 +12,11 @@ import (
)
func TestSnapshotSaveCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(cli.NewMockUi()).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestSnapshotSaveCommand_Validation(t *testing.T) {
t.Parallel()
cases := map[string]struct {
args []string
@ -59,7 +57,6 @@ func TestSnapshotSaveCommand_Validation(t *testing.T) {
}
func TestSnapshotSaveCommand(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
client := a.Client()

1
command/snapshot/snapshot_command_test.go

@ -6,7 +6,6 @@ import (
)
func TestSnapshotCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New().Help(), '\t') {
t.Fatal("usage has tabs")
}

2
command/validate/validate_test.go

@ -18,7 +18,6 @@ func TestValidateCommand_noTabs(t *testing.T) {
}
func TestValidateCommand_FailOnEmptyFile(t *testing.T) {
t.Parallel()
tmpFile := testutil.TempFile(t, "consul")
defer os.RemoveAll(tmpFile.Name())
@ -66,7 +65,6 @@ func TestValidateCommand_SucceedOnMinimalConfigDir(t *testing.T) {
}
func TestValidateCommand_Quiet(t *testing.T) {
t.Parallel()
td := testutil.TempDir(t, "consul")
defer os.RemoveAll(td)

1
command/version/version_test.go

@ -8,7 +8,6 @@ import (
)
func TestVersionCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(cli.NewMockUi(), "").Help(), '\t') {
t.Fatal("usage has tabs")
}

2
command/watch/watch_test.go

@ -9,14 +9,12 @@ import (
)
func TestWatchCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(cli.NewMockUi(), nil).Help(), '\t') {
t.Fatal("usage has tabs")
}
}
func TestWatchCommand(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()

Loading…
Cancel
Save