mirror of
https://github.com/juanfont/headscale.git
synced 2025-11-29 05:18:48 -05:00
Lint fix integration tests
This commit is contained in:
@@ -12,6 +12,8 @@ import (
|
||||
"github.com/ory/dockertest/v3/docker"
|
||||
)
|
||||
|
||||
const DOCKER_EXECUTE_TIMEOUT = 10 * time.Second
|
||||
|
||||
func ExecuteCommand(
|
||||
resource *dockertest.Resource,
|
||||
cmd []string,
|
||||
@@ -21,7 +23,7 @@ func ExecuteCommand(
|
||||
var stderr bytes.Buffer
|
||||
|
||||
// TODO(kradalby): Make configurable
|
||||
timeout := 10 * time.Second
|
||||
timeout := DOCKER_EXECUTE_TIMEOUT
|
||||
|
||||
type result struct {
|
||||
exitCode int
|
||||
@@ -55,11 +57,13 @@ func ExecuteCommand(
|
||||
fmt.Println("Command: ", cmd)
|
||||
fmt.Println("stdout: ", stdout.String())
|
||||
fmt.Println("stderr: ", stderr.String())
|
||||
|
||||
return "", fmt.Errorf("command failed with: %s", stderr.String())
|
||||
}
|
||||
|
||||
return stdout.String(), nil
|
||||
case <-time.After(timeout):
|
||||
|
||||
return "", fmt.Errorf("command timed out after %s", timeout)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user