Expect avant-last line to be + echo grade
This commit is contained in:
parent
2129ba46ee
commit
b1ad293810
@ -80,12 +80,12 @@ func (r *Repository) fetchRepoTests(build_number int, steps map[string]float64)
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(logs) < 1 {
|
if len(logs) < 2 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
line := logs[len(logs)-1]
|
line := logs[len(logs)-1]
|
||||||
if strings.HasPrefix(line.Message, "grade:") {
|
if strings.HasPrefix(logs[len(logs)-2].Message, "+ echo grade:") && strings.HasPrefix(line.Message, "grade:") {
|
||||||
g, err := strconv.ParseFloat(strings.TrimSpace(strings.TrimPrefix(line.Message, "grade:")), 64)
|
g, err := strconv.ParseFloat(strings.TrimSpace(strings.TrimPrefix(line.Message, "grade:")), 64)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
grade += g
|
grade += g
|
||||||
|
Reference in New Issue
Block a user