workflows: fix tracing of global action timeouts (#56122)
gitea-wip/wcs/pipeline/head Build started...
Details
gitea-wip/wcs/pipeline/head Build started...
Details
This commit is contained in:
parent
ab12779161
commit
036577686a
|
@ -5074,7 +5074,23 @@ def test_inspect_page_actions_traces(pub):
|
|||
create_environment(pub)
|
||||
create_user(pub, is_admin=True)
|
||||
|
||||
workflow = Workflow.get_default_workflow()
|
||||
workflow.id = '2'
|
||||
workflow.criticality_levels = [
|
||||
WorkflowCriticalityLevel(name='green'),
|
||||
WorkflowCriticalityLevel(name='yellow'),
|
||||
WorkflowCriticalityLevel(name='red'),
|
||||
]
|
||||
action = workflow.add_global_action('Timeout Test')
|
||||
action.append_item('modify_criticality')
|
||||
trigger = action.append_trigger('timeout')
|
||||
trigger.anchor = 'creation'
|
||||
trigger.timeout = '2'
|
||||
workflow.store()
|
||||
|
||||
formdef = FormDef.get_by_urlname('form-title')
|
||||
formdef.workflow_id = workflow.id
|
||||
formdef.store()
|
||||
|
||||
formdef.data_class().wipe()
|
||||
formdata = formdef.data_class()()
|
||||
|
@ -5083,6 +5099,13 @@ def test_inspect_page_actions_traces(pub):
|
|||
formdata.perform_workflow()
|
||||
formdata.store()
|
||||
|
||||
# change receipt time to get global timeout to run
|
||||
formdata.receipt_time = time.localtime(time.time() - 3 * 86400)
|
||||
formdata.store()
|
||||
pub.apply_global_action_timeouts()
|
||||
formdata.refresh_from_storage()
|
||||
assert formdata.get_criticality_level_object().name == 'yellow'
|
||||
|
||||
resp = login(get_app(pub)).get(formdata.get_url(backoffice=True), status=200)
|
||||
resp = resp.click('Data Inspector')
|
||||
assert '<h2>Actions Tracing</h2>' in resp
|
||||
|
@ -5091,7 +5114,15 @@ def test_inspect_page_actions_traces(pub):
|
|||
'Email',
|
||||
'Email',
|
||||
'Automatic Jump',
|
||||
'Criticality Levels',
|
||||
]
|
||||
action_links = [x.attrib['href'] for x in resp.pyquery('#inspect-timeline a.tracing-link')]
|
||||
assert action_links[0] == 'http://example.net/backoffice/workflows/2/status/just_submitted/'
|
||||
assert (
|
||||
action_links[1]
|
||||
== 'http://example.net/backoffice/workflows/2/status/just_submitted/items/_notify_new_receiver_email/'
|
||||
)
|
||||
assert action_links[-1] == 'http://example.net/backoffice/workflows/2/global-actions/1/items/1/'
|
||||
|
||||
|
||||
def test_workflow_jump_previous(pub):
|
||||
|
|
|
@ -1511,7 +1511,7 @@ class WorkflowGlobalActionTimeoutTrigger(WorkflowGlobalActionTrigger):
|
|||
perform_items(
|
||||
action.items,
|
||||
formdata,
|
||||
event=('global-action-timeout', (action.id, trigger.id)),
|
||||
event=('global-action-timeout', action.id, trigger.id),
|
||||
)
|
||||
break
|
||||
|
||||
|
|
Loading…
Reference in New Issue