diff --git a/config/stacks/metadataManager.ts b/config/stacks/metadataManager.ts index 360460186..6a75a0f7f 100644 --- a/config/stacks/metadataManager.ts +++ b/config/stacks/metadataManager.ts @@ -5,7 +5,7 @@ import { corsAllowOrigins, logsApiGatewayConfig, vpcProps, - eventBusName + eventBusName, } from '../constants'; import { MetadataManagerStackProps } from '../../lib/workload/stateless/stacks/metadata-manager/deploy/stack'; diff --git a/lib/workload/stateless/stacks/metadata-manager/Makefile b/lib/workload/stateless/stacks/metadata-manager/Makefile index e74d81833..10cb5fa4b 100644 --- a/lib/workload/stateless/stacks/metadata-manager/Makefile +++ b/lib/workload/stateless/stacks/metadata-manager/Makefile @@ -76,7 +76,7 @@ insert-data: @python manage.py insert_mock_data suite: - @python manage.py test + @python manage.py test --parallel # full mock suite test pipeline - install deps, bring up compose stack, run suite, bring down compose stack test: install up suite down diff --git a/lib/workload/stateless/stacks/metadata-manager/proc/tests/test_tracking_sheet_srv.py b/lib/workload/stateless/stacks/metadata-manager/proc/tests/test_tracking_sheet_srv.py index 6510e598e..a3ea9129f 100644 --- a/lib/workload/stateless/stacks/metadata-manager/proc/tests/test_tracking_sheet_srv.py +++ b/lib/workload/stateless/stacks/metadata-manager/proc/tests/test_tracking_sheet_srv.py @@ -1,12 +1,12 @@ import os -from unittest.mock import MagicMock -from typing import List - +import json import pandas as pd from libumccr.aws import libeb + +from unittest.mock import MagicMock from django.test import TestCase -from app.models import Library, Sample, Subject, Project, Contact, Individual +from app.models import Library, Sample, Subject, Project, Contact, Individual from proc.service.tracking_sheet_srv import sanitize_lab_metadata_df, persist_lab_metadata from .utils import check_put_event_entries_format, check_put_event_value, is_expected_event_in_output @@ -347,7 +347,7 @@ def test_eb_put_event(self) -> None: ) for event in expected_created_detail: self.assertTrue( - is_expected_event_in_output(self, expected=event, output=[i.get('Detail') for i in arg])) + is_expected_event_in_output(self, expected=event, output=[json.loads(i.get('Detail')) for i in arg])) """ Test if record are UPDATE and event entries are correct @@ -378,7 +378,8 @@ def test_eb_put_event(self) -> None: event_bus_name=TEST_EVENT_BUS_NAME ) for event in expected_update_detail: - self.assertTrue(is_expected_event_in_output(self, expected=event, output=[i.get('Detail') for i in arg])) + self.assertTrue( + is_expected_event_in_output(self, expected=event, output=[json.loads(i.get('Detail')) for i in arg])) """ Test if the record are DELETE and event entries are correct @@ -405,5 +406,5 @@ def test_eb_put_event(self) -> None: event_bus_name=TEST_EVENT_BUS_NAME ) for event in expected_delete_detail: - self.assertTrue(is_expected_event_in_output(self, expected=event, output=[i.get('Detail') for i in arg])) - + self.assertTrue( + is_expected_event_in_output(self, expected=event, output=[json.loads(i.get('Detail')) for i in arg]))