Skip to content

edge_orchestrator CI on branch >> 50/merge << #321

edge_orchestrator CI on branch >> 50/merge <<

edge_orchestrator CI on branch >> 50/merge << #321

GitHub Actions / Integration tests report in Python 3.9 failed Apr 17, 2024 in 0s

10 passed, 4 failed and 0 skipped

Tests failed

❌ edge_orchestrator/reports/pytest/integration-tests-report.xml

14 tests were completed in 27s with 10 passed, 4 failed and 0 skipped.

Test suite Passed Failed Skipped Time
pytest 10✅ 4❌ 27s

❌ pytest

tests.integration_tests.application.test_server.TestServer
  ✅ test_upload_route__should_return_expected_logs_when_received_paylod_with_binary_image
  ❌ test_get_item_metadata__should_return_expected_paylod_when_received_specific_item_id
	self = <test_server.TestServer object at 0x7f4fe98aa2e0>
tests.integration_tests.infrastructure.metadata_storage.test_mongodb_metadata_storage.TestMongoDbItemStorage
  ❌ test_save_item_metadata_should_write_item_metadata_in_mongo_db
	self = <test_mongodb_metadata_storage.TestMongoDbItemStorage object at 0x7f4fe9837430>
  ❌ test_get_item_metadata_should_return_requested_item_metadata
	self = <test_mongodb_metadata_storage.TestMongoDbItemStorage object at 0x7f4fe9837fa0>
  ❌ test_get_all_items_metadata_should_return_all_items
	self = <test_mongodb_metadata_storage.TestMongoDbItemStorage object at 0x7f4fe9837e80>
tests.integration_tests.infrastructure.model_forward.test_tf_serving_detection_wrapper.TestTFServingDetectionWrapper
  ✅ test_perform_inference_should_detected_a_cat[mobilenet_v1_640x640]
  ✅ test_perform_inference_should_detected_a_cat_and_a_dog[mobilenet_v1_640x640]
tests.integration_tests.infrastructure.model_forward.test_tflite_serving_detection_wrapper.TestTFServingDetectionWrapper
  ✅ test_perform_inference_should_detect_a_bear[mobilenet_ssd_v2_coco]
  ✅ test_perform_inference_should_detect_a_cat_and_a_dog[mobilenet_ssd_v2_coco]
  ✅ test_perform_with_yolo_inference_should_detect_a_giraffe_zebra_and_elephant[yolo_coco_nano]
tests.integration_tests.infrastructure.station_config.test_json_station_config.TestJsonStationConfig
  ✅ test_get_models_for_camera_should_return_one_model_infos_when_camera_config_has_one_model
  ✅ test_get_models_for_camera_should_return_two_model_infos_when_camera_config_has_two_models
tests.integration_tests.infrastructure.telemetry_sink.test_postgresql_telemetry_sink.TestPostgresTelemetrySink
  ✅ test_insert_and_select_query_given_one_telemetry_message
  ✅ test_timeout_error_should_be_raised_with_no_postgresql_db

Annotations

Check failure on line 0 in edge_orchestrator/reports/pytest/integration-tests-report.xml

See this annotation in the file changed.

@github-actions github-actions / Integration tests report in Python 3.9

pytest ► tests.integration_tests.application.test_server.TestServer ► test_get_item_metadata__should_return_expected_paylod_when_received_specific_item_id

Failed test found in:
  edge_orchestrator/reports/pytest/integration-tests-report.xml
Error:
  self = <test_server.TestServer object at 0x7f4fe98aa2e0>
Raw output
self = <test_server.TestServer object at 0x7f4fe98aa2e0>
my_item_0 = <edge_orchestrator.domain.models.item.Item object at 0x7f4fe894cb50>
caplog = <_pytest.logging.LogCaptureFixture object at 0x7f4fe7686700>

    def test_get_item_metadata__should_return_expected_paylod_when_received_specific_item_id(self, my_item_0, caplog):
        # Given
        metadata_storage = get_metadata_storage()
        metadata_storage.save_item_metadata(my_item_0)
        client = TestClient(server())
        test_item_id = my_item_0.id
        keys_expected = [
            "serial_number",
            "category",
            "station_config",
            "cameras",
            "received_time",
            "inferences",
            "decision",
            "state",
            "error",
            "id",
        ]
    
        # When
        actual_response = client.get(f"/api/v1/items/{test_item_id}")
    
        # Then
        assert actual_response.status_code == 200
        json_response = json.loads(actual_response.text)
