From 4270acaba2c6d38c62ec6fc5a748a5168b5bc676 Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Tue, 21 Jan 2025 10:09:30 -0500 Subject: [PATCH 1/4] Commit prior to build report from raw content --- services/processing/processing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/processing/processing.py b/services/processing/processing.py index 5cba6e8ae..07d2e1a35 100644 --- a/services/processing/processing.py +++ b/services/processing/processing.py @@ -51,7 +51,7 @@ def process_upload( result = ProcessingResult( upload_id=upload_id, arguments=arguments, successful=False ) - + db_session.commit() try: report_info = RawReportInfo() processing_result = report_service.build_report_from_raw_content( From e8a4b37e795cef1faba3f2d122ca9ccb6a8a1e61 Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Tue, 21 Jan 2025 10:39:28 -0500 Subject: [PATCH 2/4] Commit prior to build report from raw content --- tasks/tests/unit/test_upload_task.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasks/tests/unit/test_upload_task.py b/tasks/tests/unit/test_upload_task.py index 94375c064..314a45182 100644 --- a/tasks/tests/unit/test_upload_task.py +++ b/tasks/tests/unit/test_upload_task.py @@ -683,6 +683,7 @@ def test_upload_task_upload_processing_delay_enough_delay( mocked_chord.assert_called_with([mocker.ANY, mocker.ANY], mocker.ANY) @pytest.mark.django_db(databases={"default"}, transaction=True) + @pytest.mark.skip(reason="Bitbucket down is breaking this test") def test_upload_task_upload_processing_delay_upload_is_none( self, mocker, @@ -691,6 +692,7 @@ def test_upload_task_upload_processing_delay_upload_is_none( mock_storage, celery_app, ): + mock_configuration.set_params({"setup": {"upload_processing_delay": 1000}}) mocker.patch.object(UploadTask, "app", celery_app) mocker.patch( From 51d3bf9d42fc9463c6e1c51cc204a182181f8d70 Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Tue, 21 Jan 2025 10:42:11 -0500 Subject: [PATCH 3/4] Lint --- tasks/tests/unit/test_upload_task.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tasks/tests/unit/test_upload_task.py b/tasks/tests/unit/test_upload_task.py index 314a45182..4eb7d862e 100644 --- a/tasks/tests/unit/test_upload_task.py +++ b/tasks/tests/unit/test_upload_task.py @@ -692,7 +692,6 @@ def test_upload_task_upload_processing_delay_upload_is_none( mock_storage, celery_app, ): - mock_configuration.set_params({"setup": {"upload_processing_delay": 1000}}) mocker.patch.object(UploadTask, "app", celery_app) mocker.patch( From b2b9d5d441674950eb8be4092e17e54924b84bdf Mon Sep 17 00:00:00 2001 From: trent-codecov Date: Tue, 21 Jan 2025 10:52:23 -0500 Subject: [PATCH 4/4] Reenable test when BB is back up --- tasks/tests/unit/test_upload_task.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tasks/tests/unit/test_upload_task.py b/tasks/tests/unit/test_upload_task.py index 4eb7d862e..94375c064 100644 --- a/tasks/tests/unit/test_upload_task.py +++ b/tasks/tests/unit/test_upload_task.py @@ -683,7 +683,6 @@ def test_upload_task_upload_processing_delay_enough_delay( mocked_chord.assert_called_with([mocker.ANY, mocker.ANY], mocker.ANY) @pytest.mark.django_db(databases={"default"}, transaction=True) - @pytest.mark.skip(reason="Bitbucket down is breaking this test") def test_upload_task_upload_processing_delay_upload_is_none( self, mocker,