-
Notifications
You must be signed in to change notification settings - Fork 56
Description
What happened? What is the problem?
Lets have multiple build jobs for different targets defined in the .packit.yaml and a test job defined for the later target - for example:
jobs:
- job: copr_build
trigger: pull_request
targets:
- epel-9
- epel-10
- job: copr_build
trigger: pull_request
targets:
- fedora-all
- job: tests
trigger: pull_request
targets:
- fedora-all
Testing job in this case will fail with error No build defined for the target 'fedora-41-x86_64'. This is because before the testing farm request is sent, packit tests whether build job is configured for the same target. Crucial part of this check is the job_build property of BaseBuildJobHelper:
packit-service/packit_service/worker/helpers/build/build_helper.py
Lines 141 to 153 in d99b36d
| def job_build(self) -> Optional[JobConfig]: | |
| """ | |
| Check if there is JobConfig for builds defined | |
| :return: JobConfig or None | |
| """ | |
| if not self.job_type_build: | |
| return None | |
| if not self._job_build: | |
| for job in [self.job_config, *self.package_config.jobs]: | |
| if job.type == self.job_type_build and self.is_job_config_trigger_matching(job): | |
| self._job_build = job | |
| break | |
| return self._job_build |
which returns the first configured build job regardless its targets (in this case the build job has epel targets, but the tests require fedora).
Workaround is to merge the build jobs into one.
Created based on #2859 issue report.
What did you expect to happen?
Tests are correctly run.
Example URL(s)
No response
Steps to reproduce
What is the impacted category (job)?
Testing Farm tests
Workaround
- There is an existing workaround that can be used until this issue is fixed.
Participation
- I am willing to submit a pull request for this issue. (Packit team is happy to help!)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status