Adding 'Task name' in Action Execution CLI

Change-Id: I0358a264ff1a229dfe2da78c9a64315e83f39c12
Depends-On: I881e34d17f180673afa9053abb0b5dd8dbe79a42
This commit is contained in:
Nikolay Mahotkin
2015-04-28 14:49:51 +03:00
parent ae19300611
commit b825e365b9
4 changed files with 21 additions and 5 deletions

View File

@@ -35,6 +35,7 @@ def format(action_ex=None, lister=False):
'ID',
'Name',
'Workflow name',
'Task name',
'State',
'State info',
'Is accepted',
@@ -48,6 +49,7 @@ def format(action_ex=None, lister=False):
action_ex.id,
action_ex.name,
action_ex.workflow_name,
action_ex.task_name,
action_ex.state,
state_info,
action_ex.accepted,

View File

@@ -351,7 +351,10 @@ class ActionExecutionIsolationCLITests(base_v2.MistralClientTestBase):
def test_action_execution_isolation(self):
wf = self.workflow_create(self.wf_def)
self.execution_create(wf[0]["Name"])
wf_exec = self.execution_create(wf[0]["Name"])
direct_ex_id = self.get_value_of_field(wf_exec, 'ID')
self.wait_execution_success(direct_ex_id)
act_execs = self.mistral_admin("action-execution-list")
self.assertIn(wf[0]["Name"],

View File

@@ -646,12 +646,22 @@ class ActionExecutionCLITests(base_v2.MistralClientTestBase):
def test_act_execution_get(self):
self.wait_execution_success(self.direct_ex_id)
task = self.mistral_admin(
'task-list', params=self.direct_ex_id)[0]
act_ex_from_list = self.mistral_admin(
'action-execution-list', params=task['ID'])[0]
act_ex = self.mistral_admin(
'action-execution-get', params=self.direct_ex_id)
'action-execution-get', params=act_ex_from_list['ID'])
wf_name = self.get_value_of_field(act_ex, 'Workflow name')
status = self.get_value_of_field(act_ex, 'State')
self.assertEqual(
act_ex_from_list['ID'],
self.get_value_of_field(act_ex, 'ID')
)
self.assertEqual(wf_name, self.direct_wf['Name'])
self.assertEqual(status, 'SUCCESS')

View File

@@ -26,6 +26,7 @@ ACTION_EX_DICT = {
'id': '123',
'name': 'some',
'workflow_name': 'thing',
'task_name': 'task1',
'state': 'RUNNING',
'state_info': 'RUNNING somehow.',
'accepted': True
@@ -59,7 +60,7 @@ class TestCLIActionExecutions(base.BaseCommandTest):
app_args=['id', '--state', 'ERROR'])
self.assertEqual(
('123', 'some', 'thing', 'RUNNING',
('123', 'some', 'thing', 'task1', 'RUNNING',
'RUNNING somehow.', True), result[1]
)
@@ -72,7 +73,7 @@ class TestCLIActionExecutions(base.BaseCommandTest):
result = self.call(action_ex_cmd.List)
self.assertEqual(
[('123', 'some', 'thing', 'RUNNING',
[('123', 'some', 'thing', 'task1', 'RUNNING',
'RUNNING somehow.', True)], result[1]
)
@@ -85,7 +86,7 @@ class TestCLIActionExecutions(base.BaseCommandTest):
result = self.call(action_ex_cmd.Get, app_args=['id'])
self.assertEqual(
('123', 'some', 'thing', 'RUNNING',
('123', 'some', 'thing', 'task1', 'RUNNING',
'RUNNING somehow.', True), result[1]
)