| OLD | NEW |
| 1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 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 "bytes" | 8 "bytes" |
| 9 "compress/zlib" | 9 "compress/zlib" |
| 10 "encoding/base64" | 10 "encoding/base64" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 func TestPubSub(t *testing.T) { | 84 func TestPubSub(t *testing.T) { |
| 85 Convey(`A test Environment`, t, func() { | 85 Convey(`A test Environment`, t, func() { |
| 86 c := memory.UseWithAppID(context.Background(), "dev~luci-milo") | 86 c := memory.UseWithAppID(context.Background(), "dev~luci-milo") |
| 87 c = gologger.StdConfig.Use(c) | 87 c = gologger.StdConfig.Use(c) |
| 88 c, _ = testclock.UseTime(c, fakeTime) | 88 c, _ = testclock.UseTime(c, fakeTime) |
| 89 c = testconfig.WithCommonClient(c, memcfg.New(bbAclConfigs)) | 89 c = testconfig.WithCommonClient(c, memcfg.New(bbAclConfigs)) |
| 90 c = auth.WithState(c, &authtest.FakeState{ | 90 c = auth.WithState(c, &authtest.FakeState{ |
| 91 Identity: identity.AnonymousIdentity, | 91 Identity: identity.AnonymousIdentity, |
| 92 IdentityGroups: []string{"all"}, | 92 IdentityGroups: []string{"all"}, |
| 93 }) | 93 }) |
| 94 // Update the service config so that the settings are loaded. |
| 95 err := common.UpdateServiceConfig(c) |
| 96 So(err, ShouldBeNil) |
| 94 | 97 |
| 95 rand.Seed(5) | 98 rand.Seed(5) |
| 96 | 99 |
| 97 Convey("Save build entry", func() { | 100 Convey("Save build entry", func() { |
| 98 build := &buildbotBuild{ | 101 build := &buildbotBuild{ |
| 99 Master: "Fake Master", | 102 Master: "Fake Master", |
| 100 Buildername: "Fake buildername", | 103 Buildername: "Fake buildername", |
| 101 Number: 1234, | 104 Number: 1234, |
| 102 Currentstep: "this is a string", | 105 Currentstep: "this is a string", |
| 103 Finished: true, | 106 Finished: true, |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 So(m.Project.Title, ShouldEqual, "some title") | 464 So(m.Project.Title, ShouldEqual, "some title") |
| 462 So(m.Slaves["testslave"].Name, ShouldEqual, "tes
tslave") | 465 So(m.Slaves["testslave"].Name, ShouldEqual, "tes
tslave") |
| 463 So(len(m.Slaves["testslave"].Runningbuilds), Sho
uldEqual, 0) | 466 So(len(m.Slaves["testslave"].Runningbuilds), Sho
uldEqual, 0) |
| 464 So(len(m.Slaves["testslave"].RunningbuildsMap),
ShouldEqual, 1) | 467 So(len(m.Slaves["testslave"].RunningbuildsMap),
ShouldEqual, 1) |
| 465 So(m.Slaves["testslave"].RunningbuildsMap["Fake
buildername"][0], | 468 So(m.Slaves["testslave"].RunningbuildsMap["Fake
buildername"][0], |
| 466 ShouldEqual, 2222) | 469 ShouldEqual, 2222) |
| 467 }) | 470 }) |
| 468 }) | 471 }) |
| 469 }) | 472 }) |
| 470 } | 473 } |
| OLD | NEW |