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

Side by Side Diff: milo/appengine/buildbot/buildinfo_test.go

Issue 2856273004: Milo: Increase test coverage for appengine/buildbot (Closed)
Patch Set: review Created 3 years, 6 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 | « milo/appengine/buildbot/buildinfo.go ('k') | milo/appengine/buildbot/console_test.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « milo/appengine/buildbot/buildinfo.go ('k') | milo/appengine/buildbot/console_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698