From 0f1d4e3d8cbd48a51fd19b63aa23e11a36ef7cbf Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 5 Nov 2017 20:33:32 +0100 Subject: Fix: build scenario to match code --- yarns/400-build.yarn | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'yarns/400-build.yarn') diff --git a/yarns/400-build.yarn b/yarns/400-build.yarn index 30e47c6..a316407 100644 --- a/yarns/400-build.yarn +++ b/yarns/400-build.yarn @@ -152,7 +152,6 @@ Worker reports some build output. Note the null exit code. ... "timestamp": "2017-10-27T17:08:49" ... } THEN result has status code 201 - AND body matches { "result": "waiting for more" } Still the same job, since the first build step didnt't finish. @@ -160,11 +159,13 @@ Still the same job, since the first build step didnt't finish. THEN result has status code 200 AND body matches ... { + ... "worker": "obelix", ... "project": "rome", ... "pipeline": "construct", ... "step": { ... "shell": "day 1" - ... } + ... }, + ... "step_index": 0 ... } Report the step is done, and successfully. @@ -179,8 +180,7 @@ Report the step is done, and successfully. ... "stderr": "", ... "timestamp": "2017-10-27T17:08:49" ... } - THEN result has status code 200 - AND body matches { "result": "next step awaits you" } + THEN result has status code 201 Now there's another step to do. @@ -188,24 +188,30 @@ Now there's another step to do. THEN result has status code 200 AND body matches ... { + ... "worker": "obelix", ... "project": "rome", ... "pipeline": "construct", ... "step": { ... "shell": "day 2" - ... } + ... }, + ... "step_index": 1 ... } User sees changed status. - WHEN user makes request GET /projects/rome/pipelines/construct + WHEN user makes request GET /workers/obelix THEN result has status code 200 AND body matches ... { - ... "status": "running", ... "worker": "obelix", - ... "step_number": 2, - ... "step": { - ... "shell": "day 2" + ... "doing": { + ... "worker": "obelix", + ... "project": "rome", + ... "pipeline": "construct", + ... "step_index": 1, + ... "step": { + ... "shell": "day 2" + ... } ... } ... } @@ -221,8 +227,7 @@ Report it done. ... "stderr": "", ... "timestamp": "2017-10-27T17:08:49" ... } - THEN result has status code 200 - AND body matches { "result": "no more steps" } + THEN result has status code 201 Now there's no more work to do. -- cgit v1.2.1