File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
packit_service/worker/helpers/build Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -249,3 +249,9 @@ def cancel_running_builds(self) -> None:
249249 logger .debug (f"Cancelling Koji task { build .task_id } " )
250250 koji_helper .cancel_task (int (build .task_id ))
251251 build .set_status (BuildStatus .canceled )
252+ self .report_status_to_build_for_chroot (
253+ state = BaseCommitStatus .canceled ,
254+ description = "Build was canceled." ,
255+ url = get_koji_build_info_url (build .id ),
256+ chroot = build .target ,
257+ )
Original file line number Diff line number Diff line change @@ -606,9 +606,9 @@ def test_get_koji_rpm_build_web_url(id_, result):
606606
607607
608608def test_cancel_running_builds ():
609- build1 = flexmock (task_id = "111" )
610- build2 = flexmock (task_id = "222" )
611- build3 = flexmock (task_id = None ) # no task_id yet
609+ build1 = flexmock (task_id = "111" , id = 1 , target = "f41" )
610+ build2 = flexmock (task_id = "222" , id = 2 , target = "f42" )
611+ build3 = flexmock (task_id = None , id = 3 , target = "rawhide" ) # no task_id yet
612612
613613 build1 .should_receive ("set_status" ).with_args (BuildStatus .canceled ).once ()
614614 build2 .should_receive ("set_status" ).with_args (BuildStatus .canceled ).once ()
@@ -618,6 +618,7 @@ def test_cancel_running_builds():
618618 flexmock (KojiHelper ).should_receive ("cancel_task" ).with_args (222 ).once ()
619619
620620 helper = flexmock (get_running_jobs = lambda : [build1 , build2 , build3 ])
621+ helper .should_receive ("report_status_to_build_for_chroot" ).times (3 )
621622
622623 # Call the real method with our mock as self
623624 KojiBuildJobHelper .cancel_running_builds (helper )
You can’t perform that action at this time.
0 commit comments