>       assert len(json_response) == 10
E       AssertionError: assert 11 == 10
E        +  where 11 = len({'cameras': {'camera_1': {'brightness': 100, 'exposition': 100, 'position': 'right'}, 'camera_2': {'brightness': 100, 'exposition': 100, 'position': 'left'}}, 'category': 'tacos', 'decision': {}, 'dimensions': [100, 100], ...})

tests/integration_tests/application/test_server.py:64: AssertionError

Check failure on line 0 in edge_orchestrator/reports/pytest/integration-tests-report.xml

See this annotation in the file changed.

@github-actions github-actions / Integration tests report in Python 3.9

pytest ► tests.integration_tests.infrastructure.metadata_storage.test_mongodb_metadata_storage.TestMongoDbItemStorage ► test_save_item_metadata_should_write_item_metadata_in_mongo_db

Failed test found in:
  edge_orchestrator/reports/pytest/integration-tests-report.xml
Error:
  self = <test_mongodb_metadata_storage.TestMongoDbItemStorage object at 0x7f4fe9837430>
Raw output
self = <test_mongodb_metadata_storage.TestMongoDbItemStorage object at 0x7f4fe9837430>
test_mongo_db_uri = 'mongodb://localhost:27017'
my_item_0 = <edge_orchestrator.domain.models.item.Item object at 0x7f4fe77b7d00>

    def test_save_item_metadata_should_write_item_metadata_in_mongo_db(self, test_mongo_db_uri, my_item_0):
        # Given
        metadata_storage = MongoDbMetadataStorage(mongodb_uri=test_mongo_db_uri)
        my_item_0.id = "d1adfc08-cb98-46d6-ae9c-b07c5d16a2ec"
    
        # When
        metadata_storage.save_item_metadata(my_item_0)
    
        # Then
        all_items_metadata = [item for item in metadata_storage.items_metadata.find()]
>       assert all_items_metadata == [
            {
                "_id": "d1adfc08-cb98-46d6-ae9c-b07c5d16a2ec",
                "serial_number": "123",
                "category": "tacos",
                "station_config": None,
                "cameras": {
                    "camera_1": {
                        "brightness": 100,
                        "exposition": 100,
                        "position": "right",
                    },
                    "camera_2": {
                        "brightness": 100,
                        "exposition": 100,
                        "position": "left",
                    },
                },
                "received_time": "2021-05-19 15:00:00",
                "inferences": {},
                "decision": {},
                "state": None,
                "error": None,
            }
        ]
E       AssertionError: assert [{'_id': 'd1a...on': {}, ...}] == [{'_id': 'd1a...on': {}, ...}]
E         At index 0 diff: {'_id': 'd1adfc08-cb98-46d6-ae9c-b07c5d16a2ec', 'cameras': {'camera_1': {'brightness': 100, 'exposition': 100, 'position': 'right'}, 'camera_2': {'brightness': 100, 'exposition': 100, 'position': 'left'}}, 'category': 'tacos', 'decision': {}, 'dimensions': [100, 100], 'error': None, 'inferences': {}, 'received_time': '2021-05-19 15:00:00', 'serial_number': '123', 'state': None, 'station_config': None} != {'_id': 'd1adfc08-cb98-46d6-ae9c-b07c5d16a2ec', 'serial_number': '123', 'category': 'tacos', 'station_config': None, 'cameras': {'camera_1': {'brightness': 100, 'exposition': 100, 'position': 'right'}, 'camera_2': {'brightness': 100, 'exposition': 100, 'position': 'left'}}, 'received_time': '2021-05-19 15:00:00', 'inferences': {}, 'decision': {}, 'state': None, 'error': None}
E         Full diff:
E           [
E            {'_id': 'd1adfc08-cb98-46d6-ae9c-b07c5d16a2ec',
E             'cameras': {'camera_1': {'brightness': 100,
E                                      'exposition': 100,
E                                      'position': 'right'},
E                         'camera_2': {'brightness': 100,
E                                      'exposition': 100,
E                                      'position': 'left'}},
E             'category': 'tacos',
E             'decision': {},
E         +   'dimensions': [100,
E         +                  100],
E             'error': None,
E             'inferences': {},
E             'received_time': '2021-05-19 15:00:00',
E             'serial_number': '123',
E             'state': None,
E             'station_config': None},
E           ]

