Skip to content
Snippets Groups Projects
Commit ce9dc31f authored by Nico Vermaas's avatar Nico Vermaas
Browse files

merge and deploy

parent dcb1085c
No related branches found
No related tags found
1 merge request!362merge and deploy
Pipeline #90413 passed
......@@ -189,17 +189,6 @@ def update_processed_and_aggregate(task):
if t.status != State.DISCARDED.value:
non_discarded_found = True
# only save when changed
if activity.is_processed != current_is_processed:
# if the whole activity has become processed, then set the status of this activity to 'AGGREGATE'
# unless it was already aggregated
if (activity.is_processed & non_discarded_found):
if not (activity.is_aggregated):
activity.status = State.AGGREGATE.value
activity.save()
if (task.workflow.aggregation_strategy == AggregationStrategy.COLLECT_H5.value):
# check if there is already a storage_location, if not, add it.
......@@ -227,6 +216,15 @@ def update_processed_and_aggregate(task):
activity.save()
# only save when changed
if activity.is_processed != current_is_processed:
# if the whole activity has become processed, then set the status of this activity to 'AGGREGATE'
# unless it was already aggregated
if (activity.is_processed & non_discarded_found):
if not (activity.is_aggregated):
activity.status = State.AGGREGATE.value
activity.save()
def update_is_verified(task):
"""
......
......@@ -97,6 +97,11 @@ class TestUpdateActivity(TestCase):
outputs={"inspect": {"location": "file:///project/ldv/Share/run/2023/3/26/331_30608/inspect.h5", "basename": "inspect.h5", "nameroot": "inspect"}})
self.task11.save()
self.task12 = Task.objects.create(sas_id=114,
new_status='processed',
workflow=self.workflow_imaging_compression)
self.task12.save()
def test_created_activity(self):
"""
test if activity is created
......@@ -217,3 +222,15 @@ class TestUpdateActivity(TestCase):
expected = "/project/ldv/Share/aggregate/113"
actual = self.task11.activity.storage_location
self.assertEqual(actual, expected)
def test_update_processed_and_aggregate(self):
# arrange
task = Task.objects.create(sas_id=114, new_status='processed', workflow=self.workflow_imaging_compression)
# act
task.save()
# assert
aggregation_tasks = Task.objects.filter(sas_id=114, task_type='aggregation')
self.assertEqual(len(aggregation_tasks),1)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment