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

Unified Diff: scheduler/appengine/apiservers/scheduler_test.go

Issue 2967373004: scheduler: expose paused property of a Job. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « scheduler/appengine/apiservers/scheduler.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scheduler/appengine/apiservers/scheduler_test.go
diff --git a/scheduler/appengine/apiservers/scheduler_test.go b/scheduler/appengine/apiservers/scheduler_test.go
index 2af9e00efd44e982942265964f397de6ac332b55..0eeb8f7b9e477d9ea937d3107d327b8841995ca7 100644
--- a/scheduler/appengine/apiservers/scheduler_test.go
+++ b/scheduler/appengine/apiservers/scheduler_test.go
@@ -75,11 +75,13 @@ func TestGetJobsApi(t *testing.T) {
JobRef: &scheduler.JobRef{Job: "foo", Project: "bar"},
Schedule: "0 * * * * * *",
State: &scheduler.JobState{UiStatus: "RUNNING"},
+ Paused: false,
},
{
JobRef: &scheduler.JobRef{Job: "faz", Project: "baz"},
Schedule: "with 1m interval",
State: &scheduler.JobState{UiStatus: "PAUSED"},
+ Paused: true,
},
})
})
@@ -104,6 +106,34 @@ func TestGetJobsApi(t *testing.T) {
JobRef: &scheduler.JobRef{Job: "foo", Project: "bar"},
Schedule: "0 * * * * * *",
State: &scheduler.JobState{UiStatus: "RUNNING"},
+ Paused: false,
+ },
+ })
+ })
+
+ Convey("Paused but currently running job", func() {
+ fakeEng.getProjectJobs = func(projectID string) ([]*engine.Job, error) {
+ So(projectID, ShouldEqual, "bar")
+ return []*engine.Job{
+ {
+ // Job which is paused but its latest invocation still running.
+ JobID: "bar/foo",
+ ProjectID: "bar",
+ Schedule: "0 * * * * * *",
+ State: engine.JobState{State: engine.JobStateRunning},
+ Paused: true,
+ Task: fakeTaskBlob,
+ },
+ }, nil
+ }
+ reply, err := ss.GetJobs(ctx, &scheduler.JobsRequest{Project: "bar"})
+ So(err, ShouldBeNil)
+ So(reply.GetJobs(), ShouldResemble, []*scheduler.Job{
+ {
+ JobRef: &scheduler.JobRef{Job: "foo", Project: "bar"},
+ Schedule: "0 * * * * * *",
+ State: &scheduler.JobState{UiStatus: "RUNNING"},
+ Paused: true,
},
})
})
« no previous file with comments | « scheduler/appengine/apiservers/scheduler.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698