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

Unified Diff: dm/tools/jobsim_client/main.go

Issue 2339413003: Refactor and test jobsim_client. (Closed)
Patch Set: Remove old script Created 4 years, 3 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
Index: dm/tools/jobsim_client/main.go
diff --git a/dm/tools/jobsim_client/main.go b/dm/tools/jobsim_client/main.go
index 82f12367c4abb5455bcf25549b7ffe76145054f6..88f848c67184d71c62f013dfda444e07d972a504 100644
--- a/dm/tools/jobsim_client/main.go
+++ b/dm/tools/jobsim_client/main.go
@@ -112,7 +112,7 @@ func (r *cmdRun) start(a subcommands.Application, cr subcommands.CommandRun, c *
r.exAuth.Token = key
}
-func (r *cmdRun) depOn(jobProperties ...interface{}) []string {
+func (r *cmdRun) depOn(jobProperties ...interface{}) (data []string, stop bool) {
req := &dm.EnsureGraphDataReq{
ForExecution: r.exAuth,
@@ -143,8 +143,8 @@ func (r *cmdRun) depOn(jobProperties ...interface{}) []string {
panic(err)
}
if rsp.ShouldHalt {
- logging.Infof(r, "got ShouldHalt, quitting")
- os.Exit(0)
+ logging.Infof(r, "got ShouldHalt")
+ return nil, true
}
ret := make([]string, len(jobProperties))
@@ -152,10 +152,10 @@ func (r *cmdRun) depOn(jobProperties ...interface{}) []string {
ret[i] = rsp.Result.Quests[qid.Id].Attempts[1].Data.GetFinished().Data.Object
}
- return ret
+ return ret, false
}
-func (r *cmdRun) finish(data interface{}) {
+func (r *cmdRun) finish(data interface{}) int {
encData, err := json.Marshal(data)
if err != nil {
panic(err)
@@ -169,7 +169,7 @@ func (r *cmdRun) finish(data interface{}) {
if err != nil {
panic(err)
}
- os.Exit(0)
+ return 0
}
// argErr prints an err and usage to stderr and returns an exit code.

Powered by Google App Engine
This is Rietveld 408576698