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

Unified Diff: milo/appengine/buildbot/master_test.go

Issue 2856273004: Milo: Increase test coverage for appengine/buildbot (Closed)
Patch Set: review Created 3 years, 7 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/buildbot/html_test.go ('k') | milo/appengine/buildbot/pubsub_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/appengine/buildbot/master_test.go
diff --git a/milo/appengine/buildbot/master_test.go b/milo/appengine/buildbot/master_test.go
new file mode 100644
index 0000000000000000000000000000000000000000..d29074eeb7372cdce25f76b5d043879f77534da0
--- /dev/null
+++ b/milo/appengine/buildbot/master_test.go
@@ -0,0 +1,41 @@
+// Copyright 2017 The LUCI Authors. All rights reserved.
+// Use of this source code is governed under the Apache License, Version 2.0
+// that can be found in the LICENSE file.
+
+package buildbot
+
+import (
+ "context"
+ "testing"
+
+ "github.com/luci/gae/impl/memory"
+ "github.com/luci/gae/service/datastore"
+ "github.com/luci/luci-go/common/clock/testclock"
+
+ . "github.com/smartystreets/goconvey/convey"
+)
+
+func TestMaster(t *testing.T) {
+ c := memory.UseWithAppID(context.Background(), "dev~luci-milo")
+ c, _ = testclock.UseTime(c, testclock.TestTimeUTC)
+ datastore.GetTestable(c).Consistent(true)
+ datastore.GetTestable(c).AutoIndex(true)
+ datastore.GetTestable(c).CatchupIndexes()
+
+ Convey(`Tests for master`, t, func() {
+ So(putDSMasterJSON(c, &buildbotMaster{
+ Name: "fake",
+ Builders: map[string]*buildbotBuilder{"fake": {}},
+ }, false), ShouldBeNil)
+ So(putDSMasterJSON(c, &buildbotMaster{
+ Name: "fake internal",
+ Builders: map[string]*buildbotBuilder{"fake": {}},
+ }, true), ShouldBeNil)
+
+ Convey(`GetAllBuilders()`, func() {
+ cs, err := GetAllBuilders(c)
+ So(err, ShouldBeNil)
+ So(len(cs.BuilderGroups), ShouldEqual, 1)
+ })
+ })
+}
« no previous file with comments | « milo/appengine/buildbot/html_test.go ('k') | milo/appengine/buildbot/pubsub_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698