Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions tasks/test_results_finisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {
Expand Down Expand Up @@ -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)
Expand All @@ -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,
Expand All @@ -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
Expand All @@ -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)
Expand Down
11 changes: 11 additions & 0 deletions tasks/tests/unit/test_test_results_finisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -380,6 +381,7 @@ def test_upload_finisher_task_call(
kwargs={
"repoid": repoid,
"branch": "main",
"impl_type": "both",
},
)

Expand Down Expand Up @@ -512,6 +514,7 @@ def test_upload_finisher_task_call_no_failures(
kwargs={
"repoid": repoid,
"branch": "main",
"impl_type": "old",
},
)

Expand Down Expand Up @@ -610,6 +613,7 @@ def test_upload_finisher_task_call_no_success(
kwargs={
"repoid": repoid,
"branch": "main",
"impl_type": "old",
},
)

Expand Down Expand Up @@ -680,6 +684,7 @@ def test_upload_finisher_task_call_upgrade_comment(
kwargs={
"repoid": repoid,
"branch": "main",
"impl_type": "old",
},
)

Expand Down Expand Up @@ -723,6 +728,7 @@ def test_upload_finisher_task_call_existing_comment(
kwargs={
"repoid": repoid,
"branch": "main",
"impl_type": "old",
},
)

Expand Down Expand Up @@ -845,6 +851,7 @@ def test_upload_finisher_task_call_comment_fails(
kwargs={
"repoid": repoid,
"branch": "main",
"impl_type": "old",
},
)

Expand Down Expand Up @@ -922,6 +929,7 @@ def test_upload_finisher_task_call_with_flaky(
kwargs={
"repoid": repoid,
"branch": "main",
"impl_type": "old",
},
)

Expand Down Expand Up @@ -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[
Expand All @@ -1015,6 +1024,7 @@ def test_upload_finisher_task_call_main_branch(
kwargs={
"repoid": repoid,
"branch": "main",
"impl_type": "old",
},
)

Expand Down Expand Up @@ -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:
Expand Down
Loading