Commit 17f5af0a authored by Tomi Sarvela's avatar Tomi Sarvela

Make heatmap smaller by filtering out errorless tests

parent 6d9866a9
......@@ -125,6 +125,14 @@ if __name__ == "__main__":
if res in ['pass', 'skip']: continue
errors[(host,testname)]+=1
# Filter out the heatmap lines without errors
for test in tests[:]:
for host in hosts:
try:
if errors[(host,test)]: break
except: pass
else: tests.remove(test)
  • TIL: https://book.pythontips.com/en/latest/for_-_else.html#else-clause
    Cc: @adrinael

    Why not something that is more common and reads well even if you are not looking for elements? E.g.:

    for test in tests.copy():
        if not any((error.get((host,test), None) for host in hosts)):
            tests.remove(test)
    Edited by Arkadiusz Hiler
Please register or sign in to reply
with open(args.output+"heatmap.html", 'w') as f:
try:
page = template.render(path=relpath, tests=tests, hosts=hosts, errors=errors, totals=totals, title="Heatmap")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment