Skip to content

Commit

Permalink
Get the build id from the event.
Browse files Browse the repository at this point in the history
The SRPMBuildModel, unlike the CoprBuildModel,
 has not a build id associated.
Take the build id  from the event.
  • Loading branch information
majamassarini committed Aug 24, 2023
1 parent dd3b050 commit a396b3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packit_service/worker/checker/copr.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def pre_check(self) -> bool:
return True

logger.debug(
f"The Copr build {self.build.build_id} (pkg={build_for_package}) "
f"The Copr build {self.copr_event.build_id} (pkg={build_for_package}) "
f"does not match the package from the configuration "
f"({self.job_config.package})."
)
Expand Down
7 changes: 6 additions & 1 deletion tests/unit/test_checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
)
from packit_service.worker.events import (
PullRequestGithubEvent,
AbstractCoprBuildEvent,
)
from packit_service.worker.events.event import EventData
from packit_service.worker.events.github import (
Expand Down Expand Up @@ -363,13 +364,17 @@ def test_copr_build_is_package_matching_job_view():
)
]

flexmock(AbstractCoprBuildEvent).should_receive("from_event_dict").and_return(
flexmock(build_id=123)
)

checker = IsPackageMatchingJobView(
flexmock(),
jobs[0],
{"pkg": "package"},
)
checker._build = (
flexmock(build_id=123)
flexmock()
.should_receive("get_package_name")
.and_return("package-b")
.once()
Expand Down

0 comments on commit a396b3c

Please sign in to comment.