test: move remaining tests to use ci.Parallel.

This commit is contained in:
James Rasell
2022-03-24 08:45:13 +01:00
parent bd377c9ade
commit e89dd5dcf7
20 changed files with 43 additions and 36 deletions

View File

@@ -435,7 +435,7 @@ func TestHTTP_AllocStop(t *testing.T) {
}
func TestHTTP_allocServiceRegistrations(t *testing.T) {
t.Parallel()
ci.Parallel(t)
testCases := []struct {
testFn func(srv *TestAgent)

View File

@@ -202,7 +202,7 @@ func TestHTTP_EvalQuery(t *testing.T) {
}
func TestHTTP_EvalQueryWithRelated(t *testing.T) {
t.Parallel()
ci.Parallel(t)
httpTest(t, nil, func(s *TestAgent) {
// Directly manipulate the state
state := s.Agent.server.State()

View File

@@ -2250,7 +2250,7 @@ func TestJobs_NamespaceForJob(t *testing.T) {
}
func TestHTTPServer_jobServiceRegistrations(t *testing.T) {
t.Parallel()
ci.Parallel(t)
testCases := []struct {
testFn func(srv *TestAgent)

View File

@@ -7,13 +7,14 @@ import (
"testing"
"github.com/hashicorp/go-memdb"
"github.com/hashicorp/nomad/ci"
"github.com/hashicorp/nomad/nomad/mock"
"github.com/hashicorp/nomad/nomad/structs"
"github.com/stretchr/testify/require"
)
func TestHTTPServer_ServiceRegistrationListRequest(t *testing.T) {
t.Parallel()
ci.Parallel(t)
testCases := []struct {
testFn func(srv *TestAgent)
@@ -149,7 +150,7 @@ func TestHTTPServer_ServiceRegistrationListRequest(t *testing.T) {
}
func TestHTTPServer_ServiceRegistrationRequest(t *testing.T) {
t.Parallel()
ci.Parallel(t)
testCases := []struct {
testFn func(srv *TestAgent)

View File

@@ -5,13 +5,14 @@ import (
"testing"
"github.com/hashicorp/nomad/api"
"github.com/hashicorp/nomad/ci"
"github.com/hashicorp/nomad/testutil"
"github.com/mitchellh/cli"
"github.com/stretchr/testify/require"
)
func TestServiceDeleteCommand_Run(t *testing.T) {
t.Parallel()
ci.Parallel(t)
srv, client, url := testServer(t, true, nil)
defer srv.Shutdown()

View File

@@ -6,6 +6,7 @@ import (
"time"
"github.com/hashicorp/nomad/api"
"github.com/hashicorp/nomad/ci"
"github.com/hashicorp/nomad/testutil"
"github.com/mitchellh/cli"
"github.com/stretchr/testify/assert"
@@ -13,7 +14,7 @@ import (
)
func TestServiceInfoCommand_Run(t *testing.T) {
t.Parallel()
ci.Parallel(t)
srv, client, url := testServer(t, true, nil)
defer srv.Shutdown()

View File

@@ -6,6 +6,7 @@ import (
"time"
"github.com/hashicorp/nomad/api"
"github.com/hashicorp/nomad/ci"
"github.com/hashicorp/nomad/testutil"
"github.com/mitchellh/cli"
"github.com/stretchr/testify/assert"
@@ -13,7 +14,7 @@ import (
)
func TestServiceListCommand_Run(t *testing.T) {
t.Parallel()
ci.Parallel(t)
srv, client, url := testServer(t, true, nil)
defer srv.Shutdown()