Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(852)

Side by Side Diff: go/src/infra/appengine/test-results/model/full_result.go

Issue 2252623002: test-results: package model: Add type TestList (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@cl-ing_upload
Patch Set: Fix renamed function call Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « go/src/infra/appengine/test-results/model/aggregate_result_test.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 package model 1 package model
2 2
3 import ( 3 import (
4 "encoding/json" 4 "encoding/json"
5 "errors" 5 "errors"
6 "math" 6 "math"
7 "strings" 7 "strings"
8 ) 8 )
9 9
10 // FullResult represents "full_results.json". 10 // FullResult represents "full_results.json".
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 if ft == nil { 148 if ft == nil {
149 return errors.New("model: UnmarshalJSON: nil *FullTest") 149 return errors.New("model: UnmarshalJSON: nil *FullTest")
150 } 150 }
151 if *ft == nil { 151 if *ft == nil {
152 *ft = FullTest{} 152 *ft = FullTest{}
153 } 153 }
154 return ft.constructTree(m) 154 return ft.constructTree(m)
155 } 155 }
156 156
157 // constructTree constructs the tree of Nodes from the supplied map. 157 // constructTree constructs the tree of Nodes from the supplied map.
158 // constructTree returns an error if the receiver is nil.
159 func (ft *FullTest) constructTree(m map[string]interface{}) error { 158 func (ft *FullTest) constructTree(m map[string]interface{}) error {
160 for k, v := range m { 159 for k, v := range m {
161 mm, ok := v.(map[string]interface{}) 160 mm, ok := v.(map[string]interface{})
162 if !ok { 161 if !ok {
163 continue 162 continue
164 } 163 }
165 164
166 if isFullTestLeaf(mm) { 165 if isFullTestLeaf(mm) {
167 l, err := makeFullTestLeaf(mm) 166 l, err := makeFullTestLeaf(mm)
168 if err != nil { 167 if err != nil {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 if err := json.Unmarshal(data, &aux); err != nil { 311 if err := json.Unmarshal(data, &aux); err != nil {
313 return err 312 return err
314 } 313 }
315 l.Actual = strings.Split(aux.Actual, " ") 314 l.Actual = strings.Split(aux.Actual, " ")
316 l.Expected = strings.Split(aux.Expected, " ") 315 l.Expected = strings.Split(aux.Expected, " ")
317 return nil 316 return nil
318 } 317 }
319 318
320 // Times represents "times_ms.json". 319 // Times represents "times_ms.json".
321 type Times map[string]float64 320 type Times map[string]float64
OLDNEW
« no previous file with comments | « go/src/infra/appengine/test-results/model/aggregate_result_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698