| OLD | NEW |
| (Empty) | |
| 1 package buildbot |
| 2 |
| 3 import ( |
| 4 "context" |
| 5 "testing" |
| 6 |
| 7 "github.com/luci/gae/impl/memory" |
| 8 "github.com/luci/gae/service/datastore" |
| 9 "github.com/luci/luci-go/common/clock/testclock" |
| 10 . "github.com/smartystreets/goconvey/convey" |
| 11 ) |
| 12 |
| 13 func TestMaster(t *testing.T) { |
| 14 c := memory.UseWithAppID(context.Background(), "dev~luci-milo") |
| 15 c, _ = testclock.UseTime(c, testclock.TestTimeUTC) |
| 16 datastore.GetTestable(c).Consistent(true) |
| 17 datastore.GetTestable(c).AutoIndex(true) |
| 18 datastore.GetTestable(c).CatchupIndexes() |
| 19 |
| 20 Convey(`Tests for master`, t, func() { |
| 21 So(putDSMasterJSON(c, &buildbotMaster{ |
| 22 Name: "fake", |
| 23 Builders: map[string]*buildbotBuilder{"fake": {}}, |
| 24 }, false), ShouldBeNil) |
| 25 So(putDSMasterJSON(c, &buildbotMaster{ |
| 26 Name: "fake internal", |
| 27 Builders: map[string]*buildbotBuilder{"fake": {}}, |
| 28 }, true), ShouldBeNil) |
| 29 |
| 30 Convey(`GetAllBuilders()`, func() { |
| 31 cs, err := GetAllBuilders(c) |
| 32 So(err, ShouldBeNil) |
| 33 So(len(cs.BuilderGroups), ShouldEqual, 1) |
| 34 }) |
| 35 }) |
| 36 } |
| OLD | NEW |