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

Side by Side Diff: milo/buildsource/buildbot/pubsub_test.go

Issue 2982183002: Milo: Store console defs as their own entities (Closed)
Patch Set: Rebase fixes and Working Created 3 years, 5 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 unified diff | Download patch
« no previous file with comments | « milo/api/resp/build.go ('k') | milo/buildsource/console.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The LUCI Authors. 1 // Copyright 2016 The LUCI Authors.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 } 465 }
466 p := httprouter.Params{} 466 p := httprouter.Params{}
467 PubSubHandler(&router.Context{ 467 PubSubHandler(&router.Context{
468 Context: c, 468 Context: c,
469 Writer: h, 469 Writer: h,
470 Request: r, 470 Request: r,
471 Params: p, 471 Params: p,
472 }) 472 })
473 So(h.Code, ShouldEqual, 200) 473 So(h.Code, ShouldEqual, 200)
474 Convey("And stores correctly", func() { 474 Convey("And stores correctly", func() {
475 err := common.UpdateProjectConfigs(c)
476 So(err, ShouldBeNil)
477 c = auth.WithState(c, &authtest.FakeState{ 475 c = auth.WithState(c, &authtest.FakeState{
478 Identity: "user:alicebob@google.co m", 476 Identity: "user:alicebob@google.co m",
479 IdentityGroups: []string{"googlers", "al l"}, 477 IdentityGroups: []string{"googlers", "al l"},
480 }) 478 })
481 loadB := &buildbotBuild{ 479 loadB := &buildbotBuild{
482 Master: "Fake Master", 480 Master: "Fake Master",
483 Buildername: "Fake buildername", 481 Buildername: "Fake buildername",
484 Number: 1234, 482 Number: 1234,
485 } 483 }
486 err = ds.Get(c, loadB) 484 err = ds.Get(c, loadB)
487 So(err, ShouldBeNil) 485 So(err, ShouldBeNil)
488 So(loadB.Master, ShouldEqual, "Fake Master") 486 So(loadB.Master, ShouldEqual, "Fake Master")
489 So(loadB.Internal, ShouldEqual, true) 487 So(loadB.Internal, ShouldEqual, true)
490 So(loadB.Currentstep.(string), ShouldEqual, "thi s is a string") 488 So(loadB.Currentstep.(string), ShouldEqual, "thi s is a string")
491 m, _, t, err := getMasterJSON(c, "Fake Master") 489 m, _, t, err := getMasterJSON(c, "Fake Master")
492 So(err, ShouldBeNil) 490 So(err, ShouldBeNil)
493 So(t.Unix(), ShouldEqual, 981173106) 491 So(t.Unix(), ShouldEqual, 981173106)
494 So(m.Name, ShouldEqual, "Fake Master") 492 So(m.Name, ShouldEqual, "Fake Master")
495 So(m.Project.Title, ShouldEqual, "some title") 493 So(m.Project.Title, ShouldEqual, "some title")
496 So(m.Slaves["testslave"].Name, ShouldEqual, "tes tslave") 494 So(m.Slaves["testslave"].Name, ShouldEqual, "tes tslave")
497 So(len(m.Slaves["testslave"].Runningbuilds), Sho uldEqual, 0) 495 So(len(m.Slaves["testslave"].Runningbuilds), Sho uldEqual, 0)
498 So(len(m.Slaves["testslave"].RunningbuildsMap), ShouldEqual, 1) 496 So(len(m.Slaves["testslave"].RunningbuildsMap), ShouldEqual, 1)
499 So(m.Slaves["testslave"].RunningbuildsMap["Fake buildername"][0], 497 So(m.Slaves["testslave"].RunningbuildsMap["Fake buildername"][0],
500 ShouldEqual, 2222) 498 ShouldEqual, 2222)
501 }) 499 })
502 }) 500 })
503 }) 501 })
504 } 502 }
OLDNEW
« no previous file with comments | « milo/api/resp/build.go ('k') | milo/buildsource/console.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698