Skip to content

Commit

Permalink
copr_reporter: Make Skipped -> Failed not displayed as a regression
Browse files Browse the repository at this point in the history
  • Loading branch information
tstellar committed May 10, 2023
1 parent 45f7c1d commit ed769bc
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions copr-reporter/html_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,27 @@ def get_combined_build_state(chroots):
continue
return 'failed' if not state else state


def get_state_change(chroots_a, chroots_b):
chroots = set(chroots_a.keys()) | set(chroots_b.keys())
state = "Same results"
for c in chroots:
if c not in chroots_a or c not in chroots_b:
continue
chroot_a = chroots_a[c]
chroot_b = chroots_b[c]

if chroot_a['state'] == 'succeeded' and chroot_b['state'] == 'failed':
return 'Regression'
if chroot_a['state'] == 'failed' and chroot_b['state'] == 'succeeded':
state = "Fixed"
continue
if chroot_a['state'] != chroot_b['state']:
state = "Something has changed. You should verify the builds"
continue
return state


if __name__ == '__main__':
title = "Clang Mass Rebuild TODO dashboard"
packages = {}
Expand All @@ -54,13 +75,7 @@ def get_combined_build_state(chroots):
packages[k]['changed'] = 'Same results'
state_a = get_combined_build_state(packages[k]['builds_a']['chroots'])
state_b = get_combined_build_state(packages[k]['builds_b']['chroots'])
if state_a == 'succeeded' and state_b == 'failed':
packages[k]['changed'] = "Regression"
elif state_a == 'failed' and state_b == 'succeeded':
packages[k]['changed'] = "Fixed"
elif state_a != state_b:
packages[k]['changed'] = "Something has changed. You should verify the builds"

packages[k]['changed'] = get_state_change(packages[k]['builds_a']['chroots'], packages[k]['builds_b']['chroots'])
description = f"""
Explanation of the columns:<ul>
<li>Name: The name of the package.</li>
Expand Down

0 comments on commit ed769bc

Please sign in to comment.