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

Unified Diff: milo/appengine/swarming/buildinfo_test.go

Issue 2902323002: Milo: Swarming module test coverage (Closed)
Patch Set: Undo time change 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « milo/appengine/swarming/build_test.go ('k') | milo/appengine/swarming/expectations/build-gerrit.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/appengine/swarming/buildinfo_test.go
diff --git a/milo/appengine/swarming/buildinfo_test.go b/milo/appengine/swarming/buildinfo_test.go
index 3ac757fd923871350c8584fe82d8a15c0d9292b8..57f1d7ca43d0c8a82f1907e5cdadf99e6137a069 100644
--- a/milo/appengine/swarming/buildinfo_test.go
+++ b/milo/appengine/swarming/buildinfo_test.go
@@ -10,6 +10,7 @@ import (
swarming "github.com/luci/luci-go/common/api/swarming/swarming/v1"
miloProto "github.com/luci/luci-go/common/proto/milo"
+ "github.com/luci/luci-go/grpc/grpcutil"
"github.com/luci/luci-go/logdog/api/endpoints/coordinator/logs/v1"
"github.com/luci/luci-go/logdog/client/coordinator"
milo "github.com/luci/luci-go/milo/api/proto"
@@ -28,6 +29,7 @@ type testSwarmingService struct {
host string
req swarming.SwarmingRpcsTaskRequest
res swarming.SwarmingRpcsTaskResult
+ out string
}
func (sf *testSwarmingService) getHost() string { return sf.host }
@@ -44,6 +46,10 @@ func (sf *testSwarmingService) getSwarmingRequest(c context.Context, taskID stri
return &sf.req, nil
}
+func (sf *testSwarmingService) getTaskOutput(c context.Context, taskID string) (string, error) {
+ return sf.out, nil
+}
+
func TestBuildInfo(t *testing.T) {
t.Parallel()
@@ -192,6 +198,13 @@ func TestBuildInfo(t *testing.T) {
Name: "annotations",
},
})
+
+ Convey("Will return NotFound if the build is internal", func() {
+ testSvc.res.Tags = testSvc.res.Tags[1:]
+ testSvc.req.Tags = testSvc.req.Tags[1:]
+ _, err := bip.GetBuildInfo(c, biReq.GetSwarming(), "testproject")
+ So(err, ShouldResemble, grpcutil.NotFound)
+ })
})
})
}
« no previous file with comments | « milo/appengine/swarming/build_test.go ('k') | milo/appengine/swarming/expectations/build-gerrit.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698