Skip to content

Commit

Permalink
tests: allow API test server to respect NOMAD_TEST_LOG_LEVEL (#8760)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross authored Aug 27, 2020
1 parent 4b7aee5 commit 63db66b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion api/internal/testutil/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,16 @@ type ServerConfigCallback func(c *TestServerConfig)
// with all of the listen ports incremented by one.
func defaultServerConfig(t testing.T) *TestServerConfig {
ports := freeport.GetT(t, 3)

logLevel := "DEBUG"
if envLogLevel := os.Getenv("NOMAD_TEST_LOG_LEVEL"); envLogLevel != "" {
logLevel = envLogLevel
}

return &TestServerConfig{
NodeName: fmt.Sprintf("node-%d", ports[0]),
DisableCheckpoint: true,
LogLevel: "DEBUG",
LogLevel: logLevel,
Ports: &PortsConfig{
HTTP: ports[0],
RPC: ports[1],
Expand Down

0 comments on commit 63db66b

Please sign in to comment.