summaryrefslogtreecommitdiff
path: root/yarns/400-build.yarn
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-11-13 20:09:01 +0100
committerLars Wirzenius <liw@liw.fi>2017-11-13 20:09:01 +0100
commit479855edca8b8dedecb99826405e86b8864a8c92 (patch)
treee47869c60e6ed20ba0308df788d5222c327cb854 /yarns/400-build.yarn
parent3803ddf2a0ceee598add980ea23d549481043a78 (diff)
downloadick2-479855edca8b8dedecb99826405e86b8864a8c92.tar.gz
Add: extend build scenario to run a second build
Diffstat (limited to 'yarns/400-build.yarn')
-rw-r--r--yarns/400-build.yarn99
1 files changed, 99 insertions, 0 deletions
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