Test for errors

This commit is contained in:
Sean Chittenden
2016-06-16 14:32:07 -07:00
parent ed598bf584
commit 8e1777ae3a
4 changed files with 8 additions and 2 deletions

View File

@@ -209,7 +209,7 @@ func (f *EnvAWSFingerprint) isAWS() bool {
}
match, err := regexp.MatchString("ami-*", string(instanceID))
if !match {
if err != nil || !match {
return false
}

View File

@@ -262,7 +262,7 @@ func (f *EnvGCEFingerprint) isGCE() bool {
}
match, err := regexp.MatchString("projects/.+/machineTypes/.+", machineType)
if !match {
if err != nil || !match {
return false
}

View File

@@ -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
}

View File

@@ -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 {