commands: do not run cmd tests in parallel
Package level parallelization is sufficient.
This commit is contained in:
parent
a1a1a6971d
commit
a3a805d7b8
|
@ -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)
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ import (
|
|||
)
|
||||
|
||||
func TestCatalogCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New().Help(), '\t') {
|
||||
t.Fatal("usage has tabs")
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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
|
||||
`)
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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"}
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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"}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ import (
|
|||
)
|
||||
|
||||
func TestOperatorAutopilotCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New().Help(), '\t') {
|
||||
t.Fatal("usage has tabs")
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ import (
|
|||
)
|
||||
|
||||
func TestOperatorCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New().Help(), '\t') {
|
||||
t.Fatal("usage has tabs")
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ import (
|
|||
)
|
||||
|
||||
func TestOperatorRaftCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New().Help(), '\t') {
|
||||
t.Fatal("usage has tabs")
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -6,7 +6,6 @@ import (
|
|||
)
|
||||
|
||||
func TestSnapshotCommand_noTabs(t *testing.T) {
|
||||
t.Parallel()
|
||||
if strings.ContainsRune(New().Help(), '\t') {
|
||||
t.Fatal("usage has tabs")
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
|
|
|
@ -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…
Reference in New Issue