mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
Fix Testutil for delve debugging API tests (#13589)
This commit is contained in:
@@ -59,8 +59,17 @@ func NomadExecutable() (string, error) {
|
||||
}
|
||||
|
||||
func isNomad(path, nomadExe string) bool {
|
||||
if strings.HasSuffix(path, ".test") || strings.HasSuffix(path, ".test.exe") {
|
||||
switch {
|
||||
case strings.HasSuffix(path, ".test"):
|
||||
return false
|
||||
case strings.HasSuffix(path, ".test.exe"):
|
||||
return false
|
||||
// delve debug executable for debugging test
|
||||
case strings.HasSuffix(path, "__debug_bin"):
|
||||
return false
|
||||
case strings.HasSuffix(path, "__debug_bin.exe"):
|
||||
return false
|
||||
default:
|
||||
return true
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -155,11 +155,10 @@ func NewTestServer(t testing.T, cb ServerConfigCallback) *TestServer {
|
||||
}
|
||||
|
||||
// Check that we are actually running nomad
|
||||
vcmd := exec.Command(path, "-version")
|
||||
vcmd.Stdout = nil
|
||||
vcmd.Stderr = nil
|
||||
if err := vcmd.Run(); err != nil {
|
||||
t.Skipf("nomad version failed: %v", err)
|
||||
if out, err := exec.Command(path, "-version").CombinedOutput(); err != nil {
|
||||
t.Logf("nomad version failed: %v", err)
|
||||
t.Logf("nomad version output:\n%s", string(out))
|
||||
t.Skip()
|
||||
}
|
||||
|
||||
dataDir, err := ioutil.TempDir("", "nomad")
|
||||
|
||||
Reference in New Issue
Block a user