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

Unified Diff: common/api/dm/service/v1/attempt_state_evolve_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « common/api/dm/service/v1/attempt_state_evolve.go ('k') | common/api/dm/service/v1/claim_execution.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/api/dm/service/v1/attempt_state_evolve_test.go
diff --git a/common/api/dm/service/v1/attempt_state_evolve_test.go b/common/api/dm/service/v1/attempt_state_evolve_test.go
index 45bd2ad7f5ff1f63c13f9eb5a67b4ef1acee6b27..ab99a56605fefff24c72b253efc43c55e92e2ee6 100644
--- a/common/api/dm/service/v1/attempt_state_evolve_test.go
+++ b/common/api/dm/service/v1/attempt_state_evolve_test.go
@@ -16,32 +16,32 @@ func TestAttemptState(t *testing.T) {
Convey("Evolve", t, func() {
Convey("Identity", func() {
- s := Attempt_NEEDS_EXECUTION
- So(s.Evolve(Attempt_NEEDS_EXECUTION), ShouldBeNil)
- So(s, ShouldEqual, Attempt_NEEDS_EXECUTION)
+ s := Attempt_SCHEDULING
+ So(s.Evolve(Attempt_SCHEDULING), ShouldBeNil)
+ So(s, ShouldEqual, Attempt_SCHEDULING)
})
Convey("Transition", func() {
s := Attempt_EXECUTING
- So(s.Evolve(Attempt_ADDING_DEPS), ShouldBeNil)
- So(s, ShouldEqual, Attempt_ADDING_DEPS)
+ So(s.Evolve(Attempt_WAITING), ShouldBeNil)
+ So(s, ShouldEqual, Attempt_WAITING)
})
Convey("Invalid starting transistion", func() {
- s := Attempt_NEEDS_EXECUTION
- So(s.Evolve(Attempt_FINISHED), ShouldErrLike, "invalid state transition NEEDS_EXECUTION -> FINISHED")
- So(s, ShouldEqual, Attempt_NEEDS_EXECUTION)
+ s := Attempt_SCHEDULING
+ So(s.Evolve(Attempt_FINISHED), ShouldErrLike, "invalid state transition SCHEDULING -> FINISHED")
+ So(s, ShouldEqual, Attempt_SCHEDULING)
})
Convey("Invalid ending transistion", func() {
- s := Attempt_BLOCKED
- So(s.Evolve(Attempt_FINISHED), ShouldErrLike, "invalid state transition BLOCKED -> FINISHED")
- So(s, ShouldEqual, Attempt_BLOCKED)
+ s := Attempt_WAITING
+ So(s.Evolve(Attempt_FINISHED), ShouldErrLike, "invalid state transition WAITING -> FINISHED")
+ So(s, ShouldEqual, Attempt_WAITING)
})
Convey("MustEvolve", func() {
s := Attempt_FINISHED
- So(func() { s.MustEvolve(Attempt_NEEDS_EXECUTION) }, ShouldPanic)
+ So(func() { s.MustEvolve(Attempt_SCHEDULING) }, ShouldPanic)
})
})
}
« no previous file with comments | « common/api/dm/service/v1/attempt_state_evolve.go ('k') | common/api/dm/service/v1/claim_execution.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698