Skip to content

Commit 11546b4

Browse files
committed
Refactor workflow inspection unit tests
Refactor the workflow inspection unit tests to accomodate change in the workflow schema.
1 parent 4cfebcf commit 11546b4

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

contrib/runners/orquesta_runner/tests/unit/test_error_handling.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,11 @@ def test_fail_inspection(self):
138138
},
139139
{
140140
'type': 'syntax',
141-
'message': '[{\'cmd\': \'echo <% ctx().macro %>\'}] is not of type \'object\'',
142-
'schema_path': 'properties.tasks.patternProperties.^\w+$.properties.input.type',
141+
'message': (
142+
'[{\'cmd\': \'echo <% ctx().macro %>\'}] is '
143+
'not valid under any of the given schemas'
144+
),
145+
'schema_path': 'properties.tasks.patternProperties.^\w+$.properties.input.oneOf',
143146
'spec_path': 'tasks.task2.input'
144147
}
145148
]

st2api/tests/unit/controllers/v1/test_workflow_inspection.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,11 @@ def test_inspection_return_errors(self):
100100
},
101101
{
102102
'type': 'syntax',
103-
'message': '[{\'cmd\': \'echo <% ctx().macro %>\'}] is not of type \'object\'',
104-
'schema_path': 'properties.tasks.patternProperties.^\w+$.properties.input.type',
103+
'message': (
104+
'[{\'cmd\': \'echo <% ctx().macro %>\'}] is '
105+
'not valid under any of the given schemas'
106+
),
107+
'schema_path': 'properties.tasks.patternProperties.^\w+$.properties.input.oneOf',
105108
'spec_path': 'tasks.task2.input'
106109
}
107110
]

st2tests/integration/orquesta/test_wiring_error_handling.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,11 @@ def test_inspection_error(self):
5454
},
5555
{
5656
'type': 'syntax',
57-
'message': '[{\'cmd\': \'echo <% ctx().macro %>\'}] is not of type \'object\'',
58-
'schema_path': 'properties.tasks.patternProperties.^\w+$.properties.input.type',
57+
'message': (
58+
'[{\'cmd\': \'echo <% ctx().macro %>\'}] is '
59+
'not valid under any of the given schemas'
60+
),
61+
'schema_path': 'properties.tasks.patternProperties.^\w+$.properties.input.oneOf',
5962
'spec_path': 'tasks.task2.input'
6063
}
6164
]

0 commit comments

Comments
 (0)