mirror of
https://github.com/kemko/nomad.git
synced 2026-01-08 19:35:41 +03:00
Test for errors
This commit is contained in:
@@ -209,7 +209,7 @@ func (f *EnvAWSFingerprint) isAWS() bool {
|
||||
}
|
||||
|
||||
match, err := regexp.MatchString("ami-*", string(instanceID))
|
||||
if !match {
|
||||
if err != nil || !match {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@@ -262,7 +262,7 @@ func (f *EnvGCEFingerprint) isGCE() bool {
|
||||
}
|
||||
|
||||
match, err := regexp.MatchString("projects/.+/machineTypes/.+", machineType)
|
||||
if !match {
|
||||
if err != nil || !match {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@@ -123,6 +123,9 @@ func (s *HTTPServer) FileCatRequest(resp http.ResponseWriter, req *http.Request)
|
||||
}
|
||||
|
||||
r, err := fs.ReadAt(path, int64(0), fileInfo.Size)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
io.Copy(resp, r)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -586,6 +586,9 @@ func TestStateStore_JobsByPeriodic(t *testing.T) {
|
||||
}
|
||||
|
||||
iter, err = state.JobsByPeriodic(false)
|
||||
if err != nil {
|
||||
t.Fatalf("err: %v", err)
|
||||
}
|
||||
|
||||
var outNonPeriodic []*structs.Job
|
||||
for {
|
||||
|
||||
Reference in New Issue
Block a user