diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-11-29 18:45:21 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-11-29 20:19:07 +0100 |
commit | c47428b05ffdcd9adc621f47d38fa88ee7c260c7 (patch) | |
tree | 348020df3668d3a78538d6afb0b4e8015646e569 | |
parent | 22a1e56bd592bfb3a122c0c8bd45978791d4518b (diff) | |
download | ick2-c47428b05ffdcd9adc621f47d38fa88ee7c260c7.tar.gz |
Add: set fresh_workspace in work responses
-rw-r--r-- | ick2/workapi.py | 4 | ||||
-rw-r--r-- | ick2/workapi_tests.py | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/ick2/workapi.py b/ick2/workapi.py index f140108..f958132 100644 --- a/ick2/workapi.py +++ b/ick2/workapi.py @@ -62,6 +62,7 @@ class WorkAPI(ick2.APIbase): 'project': project['project'], 'pipeline': pipeline['name'], 'parameters': project.get('parameters', {}), + 'fresh_workspace': True, 'step': pipeline['actions'][index], 'step_index': index, 'log': '/logs/{}'.format(build_id), @@ -154,7 +155,8 @@ class WorkAPI(ick2.APIbase): self._finish_build(update) else: doing['step_index'] = index - doing['step'] = actions[index] + doing['step'] = dict(actions[index]) + doing['fresh_workspace'] = False worker_state = { 'worker': update['worker'], diff --git a/ick2/workapi_tests.py b/ick2/workapi_tests.py index c855895..d7ebfa9 100644 --- a/ick2/workapi_tests.py +++ b/ick2/workapi_tests.py @@ -86,6 +86,7 @@ class WorkAPITests(unittest.TestCase): 'parameters': { 'foo': 'bar', }, + 'fresh_workspace': True, 'step': { 'shell': 'step-1', }, @@ -112,6 +113,7 @@ class WorkAPITests(unittest.TestCase): 'parameters': { 'foo': 'bar', }, + 'fresh_workspace': True, 'step': { 'shell': 'step-1', }, @@ -144,6 +146,7 @@ class WorkAPITests(unittest.TestCase): # We should get the next step now. expected['step'] = {'shell': 'step-2'} expected['step_index'] = 1 + expected['fresh_workspace'] = False self.assertEqual(work.get_work('asterix'), expected) # Finish the step. @@ -173,6 +176,7 @@ class WorkAPITests(unittest.TestCase): 'parameters': { 'foo': 'bar', }, + 'fresh_workspace': True, 'step': { 'shell': 'step-1', }, |