tests: use standard library testing.TB

Glint pulled in an updated version of mitchellh/go-testing-interface
which broke some existing tests because the update added a Parallel()
method to testing.T. This switches to the standard library testing.TB
which doesn't have a Parallel() method.
This commit is contained in:
Mahmood Ali
2021-06-07 15:01:01 -04:00
committed by Isabel Suchanek
parent 0edda116ad
commit 122a4cb844
5 changed files with 22 additions and 23 deletions

View File

@@ -34,7 +34,7 @@ import (
// makeHTTPServer returns a test server whose logs will be written to
// the passed writer. If the writer is nil, the logs are written to stderr.
func makeHTTPServer(t testing.T, cb func(c *Config)) *TestAgent {
func makeHTTPServer(t testing.TB, cb func(c *Config)) *TestAgent {
return NewTestAgent(t, t.Name(), cb)
}

View File

@@ -10,10 +10,9 @@ import (
"os"
"path/filepath"
"strings"
"testing"
"time"
testing "github.com/mitchellh/go-testing-interface"
metrics "github.com/armon/go-metrics"
"github.com/hashicorp/go-hclog"
"github.com/hashicorp/nomad/api"
@@ -39,7 +38,7 @@ var TempDir = os.TempDir()
// is removed after shutdown.
type TestAgent struct {
// T is the testing object
T testing.T
T testing.TB
// Name is an optional name of the agent.
Name string
@@ -92,7 +91,7 @@ type TestAgent struct {
// NewTestAgent returns a started agent with the given name and
// configuration. The caller should call Shutdown() to stop the agent and
// remove temporary directories.
func NewTestAgent(t testing.T, name string, configCallback func(*Config)) *TestAgent {
func NewTestAgent(t testing.TB, name string, configCallback func(*Config)) *TestAgent {
a := &TestAgent{
T: t,
Name: name,