summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPoornima G <pgurusid@redhat.com>2016-07-12 19:46:57 +0530
committerJeff Darcy <jdarcy@redhat.com>2016-07-21 05:02:11 -0700
commitff49529be352c1d491f22cf0261665e6313beee2 (patch)
treed37b08ae3f551436b9184862d8358f7aece01bd0
parentec72746af0ee94c7b9b96fa7685490b02583f393 (diff)
extras: fix failed_tests.py to work
The text in the regression console output, now has the following prepended: "<span class="timestamp"><b>08:27:48</b> </span>" with every line. Hence changing all the instances where the entire line was compared, to find the pattern in the line. Also, another usability change to take centos/netbsd as an argument instead of the regression link. Change-Id: I1648ab90fa6d34bb8b82a0a33401c5a2ecb86426 Signed-off-by: Poornima G <pgurusid@redhat.com> Reviewed-on: http://review.gluster.org/14914 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Prashanth Pai <ppai@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
-rwxr-xr-xextras/failed-tests.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/extras/failed-tests.py b/extras/failed-tests.py
index 11dcb0ccea8..d2aeb7651c2 100755
--- a/extras/failed-tests.py
+++ b/extras/failed-tests.py
@@ -4,6 +4,7 @@ import blessings
import HTMLParser
import requests
import sys
+import re
from collections import defaultdict
from datetime import date, timedelta, datetime
from dateutil.parser import parse
@@ -35,14 +36,16 @@ def process_failure (url, cut_off_date):
build_date = parse (t, fuzzy=True)
if build_date.date() < cut_off_date:
return 1
- elif t == 'Result: FAIL':
+ elif t.find("Result: FAIL") != -1:
print TERM.red + ('FAILURE on %s' % BASE+url) + TERM.normal
for t2 in accum:
print t2.encode('utf-8')
if t2.find("Wstat") != -1:
- summary[t2.split(" ")[0]].append(url)
+ test_case = re.search('\./tests/.*\.t',t2)
+ if test_case:
+ summary[test_case.group()].append(url)
accum = []
- elif t == 'Result: PASS':
+ elif t.find("Result: PASS") != -1:
accum = []
elif t.find("cur_cores=/") != -1:
summary["core"].append([t.split("/")[1]])
@@ -110,11 +113,18 @@ if __name__ == '__main__':
main(BASE+'/job/rackspace-regression-2GB-triggered/')
elif sys.argv[1].find("get-summary") != -1:
if len(sys.argv) < 4:
- print "Usage: failed-tests.py get-summary <last_no_of_days> <regression_link>"
+ print "Usage: failed-tests.py get-summary <last_no_of_days> <centos|netbsd|regression_link>"
sys.exit(0)
num_days=int(sys.argv[2])
cut_off_date=date.today() - timedelta(days=num_days)
- reg_link = sys.argv[3]
+ reg = sys.argv[3]
+ if reg == 'centos':
+ reg_link = '/job/rackspace-regression-2GB-triggered/'
+ elif reg == 'netbsd':
+ reg_link = '/job/rackspace-netbsd7-regression-triggered/'
+ else:
+ reg_link = reg
+
build_id = int(requests.get(BASE+reg_link+"lastBuild/buildNumber", verify=False).text)
get_summary(build_id, cut_off_date, reg_link)
else: