diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-05-28 19:51:58 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-06-10 19:44:16 +0300 |
commit | 9759c2b51a1250aa345c21b7cc6b793f4965ac2d (patch) | |
tree | a96339ec340bdb1e7b4bef4cf5cb3a7a4a0754b4 /yarns/500-build-fail.yarn | |
parent | 269ee474d77a5210288cf33ee9d687c8aaa29de9 (diff) | |
download | ick2-9759c2b51a1250aa345c21b7cc6b793f4965ac2d.tar.gz |
Add: BuildStateMachine class
Diffstat (limited to 'yarns/500-build-fail.yarn')
-rw-r--r-- | yarns/500-build-fail.yarn | 53 |
1 files changed, 48 insertions, 5 deletions
diff --git a/yarns/500-build-fail.yarn b/yarns/500-build-fail.yarn index 4d4071a..204bfd5 100644 --- a/yarns/500-build-fail.yarn +++ b/yarns/500-build-fail.yarn @@ -101,6 +101,7 @@ failure. WHEN obelix makes request POST /work with a valid token and body ... { ... "build_id": "rome/1", + ... "action_id": "1", ... "worker": "obelix", ... "project": "rome", ... "exit_code": 1, @@ -110,8 +111,38 @@ failure. ... } THEN result has status code 201 -A build step failed, so now the build has ended, and there's no more -work to do. +Worker is next told to notify end of build. + + WHEN obelix makes request GET /work + THEN result has status code 200 + AND body matches + ... { + ... "build_id": "rome/1", + ... "build_number": 1, + ... "log": "/logs/rome/1", + ... "worker": "obelix", + ... "project": "rome", + ... "parameters": {}, + ... "action_id": "4", + ... "step": { + ... "action": "notify" + ... } + ... } + + WHEN obelix makes request POST /work with a valid token and body + ... { + ... "build_id": "rome/1", + ... "action_id": "4", + ... "worker": "obelix", + ... "project": "rome", + ... "exit_code": 0, + ... "stdout": "", + ... "stderr": "eek!", + ... "timestamp": "2017-10-27T17:08:49" + ... } + THEN result has status code 201 + +The build has ended, and there's no more work to do. WHEN obelix makes request GET /work THEN result has status code 200 @@ -159,9 +190,15 @@ There's a build with a log. ... "status": "blocked", ... "depends": ["2"], ... "action": {"shell": "day 2", "where": "host"} + ... }, + ... "4": { + ... "status": "done", + ... "depends": [], + ... "action": {"action": "notify"} ... } ... }, - ... "status": 1 + ... "status": "failed", + ... "exit_code": 1 ... } ... ] ... } @@ -194,14 +231,20 @@ There's a build with a log. ... "status": "blocked", ... "depends": ["2"], ... "action": {"shell": "day 2", "where": "host"} + ... }, + ... "4": { + ... "status": "done", + ... "depends": [], + ... "action": {"action": "notify"} ... } ... }, - ... "status": 1 + ... "status": "failed", + ... "exit_code": 1 ... } WHEN user makes request GET /logs/rome/1 THEN result has status code 200 AND result has header Content-Type: text/plain - AND body text is "eek!" + AND body text contains "eek!" FINALLY stop ick controller |