From 479855edca8b8dedecb99826405e86b8864a8c92 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 13 Nov 2017 20:09:01 +0100 Subject: Add: extend build scenario to run a second build --- yarns/400-build.yarn | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) (limited to 'yarns') diff --git a/yarns/400-build.yarn b/yarns/400-build.yarn index 44e01f3..9519952 100644 --- a/yarns/400-build.yarn +++ b/yarns/400-build.yarn @@ -329,4 +329,103 @@ Also, there's a build with a log. AND result has header Content-Type: text/plain AND body text is "hey ho, hey ho\nto the gold mine we go!\n" +Start build again. This should become build number 2. + + WHEN user makes request PUT /projects/rome/pipelines/construct + ... { "status": "triggered" } + THEN result has status code 200 + + WHEN worker-manager makes request GET /work/obelix + THEN result has status code 200 + AND body matches + ... { + ... "build_id": 2, + ... "log": "/logs/1", + ... "worker": "obelix", + ... "project": "rome", + ... "pipeline": "construct", + ... "step": { + ... "shell": "day 1" + ... }, + ... "step_index": 0 + ... } + + WHEN user makes request GET /builds + THEN result has status code 200 + AND body matches + ... { + ... "builds": [ + ... { + ... "build_id": 1, + ... "log": "/logs/1", + ... "worker": "obelix", + ... "project": "rome", + ... "pipeline": "construct", + ... "status": 0, + ... }, + ... { + ... "build_id": 2, + ... "log": "/logs/2", + ... "worker": "obelix", + ... "project": "rome", + ... "pipeline": "construct", + ... "status": "building", + ... } + ... ] + ... } + + WHEN worker-manager makes request POST /work + ... { + ... "build_id": 2, + ... "worker": "obelix", + ... "project": "rome", + ... "pipeline": "construct", + ... "exit_code": 0, + ... "stdout": "hey ho", + ... "stderr": "", + ... "timestamp": "2017-10-27T17:08:49" + ... } + THEN result has status code 201 + + WHEN worker-manager makes request GET /work/obelix + THEN result has status code 200 + + WHEN worker-manager makes request POST /work + ... { + ... "build_id": 2, + ... "worker": "obelix", + ... "project": "rome", + ... "pipeline": "construct", + ... "exit_code": 0, + ... "stdout": "hey ho", + ... "stderr": "", + ... "timestamp": "2017-10-27T17:08:49" + ... } + THEN result has status code 201 + + + WHEN user makes request GET /builds + THEN result has status code 200 + AND body matches + ... { + ... "builds": [ + ... { + ... "build_id": 1, + ... "log": "/logs/1", + ... "worker": "obelix", + ... "project": "rome", + ... "pipeline": "construct", + ... "status": 0, + ... }, + ... { + ... "build_id": 2, + ... "log": "/logs/2", + ... "worker": "obelix", + ... "project": "rome", + ... "pipeline": "construct", + ... "status": 0, + ... } + ... ] + ... } + FINALLY stop ick controller -- cgit v1.2.1