| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 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 swarming | 5 package swarming |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "fmt" | 8 "fmt" |
| 9 "io/ioutil" | 9 "io/ioutil" |
| 10 "path/filepath" | 10 "path/filepath" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 // TestableBuild is a subclass of Build that interfaces with TestableHandler and | 56 // TestableBuild is a subclass of Build that interfaces with TestableHandler and |
| 57 // includes sample test data. | 57 // includes sample test data. |
| 58 type TestableBuild struct{ Build } | 58 type TestableBuild struct{ Build } |
| 59 | 59 |
| 60 // TestData returns sample test data. | 60 // TestData returns sample test data. |
| 61 func (l TestableLog) TestData() []settings.TestBundle { | 61 func (l TestableLog) TestData() []settings.TestBundle { |
| 62 return []settings.TestBundle{ | 62 return []settings.TestBundle{ |
| 63 { | 63 { |
| 64 Description: "Basic log", | 64 Description: "Basic log", |
| 65 » » » Data: templates.Args{"Log": "This is the log"}, | 65 » » » Data: templates.Args{ |
| 66 » » » » "Log": "This is the log", |
| 67 » » » » "Closed": true, |
| 68 » » » }, |
| 66 }, | 69 }, |
| 67 } | 70 } |
| 68 } | 71 } |
| 69 | 72 |
| 70 // TestData returns sample test data. | 73 // TestData returns sample test data. |
| 71 func (b TestableBuild) TestData() []settings.TestBundle { | 74 func (b TestableBuild) TestData() []settings.TestBundle { |
| 72 basic := resp.MiloBuild{ | 75 basic := resp.MiloBuild{ |
| 73 Summary: resp.BuildComponent{ | 76 Summary: resp.BuildComponent{ |
| 74 Label: "Test swarming build", | 77 Label: "Test swarming build", |
| 75 Status: resp.Success, | 78 Status: resp.Success, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 91 if err != nil { | 94 if err != nil { |
| 92 panic(fmt.Errorf("Error while processing %s: %s", tc, er
r)) | 95 panic(fmt.Errorf("Error while processing %s: %s", tc, er
r)) |
| 93 } | 96 } |
| 94 results = append(results, settings.TestBundle{ | 97 results = append(results, settings.TestBundle{ |
| 95 Description: tc, | 98 Description: tc, |
| 96 Data: templates.Args{"Build": build}, | 99 Data: templates.Args{"Build": build}, |
| 97 }) | 100 }) |
| 98 } | 101 } |
| 99 return results | 102 return results |
| 100 } | 103 } |
| OLD | NEW |