| OLD | NEW |
| 1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package buildbot | 5 package buildbot |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "encoding/json" | 8 "encoding/json" |
| 9 "fmt" | 9 "fmt" |
| 10 "io/ioutil" | 10 "io/ioutil" |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 } | 370 } |
| 371 } else { | 371 } else { |
| 372 log.Warningf(c, "Found issue but not rietveld property."
) | 372 log.Warningf(c, "Found issue but not rietveld property."
) |
| 373 } | 373 } |
| 374 } | 374 } |
| 375 return ss | 375 return ss |
| 376 } | 376 } |
| 377 | 377 |
| 378 func getDebugBuild(c context.Context, builder, buildNum string) (*buildbotBuild,
error) { | 378 func getDebugBuild(c context.Context, builder, buildNum string) (*buildbotBuild,
error) { |
| 379 fname := fmt.Sprintf("%s.%s.json", builder, buildNum) | 379 fname := fmt.Sprintf("%s.%s.json", builder, buildNum) |
| 380 » path := filepath.Join("testdata", "buildbot", fname) | 380 » // ../buildbot below assumes that |
| 381 » // - this code is not executed by tests outside of this dir |
| 382 » // - this dir is a sibling of frontend dir |
| 383 » path := filepath.Join("..", "buildbot", "testdata", fname) |
| 381 raw, err := ioutil.ReadFile(path) | 384 raw, err := ioutil.ReadFile(path) |
| 382 if err != nil { | 385 if err != nil { |
| 383 return nil, err | 386 return nil, err |
| 384 } | 387 } |
| 385 b := &buildbotBuild{} | 388 b := &buildbotBuild{} |
| 386 return b, json.Unmarshal(raw, b) | 389 return b, json.Unmarshal(raw, b) |
| 387 } | 390 } |
| 388 | 391 |
| 389 // build fetches a buildbot build and translates it into a miloBuild. | 392 // build fetches a buildbot build and translates it into a miloBuild. |
| 390 func build(c context.Context, master, builder, buildNum string) (*resp.MiloBuild
, error) { | 393 func build(c context.Context, master, builder, buildNum string) (*resp.MiloBuild
, error) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 401 | 404 |
| 402 // TODO(hinoka): Do all fields concurrently. | 405 // TODO(hinoka): Do all fields concurrently. |
| 403 return &resp.MiloBuild{ | 406 return &resp.MiloBuild{ |
| 404 SourceStamp: sourcestamp(c, b), | 407 SourceStamp: sourcestamp(c, b), |
| 405 Summary: summary(b), | 408 Summary: summary(b), |
| 406 Components: components(b), | 409 Components: components(b), |
| 407 PropertyGroup: properties(b), | 410 PropertyGroup: properties(b), |
| 408 Blame: blame(b), | 411 Blame: blame(b), |
| 409 }, nil | 412 }, nil |
| 410 } | 413 } |
| OLD | NEW |