diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-11-26 14:02:43 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-11-26 14:02:43 +0100 |
commit | 06d83e1063acf7790461397f29afdb7cc24d5d09 (patch) | |
tree | ffb54012a66b4bd50dad05f64bc42af7ef2ac113 | |
parent | 3e0be8437d6794e5e73f4db8e87aa6ee81278ee3 (diff) | |
download | ick2-06d83e1063acf7790461397f29afdb7cc24d5d09.tar.gz |
Add: unit test check work steps get project params
-rw-r--r-- | ick2/workapi.py | 1 | ||||
-rw-r--r-- | ick2/workapi_tests.py | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/ick2/workapi.py b/ick2/workapi.py index 81bff66..5935fe9 100644 --- a/ick2/workapi.py +++ b/ick2/workapi.py @@ -61,6 +61,7 @@ class WorkAPI(ick2.APIbase): 'worker': worker, 'project': project['project'], 'pipeline': pipeline['name'], + 'parameters': project.get('parameters', {}), 'step': pipeline['actions'][index], 'step_index': index, 'log': '/logs/{}'.format(build_id), diff --git a/ick2/workapi_tests.py b/ick2/workapi_tests.py index 03b25e7..f657687 100644 --- a/ick2/workapi_tests.py +++ b/ick2/workapi_tests.py @@ -36,6 +36,9 @@ class WorkAPITests(unittest.TestCase): def create_project_api(self): project = { 'project': 'foo', + 'parameters': { + 'foo': 'bar', + }, 'pipelines': [ { 'name': 'build', @@ -81,6 +84,9 @@ class WorkAPITests(unittest.TestCase): 'worker': 'asterix', 'project': 'foo', 'pipeline': 'build', + 'parameters': { + 'foo': 'bar', + }, 'step': { 'shell': 'step-1', }, @@ -104,6 +110,9 @@ class WorkAPITests(unittest.TestCase): 'worker': 'asterix', 'project': 'foo', 'pipeline': 'build', + 'parameters': { + 'foo': 'bar', + }, 'step': { 'shell': 'step-1', }, @@ -162,6 +171,9 @@ class WorkAPITests(unittest.TestCase): 'worker': 'asterix', 'project': 'foo', 'pipeline': 'build', + 'parameters': { + 'foo': 'bar', + }, 'step': { 'shell': 'step-1', }, |