tests/integration_tests/infrastructure/metadata_storage/test_mongodb_metadata_storage.py:17: AssertionError

Check failure on line 0 in edge_orchestrator/reports/pytest/integration-tests-report.xml

See this annotation in the file changed.

@github-actions github-actions / Integration tests report in Python 3.9

pytest ► tests.integration_tests.infrastructure.metadata_storage.test_mongodb_metadata_storage.TestMongoDbItemStorage ► test_get_item_metadata_should_return_requested_item_metadata

Failed test found in:
  edge_orchestrator/reports/pytest/integration-tests-report.xml
Error:
  self = <test_mongodb_metadata_storage.TestMongoDbItemStorage object at 0x7f4fe9837fa0>
Raw output
self = <test_mongodb_metadata_storage.TestMongoDbItemStorage object at 0x7f4fe9837fa0>
test_mongo_db_uri = 'mongodb://localhost:27017'
my_item_0 = <edge_orchestrator.domain.models.item.Item object at 0x7f4fe55ae130>

    def test_get_item_metadata_should_return_requested_item_metadata(self, test_mongo_db_uri, my_item_0):
        # Given
        my_item_0.id = "d1adfc08-cb98-46d6-ae9c-b07c5d16a2ec"
        metadata_storage = MongoDbMetadataStorage(mongodb_uri=test_mongo_db_uri)
        metadata_storage.items_metadata.update_one(
            {"_id": my_item_0.id}, {"$set": my_item_0.get_metadata(False)}, upsert=True
        )
    
        # When
        item_metadata = metadata_storage.get_item_metadata(my_item_0.id)
    
        # Then
>       assert item_metadata == {
            "id": "d1adfc08-cb98-46d6-ae9c-b07c5d16a2ec",
            "serial_number": "123",
            "category": "tacos",
            "station_config": None,
            "cameras": {
                "camera_1": {"brightness": 100, "exposition": 100, "position": "right"},
                "camera_2": {"brightness": 100, "exposition": 100, "position": "left"},
            },
            "received_time": "2021-05-19 15:00:00",
            "inferences": {},
            "decision": {},
            "state": None,
            "error": None,
        }
