-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1784 from fractal-analytics-platform/1783-make-da…
…taset-history-validation-accept-workflowtasks-that-ran-with-legacy-tasks Fix v2.5.0 bug in DatasetRead response validation
- Loading branch information
Showing
3 changed files
with
70 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
from fractal_server.app.schemas.v2.dataset import _DatasetHistoryItemV2 | ||
from fractal_server.app.schemas.v2.workflowtask import WorkflowTaskStatusTypeV2 | ||
|
||
|
||
def test_issue_1783(): | ||
""" | ||
Given a dataset that was processed with legacy tasks from within V2 | ||
workflows, verify that the responds of its GET endpoint is valid. | ||
The differences | ||
""" | ||
|
||
wftask1 = dict( | ||
id=1, | ||
workflow_id=1, | ||
order=0, | ||
input_filters=dict(attributes=dict(), types=dict()), | ||
task_id=1, | ||
task=dict( | ||
id=1, | ||
name="name", | ||
type="parallel", | ||
source="source", | ||
input_types={}, | ||
output_types={}, | ||
), | ||
) | ||
history_item_1 = dict( | ||
workflowtask=wftask1, | ||
status=WorkflowTaskStatusTypeV2.FAILED, | ||
parallelization=dict(), | ||
) | ||
_DatasetHistoryItemV2(**history_item_1) | ||
|
||
wftask2 = dict( | ||
id=1, | ||
workflow_id=1, | ||
order=0, | ||
input_filters=dict(attributes=dict(), types=dict()), | ||
task_legacy_id=1, | ||
task_legacy=dict( | ||
id=1, | ||
input_type="image", | ||
output_type="zarr", | ||
command="echo", | ||
name="name", | ||
source="source", | ||
), | ||
) | ||
history_item_2 = dict( | ||
workflowtask=wftask2, | ||
status=WorkflowTaskStatusTypeV2.FAILED, | ||
parallelization=dict(), | ||
) | ||
_DatasetHistoryItemV2(**history_item_2) |