watch: run tests in parallel

This commit is contained in:
Frank Schroeder 2017-10-24 15:24:57 +02:00
parent cee28aee30
commit c059270394
No known key found for this signature in database
GPG Key ID: 4D65C6EAEC87DECD
3 changed files with 12 additions and 0 deletions

View File

@ -15,6 +15,7 @@ import (
var errBadContent = errors.New("bad content")
func TestKeyWatch(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -68,6 +69,7 @@ func TestKeyWatch(t *testing.T) {
}
func TestKeyWatch_With_PrefixDelete(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -121,6 +123,7 @@ func TestKeyWatch_With_PrefixDelete(t *testing.T) {
}
func TestKeyPrefixWatch(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -173,6 +176,7 @@ func TestKeyPrefixWatch(t *testing.T) {
}
func TestServicesWatch(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -226,6 +230,7 @@ func TestServicesWatch(t *testing.T) {
}
func TestNodesWatch(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -276,6 +281,7 @@ func TestNodesWatch(t *testing.T) {
}
func TestServiceWatch(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -331,6 +337,7 @@ func TestServiceWatch(t *testing.T) {
}
func TestChecksWatch_State(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -391,6 +398,7 @@ func TestChecksWatch_State(t *testing.T) {
}
func TestChecksWatch_Service(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()
@ -456,6 +464,7 @@ func TestChecksWatch_Service(t *testing.T) {
}
func TestEventWatch(t *testing.T) {
t.Parallel()
a := agent.NewTestAgent(t.Name(), ``)
defer a.Shutdown()

View File

@ -27,6 +27,7 @@ func mustParse(t *testing.T, q string) *Plan {
}
func TestRun_Stop(t *testing.T) {
t.Parallel()
plan := mustParse(t, `{"type":"noop"}`)
var expect uint64 = 1

View File

@ -7,6 +7,7 @@ import (
)
func TestParseBasic(t *testing.T) {
t.Parallel()
params := makeParams(t, `{"type":"key", "datacenter":"dc2", "token":"12345", "key":"foo"}`)
p, err := Parse(params)
if err != nil {
@ -24,6 +25,7 @@ func TestParseBasic(t *testing.T) {
}
func TestParse_exempt(t *testing.T) {
t.Parallel()
params := makeParams(t, `{"type":"key", "key":"foo", "handler": "foobar"}`)
p, err := ParseExempt(params, []string{"handler"})
if err != nil {