From 93139705cc85ec8e366b087ed87e13ca99e500a1 Mon Sep 17 00:00:00 2001 From: Kamil Páral Date: Nov 01 2017 12:26:01 +0000 Subject: [PATCH 1/2] save execution time in extra args instead note Note is very visible for the end user and execution time is distracting and not useful for them. Save it in extra args. As an added benefit, it can be used to query results, and it can be easily processed (retrieve results and then sort them by execution time) without parsing. --- diff --git a/run_abipkgdiff.py b/run_abipkgdiff.py index b1f26a6..922650c 100755 --- a/run_abipkgdiff.py +++ b/run_abipkgdiff.py @@ -1,6 +1,7 @@ import os import subprocess import time +import math from rpmUtils.miscutils import splitFilename from libtaskotron import check @@ -28,7 +29,7 @@ def run_abipkgdiff(koji_build, stable_rpmsdir, update_rpmsdir, else: detail.output.append("ABI changes report summary for package update id %s" " against latest stable package in koji\n" % koji_build) - + padding = str('=' * 103) detail.output.append("%s\n\n" % padding) for arch in arches: @@ -39,7 +40,7 @@ def run_abipkgdiff(koji_build, stable_rpmsdir, update_rpmsdir, log_file.writelines(detail.output) detail.artifact = log_path time_taken = time.time() - process_start_time - detail.note = "Time taken: " "%s" %(formatted_time(time_taken)) + detail.keyvals['seconds_taken'] = int(math.ceil(time_taken)) resultyaml = check.export_YAML(detail) return resultyaml From f882c6bc2d1c216fe79aed290bf8a6bc9a6e3488 Mon Sep 17 00:00:00 2001 From: Kamil Páral Date: Nov 01 2017 12:27:37 +0000 Subject: [PATCH 2/2] typo fix --- diff --git a/run_abipkgdiff.py b/run_abipkgdiff.py index 922650c..2edfd23 100755 --- a/run_abipkgdiff.py +++ b/run_abipkgdiff.py @@ -24,7 +24,7 @@ def run_abipkgdiff(koji_build, stable_rpmsdir, update_rpmsdir, # If no arch specific packages are avilable set ABI result as PASSED if ((len(os.listdir(stable_rpmsdir)) == 0) and (len(os.listdir( update_rpmsdir)) == 0)): - detail.output.append("No architetcure specific packages are available\n"); + detail.output.append("No architecture specific packages are available\n"); detail.update_outcome("PASSED") else: detail.output.append("ABI changes report summary for package update id %s"