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

handling stakeholder feedback

adding additional statusses
parent 931f4ccd
No related branches found
No related tags found
3 merge requests!333get all the new changes from master into the branch,!330still a bug,!328Solving Feature SDCP-239
Pipeline #68399 passed
...@@ -340,8 +340,7 @@ class Task(models.Model): ...@@ -340,8 +340,7 @@ class Task(models.Model):
except: except:
pass pass
incomplete = int(statusses['scrubbed']) + int(statusses['archiving']) \ incomplete = int(statusses['scrubbed']) + int(statusses['archiving']) + int(statusses['suspended']) \
+ int(statusses['suspended']) + int(statusses['discarded']) \
+ int(statusses['archived_failed']) + int(statusses['finished_failed']) + int(statusses['archived_failed']) + int(statusses['finished_failed'])
complete = int(statusses['archived']) + int(statusses['finished']) complete = int(statusses['archived']) + int(statusses['finished'])
completion = round(complete / (incomplete + complete) * 100) completion = round(complete / (incomplete + complete) * 100)
......
...@@ -16,7 +16,7 @@ class TestIngestFraction(TestCase): ...@@ -16,7 +16,7 @@ class TestIngestFraction(TestCase):
Task.objects.get_or_create(filter='a',sas_id=54321, status='archived', workflow=workflow_requantisation) Task.objects.get_or_create(filter='a',sas_id=54321, status='archived', workflow=workflow_requantisation)
Task.objects.get_or_create(filter='a',sas_id=54321, status='finished', workflow=workflow_requantisation) Task.objects.get_or_create(filter='a',sas_id=54321, status='finished', workflow=workflow_requantisation)
Task.objects.get_or_create(filter='b',sas_id=54321, status='finished', workflow=workflow_requantisation) Task.objects.get_or_create(filter='b',sas_id=54321, status='finished', workflow=workflow_requantisation)
Task.objects.get_or_create(filter='b', sas_id=54321, status='discarded', workflow=workflow_requantisation)
def test_ingest_fraction(self): def test_ingest_fraction(self):
# collapse all tasks into a single task for this sas_id # collapse all tasks into a single task for this sas_id
...@@ -26,5 +26,5 @@ class TestIngestFraction(TestCase): ...@@ -26,5 +26,5 @@ class TestIngestFraction(TestCase):
statusses = task.sasid_ingested_fraction['status'] statusses = task.sasid_ingested_fraction['status']
completion = task.sasid_ingested_fraction['completion'] completion = task.sasid_ingested_fraction['completion']
self.assertEqual(statusses, {'scrubbed': 2, 'archiving': 1, 'archived': 1, 'finished': 2}) self.assertEqual(statusses, {'scrubbed': 2, 'archiving': 1, 'archived': 1, 'finished': 2, 'discarded': 1})
self.assertEqual(completion,50) self.assertEqual(completion,50)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment