ci: limit gotestsum to circle ci

Part 2 of breaking up https://github.com/hashicorp/nomad/pull/12255

This PR makes it so gotestsum is invoked only in CircleCI. Also the
HCLogger(t) is plumbed more correctly in TestServer and TestAgent so
that they respect NOMAD_TEST_LOG_LEVEL.

The reason for these is we'll want to disable logging in GHA,
where spamming the disk with logs really drags performance.
This commit is contained in:
Seth Hoenig
2022-03-18 07:48:08 -05:00
parent 4bf0decbdb
commit a44c55ae84
5 changed files with 53 additions and 36 deletions

View File

@@ -16,6 +16,7 @@ import (
metrics "github.com/armon/go-metrics"
"github.com/hashicorp/go-hclog"
"github.com/hashicorp/nomad/api"
client "github.com/hashicorp/nomad/client/config"
"github.com/hashicorp/nomad/client/fingerprint"
"github.com/hashicorp/nomad/helper/freeport"
"github.com/hashicorp/nomad/helper/testlog"
@@ -357,6 +358,14 @@ func (a *TestAgent) config() *Config {
config := nomad.DefaultConfig()
conf.NomadConfig = config
// Setup client config
conf.ClientConfig = client.DefaultConfig()
logger := testlog.HCLogger(a.T)
conf.LogLevel = testlog.HCLoggerTestLevel().String()
conf.NomadConfig.Logger = logger
conf.ClientConfig.Logger = logger
// Set the name
conf.NodeName = a.Name