summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2019-07-02 11:35:10 +0200
committerFabian Groffen <grobian@gentoo.org>2019-07-02 11:35:10 +0200
commitad69711ccdffa7081597a063b1709c7abfcb9929 (patch)
treec7666d9831f802fd76c43131e4a78d2847963dbc
parentscripts/auto-bootstraps/analyse_result: print snapshot tree in use (diff)
downloadprefix-ad69711ccdffa7081597a063b1709c7abfcb9929.tar.gz
prefix-ad69711ccdffa7081597a063b1709c7abfcb9929.tar.bz2
prefix-ad69711ccdffa7081597a063b1709c7abfcb9929.zip
scripts/auto-bootstraps/analyse_result: split out properties per run
success and failed runs aren't the same thing, so split out the tags for them (libressl and bootstrap snapshot) Signed-off-by: Fabian Groffen <grobian@gentoo.org>
-rwxr-xr-xscripts/auto-bootstraps/analyse_result.py98
1 files changed, 57 insertions, 41 deletions
diff --git a/scripts/auto-bootstraps/analyse_result.py b/scripts/auto-bootstraps/analyse_result.py
index b67e494bd7..2b0e04a101 100755
--- a/scripts/auto-bootstraps/analyse_result.py
+++ b/scripts/auto-bootstraps/analyse_result.py
@@ -116,40 +116,48 @@ with os.scandir(resultsdir) as it:
arch = f.name
fail, state, suc = analyse_arch(os.path.join(resultsdir, arch))
- elapsedtime = None
- haslssl = False
- snapshot = None
- if suc:
- elapsedf = os.path.join(resultsdir, arch, "%s" % suc, "elapsedtime")
+ infos = {}
+ for d in [ fail, suc ]:
+ elapsedtime = None
+ haslssl = False
+ snapshot = None
+
+ elapsedf = os.path.join(resultsdir, arch, "%s" % d, "elapsedtime")
if os.path.exists(elapsedf):
with open(elapsedf, 'rb') as f:
l = f.readline()
if l is not '':
elapsedtime = int(l)
- mconf = os.path.join(resultsdir, arch, "%s" % suc, "make.conf")
- if os.path.exists(mconf):
- with open(mconf, 'rb') as f:
- l = [x.decode('utf-8', 'ignore') for x in f.readlines()]
- l = list(filter(lambda x: 'USE=' in x, l))
- for x in l:
- if 'libressl' in x:
- haslssl = True
-
- mconf = os.path.join(resultsdir, arch, "%s" % suc, "stage1.log")
- if os.path.exists(mconf):
- with open(mconf, 'rb') as f:
- l = [x.decode('utf-8', 'ignore') for x in f.readlines()]
- for x in l:
- if 'Fetching ' in x:
- if 'portage-latest.tar.bz2' in x:
- snapshot = 'latest'
- elif 'prefix-overlay-' in x:
- snapshot = re.split('[-.]', x)[2]
- elif 'total size is' in x:
- snapshot = 'rsync'
-
- archs[arch] = (fail, state, suc, elapsedtime, haslssl, snapshot)
+ mconf = os.path.join(resultsdir, arch, "%s" % d, "make.conf")
+ if os.path.exists(mconf):
+ with open(mconf, 'rb') as f:
+ l = [x.decode('utf-8', 'ignore') for x in f.readlines()]
+ l = list(filter(lambda x: 'USE=' in x, l))
+ for x in l:
+ if 'libressl' in x:
+ haslssl = True
+
+ mconf = os.path.join(resultsdir, arch, "%s" % d, "stage1.log")
+ if os.path.exists(mconf):
+ with open(mconf, 'rb') as f:
+ l = [x.decode('utf-8', 'ignore') for x in f.readlines()]
+ for x in l:
+ if 'Fetching ' in x:
+ if 'portage-latest.tar.bz2' in x:
+ snapshot = 'latest'
+ elif 'prefix-overlay-' in x:
+ snapshot = re.split('[-.]', x)[2]
+ elif 'total size is' in x:
+ snapshot = 'rsync'
+
+ infos[d] = {
+ 'etime': elapsedtime,
+ 'libressl': haslssl,
+ 'snapshot': snapshot
+ }
+
+ archs[arch] = (fail, state, suc, infos)
if not suc:
color = '\033[1;31m' # red
elif fail and suc < fail:
@@ -161,6 +169,23 @@ with os.scandir(resultsdir) as it:
sarchs = sorted(archs, key=lambda a: '-'.join(a.split('-')[::-1]))
+def gentags(infos):
+ tags = ''
+ if infos.get('libressl', None):
+ tags = tags + '''
+<span style="border-radius: 5px; background-color: purple; color: white;
+display: inline-block; font-size: x-small; padding: 3px 4px; text-transform: uppercase !important;">libressl</span>
+'''
+
+ snap = infos.get('snapshot', None)
+ if snap:
+ tags = tags + '''
+<span style="border-radius: 5px; background-color: darkblue; color: white;
+display: inline-block; font-size: x-small; padding: 3px 4px; text-transform: uppercase !important;">''' + snap + '''</span>
+'''
+
+ return tags
+
# generate html edition
with open(os.path.join(resultsdir, 'index.html'), "w") as h:
h.write("<html>")
@@ -172,7 +197,7 @@ with open(os.path.join(resultsdir, 'index.html'), "w") as h:
h.write("<th>last successful run</th><th>last failed run</th>")
h.write("<th>failure</th>")
for arch in sarchs:
- fail, errcode, suc, et, lssl, snap = archs[arch]
+ fail, errcode, suc, infos = archs[arch]
if not suc:
state = 'red'
elif fail and suc < fail:
@@ -180,18 +205,6 @@ with open(os.path.join(resultsdir, 'index.html'), "w") as h:
else:
state = 'limegreen'
- tags = ''
- if lssl:
- tags = tags + '''
-<span style="border-radius: 5px; background-color: purple; color: white;
-display: inline-block; font-size: x-small; padding: 3px 4px; text-transform: uppercase !important;">libressl</span>
-'''
- if snap:
- tags = tags + '''
-<span style="border-radius: 5px; background-color: darkblue; color: white;
-display: inline-block; font-size: x-small; padding: 3px 4px; text-transform: uppercase !important;">''' + snap + '''</span>
-'''
-
h.write('<tr>')
h.write('<td bgcolor="%s" nowrap="nowrap">' % state)
@@ -200,7 +213,9 @@ display: inline-block; font-size: x-small; padding: 3px 4px; text-transform: upp
h.write("<td>")
if suc:
+ tags = gentags(infos[suc])
etxt = ''
+ et = infos[suc].get('elapsedtime', None)
if et:
if et > 86400:
etxt = ' (%.1f days)' % (et / 86400)
@@ -215,6 +230,7 @@ display: inline-block; font-size: x-small; padding: 3px 4px; text-transform: upp
h.write("<td>")
if fail:
+ tags = gentags(infos[fail])
h.write('<a href="%s/%s">%s</a>%s' % (arch, fail, fail, tags))
else:
h.write('<i>never</i>')