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

Side by Side Diff: appengine/cmd/dm/mutate/add_backdep_test.go

Issue 1537883002: Initial distributor implementation (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: fix imports and make dummy.go a real file Created 4 years, 6 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 | « appengine/cmd/dm/mutate/add_backdep.go ('k') | appengine/cmd/dm/mutate/add_deps.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 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 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 mutate 5 package mutate
6 6
7 import ( 7 import (
8 "testing" 8 "testing"
9 9
10 "github.com/luci/gae/filter/featureBreaker" 10 "github.com/luci/gae/filter/featureBreaker"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 So(ds.Get(bdg, bd), ShouldBeNil) 52 So(ds.Get(bdg, bd), ShouldBeNil)
53 So(bd.Edge(), ShouldResemble, abd.Dep) 53 So(bd.Edge(), ShouldResemble, abd.Dep)
54 So(bd.Propagated, ShouldBeTrue) 54 So(bd.Propagated, ShouldBeTrue)
55 }) 55 })
56 56
57 Convey("need completion", func() { 57 Convey("need completion", func() {
58 abd.NeedsAck = true 58 abd.NeedsAck = true
59 muts, err := abd.RollForward(c) 59 muts, err := abd.RollForward(c)
60 So(err, ShouldBeNil) 60 So(err, ShouldBeNil)
61 » » » » » So(muts, ShouldResemble, []tumble.Mutati on{ 61 » » » » » So(muts, ShouldResemble, []tumble.Mutati on{&AckFwdDep{abd.Dep}})
62 » » » » » » &AckFwdDep{abd.Dep, true}})
63 62
64 So(ds.Get(bdg, bd), ShouldBeNil) 63 So(ds.Get(bdg, bd), ShouldBeNil)
65 So(bd.Edge(), ShouldResemble, abd.Dep) 64 So(bd.Edge(), ShouldResemble, abd.Dep)
66 So(bd.Propagated, ShouldBeTrue) 65 So(bd.Propagated, ShouldBeTrue)
67 }) 66 })
68 }) 67 })
69 68
70 Convey("attempt not finished, need completion", func() { 69 Convey("attempt not finished, need completion", func() {
71 ex, err := ds.Exists(ds.KeyForObj(bdg)) 70 ex, err := ds.Exists(ds.KeyForObj(bdg))
72 So(err, ShouldBeNil) 71 So(err, ShouldBeNil)
73 So(ex.Any(), ShouldBeFalse) 72 So(ex.Any(), ShouldBeFalse)
74 73
75 abd.NeedsAck = true 74 abd.NeedsAck = true
76 muts, err := abd.RollForward(c) 75 muts, err := abd.RollForward(c)
77 So(err, ShouldBeNil) 76 So(err, ShouldBeNil)
78 » » » » So(muts, ShouldResemble, []tumble.Mutation{ 77 » » » » So(muts, ShouldBeNil)
79 » » » » » &AckFwdDep{abd.Dep, false}})
80 78
81 // Note that bdg was created as a side effect. 79 // Note that bdg was created as a side effect.
82 So(ds.Get(bdg, bd), ShouldBeNil) 80 So(ds.Get(bdg, bd), ShouldBeNil)
83 So(bd.Edge(), ShouldResemble, abd.Dep) 81 So(bd.Edge(), ShouldResemble, abd.Dep)
84 So(bd.Propagated, ShouldBeFalse) 82 So(bd.Propagated, ShouldBeFalse)
85 So(bdg.AttemptFinished, ShouldBeFalse) 83 So(bdg.AttemptFinished, ShouldBeFalse)
86 }) 84 })
87 85
88 Convey("failure", func() { 86 Convey("failure", func() {
89 c, fb := featureBreaker.FilterRDS(c, nil) 87 c, fb := featureBreaker.FilterRDS(c, nil)
90 fb.BreakFeatures(nil, "PutMulti") 88 fb.BreakFeatures(nil, "PutMulti")
91 89
92 _, err := abd.RollForward(c) 90 _, err := abd.RollForward(c)
93 So(err, ShouldErrLike, `feature "PutMulti" is br oken`) 91 So(err, ShouldErrLike, `feature "PutMulti" is br oken`)
94 }) 92 })
95 }) 93 })
96 }) 94 })
97 } 95 }
OLDNEW
« no previous file with comments | « appengine/cmd/dm/mutate/add_backdep.go ('k') | appengine/cmd/dm/mutate/add_deps.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698