E       AssertionError: assert {'cameras': {...00, 100], ...} == {'cameras': {...r': None, ...}
E         Omitting 10 identical items, use -vv to show
E         Left contains 1 more item:
E         {'dimensions': [100, 100]}
E         Full diff:
E           {
E            'cameras': {'camera_1': {'brightness': 100,
E                                     'exposition': 100,
E                                     'position': 'right'},
E                        'camera_2': {'brightness': 100,
E                                     'exposition': 100,
E                                     'position': 'left'}},
E            'category': 'tacos',
E            'decision': {},
E         +  'dimensions': [100,
E         +                 100],
E            'error': None,
E            'id': 'd1adfc08-cb98-46d6-ae9c-b07c5d16a2ec',
E            'inferences': {},
E            'received_time': '2021-05-19 15:00:00',
E            'serial_number': '123',
E            'state': None,
E            'station_config': None,
E           }

tests/integration_tests/infrastructure/metadata_storage/test_mongodb_metadata_storage.py:55: AssertionError

Check failure on line 0 in edge_orchestrator/reports/pytest/integration-tests-report.xml

See this annotation in the file changed.

@github-actions github-actions / Integration tests report in Python 3.9

pytest ► tests.integration_tests.infrastructure.metadata_storage.test_mongodb_metadata_storage.TestMongoDbItemStorage ► test_get_all_items_metadata_should_return_all_items

Failed test found in:
  edge_orchestrator/reports/pytest/integration-tests-report.xml
Error:
  self = <test_mongodb_metadata_storage.TestMongoDbItemStorage object at 0x7f4fe9837e80>
Raw output
self = <test_mongodb_metadata_storage.TestMongoDbItemStorage object at 0x7f4fe9837e80>
test_mongo_db_uri = 'mongodb://localhost:27017'
my_item_0 = <edge_orchestrator.domain.models.item.Item object at 0x7f4fe5576520>
my_item_2 = <edge_orchestrator.domain.models.item.Item object at 0x7f4fe558d100>

    def test_get_all_items_metadata_should_return_all_items(self, test_mongo_db_uri, my_item_0, my_item_2):
        # Given
        my_item_0.id = "d1adfc08-cb98-46d6-ae9c-b07c5d16a2ec"
        my_item_2.id = "af6b4922-8e4a-4dbc-ac9b-b5fd56ceaf25"
        metadata_storage = MongoDbMetadataStorage(mongodb_uri=test_mongo_db_uri)
        metadata_storage.items_metadata.update_one(
            {"_id": my_item_0.id}, {"$set": my_item_0.get_metadata(False)}, upsert=True
        )
        metadata_storage.items_metadata.update_one(
            {"_id": my_item_2.id}, {"$set": my_item_2.get_metadata(False)}, upsert=True
        )
    
        # When
        item_metadata = metadata_storage.get_all_items_metadata()
    
        # Then
>       assert item_metadata == [
            {
                "id": "d1adfc08-cb98-46d6-ae9c-b07c5d16a2ec",
                "serial_number": "123",
                "category": "tacos",
                "station_config": None,
                "cameras": {
                    "camera_1": {
                        "brightness": 100,
                        "exposition": 100,
                        "position": "right",
                    },
                    "camera_2": {
                        "brightness": 100,
                        "exposition": 100,
                        "position": "left",
                    },
                },
                "received_time": "2021-05-19 15:00:00",
                "inferences": {},
                "decision": {},
                "state": None,
                "error": None,
            },
            {
                "id": "af6b4922-8e4a-4dbc-ac9b-b5fd56ceaf25",
                "serial_number": "123",
                "category": "tacos",
                "station_config": None,
                "cameras": {
                    "camera_3": {
                        "brightness": 100,
                        "exposition": 100,
                        "position": "top",
                    }
                },
                "received_time": "2021-05-19 15:00:00",
                "inferences": {},
                "decision": {},
                "state": None,
                "error": None,
            },
        ]
E       AssertionError: assert [{'cameras': ...0, 100], ...}] == [{'cameras': ...': None, ...}]
E         At index 0 diff: {'cameras': {'camera_1': {'brightness': 100, 'exposition': 100, 'position': 'right'}, 'camera_2': {'brightness': 100, 'exposition': 100, 'position': 'left'}}, 'category': 'tacos', 'decision': {}, 'dimensions': [100, 100], 'error': None, 'inferences': {}, 'received_time': '2021-05-19 15:00:00', 'serial_number': '123', 'state': None, 'station_config': None, 'id': 'd1adfc08-cb98-46d6-ae9c-b07c5d16a2ec'} != {'id': 'd1adfc08-cb98-46d6-ae9c-b07c5d16a2ec', 'serial_number': '123', 'category': 'tacos', 'station_config': None, 'cameras': {'camera_1': {'brightness': 100, 'exposition': 100, 'position': 'right'}, 'camera_2': {'brightness': 100, 'exposition': 100, 'position': 'left'}}, 'received_time': '2021-05-19 15:00:00', 'inferences': {}, 'decision': {}, 'state': None, 'error': None}
E         Full diff:
E           [
E            {'cameras': {'camera_1': {'brightness': 100,
E                                      'exposition': 100,
E                                      'position': 'right'},
E                         'camera_2': {'brightness': 100,
E                                      'exposition': 100,
E                                      'position': 'left'}},
E             'category': 'tacos',
E             'decision': {},
E         +   'dimensions': [100,
E         +                  100],
E             'error': None,
E             'id': 'd1adfc08-cb98-46d6-ae9c-b07c5d16a2ec',
E             'inferences': {},
E             'received_time': '2021-05-19 15:00:00',
E             'serial_number': '123',
E             'state': None,
E             'station_config': None},
E            {'cameras': {'camera_3': {'brightness': 100,
E                                      'exposition': 100,
E                                      'position': 'top'}},
E             'category': 'tacos',
E             'decision': {},
E         +   'dimensions': [100,
E         +                  100],
E             'error': None,
E             'id': 'af6b4922-8e4a-4dbc-ac9b-b5fd56ceaf25',
E             'inferences': {},
E             'received_time': '2021-05-19 15:00:00',
E             'serial_number': '123',
E             'state': None,
E             'station_config': None},
E           ]

tests/integration_tests/infrastructure/metadata_storage/test_mongodb_metadata_storage.py:87: AssertionError