| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. |
| 4 |
| 5 package buildbot |
| 6 |
| 7 import ( |
| 8 "context" |
| 9 "testing" |
| 10 |
| 11 "github.com/luci/gae/impl/memory" |
| 12 "github.com/luci/gae/service/datastore" |
| 13 "github.com/luci/luci-go/common/clock/testclock" |
| 14 |
| 15 . "github.com/smartystreets/goconvey/convey" |
| 16 ) |
| 17 |
| 18 func TestMaster(t *testing.T) { |
| 19 c := memory.UseWithAppID(context.Background(), "dev~luci-milo") |
| 20 c, _ = testclock.UseTime(c, testclock.TestTimeUTC) |
| 21 datastore.GetTestable(c).Consistent(true) |
| 22 datastore.GetTestable(c).AutoIndex(true) |
| 23 datastore.GetTestable(c).CatchupIndexes() |
| 24 |
| 25 Convey(`Tests for master`, t, func() { |
| 26 So(putDSMasterJSON(c, &buildbotMaster{ |
| 27 Name: "fake", |
| 28 Builders: map[string]*buildbotBuilder{"fake": {}}, |
| 29 }, false), ShouldBeNil) |
| 30 So(putDSMasterJSON(c, &buildbotMaster{ |
| 31 Name: "fake internal", |
| 32 Builders: map[string]*buildbotBuilder{"fake": {}}, |
| 33 }, true), ShouldBeNil) |
| 34 |
| 35 Convey(`GetAllBuilders()`, func() { |
| 36 cs, err := GetAllBuilders(c) |
| 37 So(err, ShouldBeNil) |
| 38 So(len(cs.BuilderGroups), ShouldEqual, 1) |
| 39 }) |
| 40 }) |
| 41 } |
| OLD | NEW |