diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-01-13 15:06:15 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-01-14 22:23:47 +0200 |
commit | efba85dcfa234b40160864e6eeddd472fb9853a9 (patch) | |
tree | 24123be0482f40f877a1693dff91508f11c83c3c /ick2/workapi_tests.py | |
parent | b1a4f39271979b1f1f9e461d8f97c2f01b6ab407 (diff) | |
download | ick2-efba85dcfa234b40160864e6eeddd472fb9853a9.tar.gz |
Add: prepend a create_workspace action to pipelines
This replaces the old fresh_workspace attribute of work resources.
It's better this way, because it moves policy from worker-manager to
controller, where it belongs.
Diffstat (limited to 'ick2/workapi_tests.py')
-rw-r--r-- | ick2/workapi_tests.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/ick2/workapi_tests.py b/ick2/workapi_tests.py index d0e8e8d..48c9bbb 100644 --- a/ick2/workapi_tests.py +++ b/ick2/workapi_tests.py @@ -86,9 +86,8 @@ class WorkAPITests(unittest.TestCase): 'parameters': { 'foo': 'bar', }, - 'fresh_workspace': True, 'step': { - 'shell': 'step-1', + 'action': 'create_workspace', }, 'log': '/logs/1', } @@ -112,9 +111,8 @@ class WorkAPITests(unittest.TestCase): 'parameters': { 'foo': 'bar', }, - 'fresh_workspace': True, 'step': { - 'shell': 'step-1', + 'action': 'create_workspace', }, 'log': '/logs/1', } @@ -142,8 +140,15 @@ class WorkAPITests(unittest.TestCase): work.update_work(done) # We should get the next step now. + expected['step'] = {'shell': 'step-1'} + self.assertEqual(work.get_work('asterix'), expected) + + # Finish the step. + done['exit_code'] = 0 + work.update_work(done) + + # We should get the next step now. expected['step'] = {'shell': 'step-2'} - expected['fresh_workspace'] = False self.assertEqual(work.get_work('asterix'), expected) # Finish the step. @@ -173,9 +178,8 @@ class WorkAPITests(unittest.TestCase): 'parameters': { 'foo': 'bar', }, - 'fresh_workspace': True, 'step': { - 'shell': 'step-1', + 'action': 'create_workspace', }, 'log': '/logs/1', } |