Skip to content

Commit

Permalink
api: run tests in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanuber committed May 8, 2015
1 parent 5d0f83d commit 565cac0
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/acl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ func init() {
}

func TestACL_CreateDestroy(t *testing.T) {
t.Parallel()
if CONSUL_ROOT == "" {
t.SkipNow()
}
Expand Down Expand Up @@ -61,6 +62,7 @@ func TestACL_CreateDestroy(t *testing.T) {
}

func TestACL_CloneDestroy(t *testing.T) {
t.Parallel()
if CONSUL_ROOT == "" {
t.SkipNow()
}
Expand Down Expand Up @@ -94,6 +96,7 @@ func TestACL_CloneDestroy(t *testing.T) {
}

func TestACL_Info(t *testing.T) {
t.Parallel()
if CONSUL_ROOT == "" {
t.SkipNow()
}
Expand Down Expand Up @@ -121,6 +124,7 @@ func TestACL_Info(t *testing.T) {
}

func TestACL_List(t *testing.T) {
t.Parallel()
if CONSUL_ROOT == "" {
t.SkipNow()
}
Expand Down
12 changes: 12 additions & 0 deletions api/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
)

func TestAgent_Self(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand All @@ -23,6 +24,7 @@ func TestAgent_Self(t *testing.T) {
}

func TestAgent_Members(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand All @@ -39,6 +41,7 @@ func TestAgent_Members(t *testing.T) {
}

func TestAgent_Services(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -78,6 +81,7 @@ func TestAgent_Services(t *testing.T) {
}

func TestAgent_ServiceAddress(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -124,6 +128,7 @@ func TestAgent_ServiceAddress(t *testing.T) {
}

func TestAgent_Services_MultipleChecks(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -167,6 +172,7 @@ func TestAgent_Services_MultipleChecks(t *testing.T) {
}

func TestAgent_SetTTLStatus(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -207,6 +213,7 @@ func TestAgent_SetTTLStatus(t *testing.T) {
}

func TestAgent_Checks(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -234,6 +241,7 @@ func TestAgent_Checks(t *testing.T) {
}

func TestAgent_Checks_serviceBound(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -272,6 +280,7 @@ func TestAgent_Checks_serviceBound(t *testing.T) {
}

func TestAgent_Join(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand All @@ -291,6 +300,7 @@ func TestAgent_Join(t *testing.T) {
}

func TestAgent_ForceLeave(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand All @@ -304,6 +314,7 @@ func TestAgent_ForceLeave(t *testing.T) {
}

func TestServiceMaintenance(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -358,6 +369,7 @@ func TestServiceMaintenance(t *testing.T) {
}

func TestNodeMaintenance(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down
6 changes: 6 additions & 0 deletions api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func testKey() string {
}

func TestDefaultConfig_env(t *testing.T) {
t.Parallel()
addr := "1.2.3.4:5678"
token := "abcd1234"
auth := "username:password"
Expand Down Expand Up @@ -104,6 +105,7 @@ func TestDefaultConfig_env(t *testing.T) {
}

func TestSetQueryOptions(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -139,6 +141,7 @@ func TestSetQueryOptions(t *testing.T) {
}

func TestSetWriteOptions(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand All @@ -158,6 +161,7 @@ func TestSetWriteOptions(t *testing.T) {
}

func TestRequestToHTTP(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand All @@ -180,6 +184,7 @@ func TestRequestToHTTP(t *testing.T) {
}

func TestParseQueryMeta(t *testing.T) {
t.Parallel()
resp := &http.Response{
Header: make(map[string][]string),
}
Expand All @@ -204,6 +209,7 @@ func TestParseQueryMeta(t *testing.T) {
}

func TestAPI_UnixSocket(t *testing.T) {
t.Parallel()
if runtime.GOOS == "windows" {
t.SkipNow()
}
Expand Down
6 changes: 6 additions & 0 deletions api/catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
)

func TestCatalog_Datacenters(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand All @@ -30,6 +31,7 @@ func TestCatalog_Datacenters(t *testing.T) {
}

func TestCatalog_Nodes(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand All @@ -56,6 +58,7 @@ func TestCatalog_Nodes(t *testing.T) {
}

func TestCatalog_Services(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand All @@ -82,6 +85,7 @@ func TestCatalog_Services(t *testing.T) {
}

func TestCatalog_Service(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand All @@ -108,6 +112,7 @@ func TestCatalog_Service(t *testing.T) {
}

func TestCatalog_Node(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand All @@ -134,6 +139,7 @@ func TestCatalog_Node(t *testing.T) {
}

func TestCatalog_Registration(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down
1 change: 1 addition & 0 deletions api/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
)

func TestEvent_FireList(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down
4 changes: 4 additions & 0 deletions api/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
)

func TestHealth_Node(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -38,6 +39,7 @@ func TestHealth_Node(t *testing.T) {
}

func TestHealth_Checks(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -74,6 +76,7 @@ func TestHealth_Checks(t *testing.T) {
}

func TestHealth_Service(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand All @@ -98,6 +101,7 @@ func TestHealth_Service(t *testing.T) {
}

func TestHealth_State(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down
8 changes: 8 additions & 0 deletions api/kv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
)

func TestClientPutGetDelete(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -64,6 +65,7 @@ func TestClientPutGetDelete(t *testing.T) {
}

func TestClient_List_DeleteRecurse(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -118,6 +120,7 @@ func TestClient_List_DeleteRecurse(t *testing.T) {
}

func TestClient_DeleteCAS(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -163,6 +166,7 @@ func TestClient_DeleteCAS(t *testing.T) {
}

func TestClient_CAS(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -210,6 +214,7 @@ func TestClient_CAS(t *testing.T) {
}

func TestClient_WatchGet(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -261,6 +266,7 @@ func TestClient_WatchGet(t *testing.T) {
}

func TestClient_WatchList(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -314,6 +320,7 @@ func TestClient_WatchList(t *testing.T) {
}

func TestClient_Keys_DeleteRecurse(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -363,6 +370,7 @@ func TestClient_Keys_DeleteRecurse(t *testing.T) {
}

func TestClient_AcquireRelease(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down
7 changes: 7 additions & 0 deletions api/lock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
)

func TestLock_LockUnlock(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -65,6 +66,7 @@ func TestLock_LockUnlock(t *testing.T) {
}

func TestLock_ForceInvalidate(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -99,6 +101,7 @@ func TestLock_ForceInvalidate(t *testing.T) {
}

func TestLock_DeleteKey(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -132,6 +135,7 @@ func TestLock_DeleteKey(t *testing.T) {
}

func TestLock_Contend(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -184,6 +188,7 @@ func TestLock_Contend(t *testing.T) {
}

func TestLock_Destroy(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -252,6 +257,7 @@ func TestLock_Destroy(t *testing.T) {
}

func TestLock_Conflict(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down Expand Up @@ -289,6 +295,7 @@ func TestLock_Conflict(t *testing.T) {
}

func TestLock_ReclaimLock(t *testing.T) {
t.Parallel()
c, s := makeClient(t)
defer s.Stop()

Expand Down
Loading

0 comments on commit 565cac0

Please sign in to comment.