Skip to content

Commit

Permalink
Cosmetic fixes to make the tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
foursixnine committed Jan 31, 2024
1 parent 5622827 commit 8f2a737
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion openqabot/loader/repohash.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_max_revision(
) -> int:
max_rev = 0

url_base = f"http://download.suse.de/ibs/{project.replace(':',':/')}"
url_base = f"http://download.suse.de/ibs/{project.replace(':', ':/')}"

for repo in repos:
# openSUSE and SLE incidents have different handling of architecture
Expand Down
14 changes: 9 additions & 5 deletions openqabot/types/incident.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,9 @@ def has_failures(self, token) -> bool:
if failed_jobs:
log.info("Found %s failed jobs for incident %s:", len(failed_jobs), self.id)
if log.isEnabledFor(LOG_DEBUG_LEVEL):
log_debug = lambda job_id: log.debug(
"Job %s is not marked as acceptable for incident %s",
job_id,
self.id,
list(
map(lambda job: self.log_debug_incident(job["job_id"]), failed_jobs)
)
[log_debug(res["job_id"]) for res in failed_jobs]

if not results:
raise NoResultsError(
Expand All @@ -172,3 +169,10 @@ def has_failures(self, token) -> bool:

# we only need to check if there are any failed jobs
return any(failed_jobs)

def log_debug_incident(self, job_id):
log.debug(
"Job %s is not marked as acceptable for incident %s",
job_id,
self.id,
)
1 change: 1 addition & 0 deletions openqabot/types/incidents.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def _is_scheduled_job(

return False

# pylint: disable=too-many-return-statements
def _handle_incident(
self,
inc: Incident,
Expand Down

0 comments on commit 8f2a737

Please sign in to comment.