| OLD | NEW |
| 1 // Copyright 2017 The LUCI Authors. All rights reserved. | 1 // Copyright 2017 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 "testing" | 8 "testing" |
| 9 | 9 |
| 10 miloProto "github.com/luci/luci-go/common/proto/milo" | 10 miloProto "github.com/luci/luci-go/common/proto/milo" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 biReq := milo.BuildInfoRequest{ | 127 biReq := milo.BuildInfoRequest{ |
| 128 Build: &milo.BuildInfoRequest_Buildbot{ | 128 Build: &milo.BuildInfoRequest_Buildbot{ |
| 129 Buildbot: &milo.BuildInfoRequest_BuildBot{ | 129 Buildbot: &milo.BuildInfoRequest_BuildBot{ |
| 130 MasterName: "foo master", | 130 MasterName: "foo master", |
| 131 BuilderName: "bar builder", | 131 BuilderName: "bar builder", |
| 132 BuildNumber: 1337, | 132 BuildNumber: 1337, |
| 133 }, | 133 }, |
| 134 }, | 134 }, |
| 135 } | 135 } |
| 136 | 136 |
| 137 Convey("Load an invalid build", func() { |
| 138 _, err := bip.GetBuildInfo(c, |
| 139 &milo.BuildInfoRequest_BuildBot{ |
| 140 MasterName: "foo master", |
| 141 BuilderName: "bar builder", |
| 142 BuildNumber: 1334, |
| 143 }, "") |
| 144 So(err.Error(), ShouldResemble, "rpc error: code = Unaut
henticated desc = ") |
| 145 }) |
| 146 |
| 137 Convey("Can load a BuildBot build by log location.", func() { | 147 Convey("Can load a BuildBot build by log location.", func() { |
| 138 build.Properties = append(build.Properties, []*buildbotP
roperty{ | 148 build.Properties = append(build.Properties, []*buildbotP
roperty{ |
| 139 {Name: "log_location", Value: "logdog://example.
com/testproject/foo/bar/+/baz/annotations"}, | 149 {Name: "log_location", Value: "logdog://example.
com/testproject/foo/bar/+/baz/annotations"}, |
| 140 }...) | 150 }...) |
| 141 So(ds.Put(c, &build), ShouldBeNil) | 151 So(ds.Put(c, &build), ShouldBeNil) |
| 142 testClient.resp = []interface{}{ | 152 testClient.resp = []interface{}{ |
| 143 datagramGetResponse("testproject", "foo/bar", &l
ogdogStep), | 153 datagramGetResponse("testproject", "foo/bar", &l
ogdogStep), |
| 144 } | 154 } |
| 145 | 155 |
| 146 resp, err := bip.GetBuildInfo(c, biReq.GetBuildbot(), ""
) | 156 resp, err := bip.GetBuildInfo(c, biReq.GetBuildbot(), ""
) |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 }, | 367 }, |
| 358 AnnotationStream: &miloProto.LogdogStream{ | 368 AnnotationStream: &miloProto.LogdogStream{ |
| 359 Server: "example.com", | 369 Server: "example.com", |
| 360 Prefix: "bb/foo_master/bar_builder/1337"
, | 370 Prefix: "bb/foo_master/bar_builder/1337"
, |
| 361 Name: "annotations", | 371 Name: "annotations", |
| 362 }, | 372 }, |
| 363 }) | 373 }) |
| 364 }) | 374 }) |
| 365 }) | 375 }) |
| 366 } | 376 } |
| OLD | NEW |