diff --git a/tasks/test_results_finisher.py b/tasks/test_results_finisher.py index 9555351b5..4ceea1c5a 100644 --- a/tasks/test_results_finisher.py +++ b/tasks/test_results_finisher.py @@ -58,9 +58,6 @@ def run_impl( impl_type: Literal["old", "new", "both"] = "old", **kwargs, ): - if impl_type == "both": - impl_type = "old" - repoid = int(repoid) self.extra_dict: dict[str, Any] = { @@ -115,7 +112,7 @@ def process_impl_within_lock( commitid: str, commit_yaml: UserYaml, chain_result: bool, - impl_type: Literal["old", "new"], + impl_type: Literal["old", "both", "new"], **kwargs, ) -> FinisherResult: log.info("Running test results finishers", extra=self.extra_dict) @@ -127,7 +124,9 @@ def process_impl_within_lock( assert commit, "commit not found" repo = commit.repository - return self.old_impl(db_session, repo, commit, chain_result, commit_yaml) + return self.old_impl( + db_session, repo, commit, chain_result, commit_yaml, impl_type + ) def old_impl( self, @@ -136,6 +135,7 @@ def old_impl( commit: Commit, chain_result: bool, commit_yaml: UserYaml, + impl_type: Literal["old", "both", "new"], ) -> FinisherResult: repoid = repo.repoid commitid = commit.commitid @@ -148,12 +148,17 @@ def old_impl( kwargs=dict( repo_id=repoid, commit_id=commit.commitid, + impl_type=impl_type, ) ) if commit.branch is not None: self.app.tasks[cache_test_rollups_task_name].apply_async( - kwargs=dict(repoid=repoid, branch=commit.branch), + kwargs=dict( + repoid=repoid, + branch=commit.branch, + impl_type=impl_type, + ), ) commit_report = commit.commit_report(ReportType.TEST_RESULTS) diff --git a/tasks/tests/unit/test_test_results_finisher.py b/tasks/tests/unit/test_test_results_finisher.py index 9b4d1b72d..5667fd675 100644 --- a/tasks/tests/unit/test_test_results_finisher.py +++ b/tasks/tests/unit/test_test_results_finisher.py @@ -366,6 +366,7 @@ def test_upload_finisher_task_call( repoid=repoid, commitid=commit.commitid, commit_yaml={"codecov": {"max_report_age": False}}, + impl_type="both", ) expected_result = { @@ -380,6 +381,7 @@ def test_upload_finisher_task_call( kwargs={ "repoid": repoid, "branch": "main", + "impl_type": "both", }, ) @@ -512,6 +514,7 @@ def test_upload_finisher_task_call_no_failures( kwargs={ "repoid": repoid, "branch": "main", + "impl_type": "old", }, ) @@ -610,6 +613,7 @@ def test_upload_finisher_task_call_no_success( kwargs={ "repoid": repoid, "branch": "main", + "impl_type": "old", }, ) @@ -680,6 +684,7 @@ def test_upload_finisher_task_call_upgrade_comment( kwargs={ "repoid": repoid, "branch": "main", + "impl_type": "old", }, ) @@ -723,6 +728,7 @@ def test_upload_finisher_task_call_existing_comment( kwargs={ "repoid": repoid, "branch": "main", + "impl_type": "old", }, ) @@ -845,6 +851,7 @@ def test_upload_finisher_task_call_comment_fails( kwargs={ "repoid": repoid, "branch": "main", + "impl_type": "old", }, ) @@ -922,6 +929,7 @@ def test_upload_finisher_task_call_with_flaky( kwargs={ "repoid": repoid, "branch": "main", + "impl_type": "old", }, ) @@ -1007,6 +1015,7 @@ def test_upload_finisher_task_call_main_branch( kwargs={ "repo_id": repoid, "commit_id": commit.commitid, + "impl_type": "old", }, ) test_results_mock_app.tasks[ @@ -1015,6 +1024,7 @@ def test_upload_finisher_task_call_main_branch( kwargs={ "repoid": repoid, "branch": "main", + "impl_type": "old", }, ) @@ -1188,6 +1198,7 @@ def test_upload_finisher_task_call_main_with_plan( kwargs={ "repo_id": repoid, "commit_id": commit.commitid, + "impl_type": "old", }, ) else: