From 6bad3681ddce7b03cfa18dcdc49e70596651cb6f Mon Sep 17 00:00:00 2001 From: Murali Nandigama Date: Tue, 13 Apr 2010 14:52:17 -0700 Subject: [PATCH] deleted all pyc and *.*~ files --- unittest-logs/dbschema.pyc | Bin 1185 -> 0 bytes unittest-logs/dbschema.py~ | 74 --- unittest-logs/unittest-log.py~ | 459 ------------------ unittest-logs/unittestweb/__init__.pyc | Bin 160 -> 0 bytes unittest-logs/unittestweb/settings.pyc | Bin 1799 -> 0 bytes unittest-logs/unittestweb/settings.py~ | 75 --- .../unittestweb/templates/viewer/index.html~ | 96 ---- unittest-logs/unittestweb/urls.pyc | Bin 1159 -> 0 bytes unittest-logs/unittestweb/urls.py~ | 18 - unittest-logs/unittestweb/viewer/__init__.pyc | Bin 167 -> 0 bytes unittest-logs/unittestweb/viewer/models.pyc | Bin 5797 -> 0 bytes unittest-logs/unittestweb/viewer/models.py~ | 108 ----- unittest-logs/unittestweb/viewer/views.pyc | Bin 5106 -> 0 bytes unittest-logs/unittestweb/viewer/views.py~ | 55 --- 14 files changed, 885 deletions(-) delete mode 100644 unittest-logs/dbschema.pyc delete mode 100755 unittest-logs/dbschema.py~ delete mode 100755 unittest-logs/unittest-log.py~ delete mode 100644 unittest-logs/unittestweb/__init__.pyc delete mode 100644 unittest-logs/unittestweb/settings.pyc delete mode 100755 unittest-logs/unittestweb/settings.py~ delete mode 100755 unittest-logs/unittestweb/templates/viewer/index.html~ delete mode 100644 unittest-logs/unittestweb/urls.pyc delete mode 100755 unittest-logs/unittestweb/urls.py~ delete mode 100644 unittest-logs/unittestweb/viewer/__init__.pyc delete mode 100644 unittest-logs/unittestweb/viewer/models.pyc delete mode 100755 unittest-logs/unittestweb/viewer/models.py~ delete mode 100644 unittest-logs/unittestweb/viewer/views.pyc delete mode 100755 unittest-logs/unittestweb/viewer/views.py~ diff --git a/unittest-logs/dbschema.pyc b/unittest-logs/dbschema.pyc deleted file mode 100644 index 4ceb0387e2d373735e93d055cbe889a79ef8025d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1185 zcmbVL&2H2%5O$KKg^D6^;lOFc$t$H@3DFxuq+5fc?s`#@qHQlxnz-4h`Ki{9L?vz@ z-h{W{&Y4%?#0|#YZFfsqsf(3y=9{r+zVX;Uer|6){`KuJCG%n9|22wyhEs;0Ma~I1 zLB%GyMNTY|Ipi~1Z0!nZ2bUGUad7nr)&5i@N*wHm=|ogXYN1Jsj@n0&0Zs~cU>J*h zvWWE&0fw@dfwK%c%i!KJ*f0P&hIA9da`_Zz_CchrD(W0=QlVY>1>IY4bMyn|MGPWu zf55*w3uTj^73E!uk>ToEe15>jFk>GtvXA)O2K3t4y>&)kSI7NlyM$B{);c3Y?COxN zd*?zXWI8P_RMFIT>gHfI)7c3q%`G+=uy%uhYDk~&?R9UJP8|%W^qs~w3Z^RdrHlMV?eiFMQ8?ZCxmxd -# Ted Mielczarek . -# Murali Nandigama -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -# -# DB schema maintenance functions. -# - -import logging - -__all__ = \ - [ - "CreateDBSchema" - ] - -def CreateDBSchema(conn): - logging.info("Executing CreateDBSchema()") - - - conn.execute(""" - CREATE TABLE IF NOT EXISTS trees( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, name TEXT) - """) - - conn.execute(""" - CREATE TABLE IF NOT EXISTS builds(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, treeid INT, os INT, starttime INT, status INT, changeset TEXT, logfile TEXT) - """) - conn.execute(""" - CREATE INDEX builds_starttime ON builds (starttime) - """) - - conn.execute(""" - CREATE TABLE IF NOT EXISTS tests (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, buildid INT, name TEXT, description TEXT) - """) - conn.execute(""" - CREATE INDEX tests_name ON tests (name(1024)) - """) - - diff --git a/unittest-logs/unittest-log.py~ b/unittest-logs/unittest-log.py~ deleted file mode 100755 index f6bf3cb..0000000 --- a/unittest-logs/unittest-log.py~ +++ /dev/null @@ -1,459 +0,0 @@ -#!/usr/bin/env python -#Indentation is 2 spaces ***** DO NOT USE TABS ***** - -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is TopFails site code. -# -# The Initial Developer of the Original Code is -# Mozilla foundation -# Portions created by the Initial Developer are Copyright (C) 2010 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# Serge Gautherie -# Ted Mielczarek . -# Murali Nandigama -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** - -import re, os, sys, urllib, logging -import MySQLdb # Moved from sqlite3 db to MySQL -from time import ctime, sleep, time -from math import ceil -from optparse import OptionParser -from gzip import GzipFile -import curses.ascii -import binascii - -try: - # 'Availability: Unix.' - from time import tzset -except ImportError: - print >>sys.stderr, "WARNING: time.tzset() is not available on non-Unixes!" - - # Define a fake function. (for development use only) - # ToDo: Investigate Windows/etc situation. (Bug 525699) - def tzset(): - pass - -try: - import simplejson as json -except ImportError: - try: - # 'New in version 2.6.' - import json - except ImportError: - print >>sys.stderr, "ERROR: no simplejson nor json package found!" - sys.exit(1) - -from dbschema import CreateDBSchema - -# Number of seconds in a hour: 60 mn * 60 s = 3600 s. -S_IN_H = 3600 -# Download data in 24 hours chunks so as not to overwhelm the tinderbox server. -chunksize = 24 * S_IN_H -# seconds between requests -SLEEP_TIME = 1 - -class OS(): - Windows = 0 - Mac = 1 - Linux = 2 - Unknown = 3 - -class BuildStatus(): - # Unavailable builds to skip. - # Values need (only) to be less than the 'Success' one. - NoBuild = -2 - InProgress = -1 - - # Builds to save in the db. - # Do not change these values (without updating db data). - Success = 0 - TestFailed = 1 - Burning = 2 - Exception = 3 - Unknown = 4 - -csetre = re.compile("rev/([0-9A-Za-z]+)") -def FindChangesetInScrape(scrape): - for line in scrape: - m = csetre.search(line) - if m: - return m.group(1) - return None - -def OSFromBuilderName(name): - if name.startswith("Linux"): - return OS.Linux - if name.startswith("MacOSX") or name.startswith("OS X"): - return OS.Mac - if name.startswith("WINNT"): - return OS.Windows - return OS.Unknown - -buildStatuses = { - # "No build in progress". - "null": BuildStatus.NoBuild, - # "Build in progress". - "building": BuildStatus.InProgress, - # "Successful build". - "success": BuildStatus.Success, - # "Successful build, but tests failed". - "testfailed": BuildStatus.TestFailed, - # "Build failed". - "busted": BuildStatus.Burning, - # "Non-build failure". (i.e. "automation failure") - "exception": BuildStatus.Exception, -} -def BuildStatusFromText(status): - try: - return buildStatuses[status] - except KeyError: - # Log 'Unknown' status failure: this should not happen (unless new statuses are created), but we want to know if it does. - logging.info("WARNING: unknown status = '%s'!" % status) - return BuildStatus.Unknown - -def GetOrInsertTree(conn, tree): - """Get an id for a tree named |tree|. If it's not already in the trees - table, insert a new row and return the id.""" - - conn.execute("""SELECT id FROM trees WHERE name = %s""", (tree)) - if conn.rowcount > 0: - return conn.lastrowid - - # need to insert it - conn.execute("""INSERT INTO trees (name) VALUES (%s)""", (tree,)) - return conn.lastrowid - -def HaveBuild(conn, treeid, os, starttime): - """See if we already have this build in our database.""" - conn.execute("""SELECT COUNT(*) FROM builds WHERE treeid = %s AND os = %s AND starttime = %s""", (treeid, os, starttime)) - return conn.fetchone()[0] == 1 - -def UpdateLogfile(conn, treeid, os, starttime, logfile): - """Update empty 'logfile' for a given build (added in db schema v1).""" - conn.execute("""UPDATE builds SET logfile = %s WHERE treeid = %s AND os = %s AND starttime = %s AND logfile IS NULL""", (logfile, treeid, os, starttime)) - -def InsertBuild(conn, treeid, os, starttime, status, logfile, changeset): - """Insert a build into the builds table and return the id.""" - conn.execute("""INSERT INTO builds (treeid, os, starttime, status, logfile, changeset) VALUES (%s, %s, %s, %s, %s, %s)""", (treeid, os, starttime, status, logfile, changeset)) - return conn.lastrowid - -def InsertTest(conn, buildid, result, name, description): - # ToDo: Add column to save result. - conn.execute("""INSERT INTO tests (buildid, name, description) VALUES (%s, %s, %s)""", (buildid, name, description)) - -def asciirepl(match): - # replace the hexadecimal characters with ascii characters - s = match.group() - return binascii.unhexlify(s) - -def reformat_content(data): - p = re.compile(r'\\x(\w{2})') - return p.sub(asciirepl, data) - - -def fix_tbox_json(s): # Check :: This is a bad logic by :: not checking for CRTL chars in JSON text -- Murali - """Fixes up tinderbox json. - - Tinderbox returns strings as single-quoted strings, and occasionally - includes the unquoted substring 'undef' (with quotes) in the output, e.g. - - {'key': 'hello 'undef' world'} - - should return a dictionary - - {'key': 'hello \'undef\' world'} - """ - - json_data = re.sub(r"^tinderbox_data\s*=\s*", "", s) - json_data = re.sub(r";$", "", json_data) - retval = [] - in_str = False - in_esc = False - skip = 0 - for i,c in enumerate(json_data): - # The tinderbox data is a fracked json. and it some times contains - # Control characters. that would totally fail the json.loads step. - # So, eliminate them .. all of them .. here -- Murali - if (c < '\xFD' and c > '\x1F') or c == '\n' or c == '\r' : - if skip > 0: - skip -= 1 - continue - - if in_str: - if in_esc: - if c == "'": - retval.append("'") - else: - retval.append("\\") - retval.append(c) - in_esc = False - elif c == "\\": - in_esc = True - elif c == "\"": - retval.append("\\\"") - elif c == "'": - if json_data[i:i+7] == "'undef'": - retval.append("'undef'") - skip = 7 - else: - retval.append("\"") - in_str = False - else: - retval.append(c) - else: - if c == "'": - retval.append("\"") - in_str = True - else: - retval.append(c) - return "".join(retval) - -parser = OptionParser() -parser.add_option("-s", "--span", action="store", - dest="timespan", default="20d", - help="Period of time to fetch data for (N[y,m,w,d,h], default=%default)") -parser.add_option("-t", "--tree", action="store", - dest="tree", default="Firefox", - help="Tinderbox tree to fetch data from (default=%default)") -parser.add_option("-d", "--database", action="store", - dest="db", default="topfailsdb", - help="Database filename (default=%default)") -parser.add_option("--host", action="store", - dest="dbhost", default="localhost", - help="Database host name (default=%default)") -parser.add_option( "--port", action="store", - dest="dbport",default="3306", - help="Database port (default=%default)") -parser.add_option("-u", "--user", action="store", - dest="dbuser", default="root", - help="Database username (default=%default)") -parser.add_option("-p", "--passwd", action="store", - dest="dbpasswd", - help="Database user password") -parser.add_option("-v", "--verbose", action="store_true", - dest="verbose", default="False", - help="Enable verbose logging") - -(options, args) = parser.parse_args() - -logging.basicConfig(level=options.verbose and logging.DEBUG or logging.WARNING) - -os.environ['TZ'] = "US/Pacific" -tzset() -# Get current time, in seconds. -endtime = int(time()) - -m = re.match("(\d+)([ymwdh])", options.timespan) -if m is None: - print >>sys.stderr, "ERROR: bad timespan = '%s'!" % options.timespan - sys.exit(1) - -timespan = int(m.group(1)) * {'y': 365 * 24 * S_IN_H, - 'm': 30 * 24 * S_IN_H, - 'w': 7 * 24 * S_IN_H, - 'd': 24 * S_IN_H, - 'h': S_IN_H}[m.group(2)] -# Set current time to beginning of requested timespan ending now. -curtime = endtime - timespan - - -createdb=False - - -try: - connection = MySQLdb.connect (host = options.dbhost, - port = int(options.dbport), - db = options.db, - user = options.dbuser, - passwd = options.dbpasswd) - conn=connection.cursor() -except MySQLdb.Error, e: - print "Error %d: %s" % (e.args[0], e.args[1]) - createdb = True - - -if createdb: - connection = MySQLdb.connect (host = options.dbhost, - port = int(options.dbport), - user = options.dbuser, - passwd = options.dbpasswd) - conn = connection.cursor() - try: - createdatabase='create database %s' %(options.db) - conn.execute (createdatabase) - conn.close() - connection.close() - except MySQLdb.Error, e: - print "Error %d: %s" % (e.args[0], e.args[1]) - sys.exit (1) - try: - connection = MySQLdb.connect (host = options.dbhost, - port = int(options.dbport), - db = options.db, - user = options.dbuser, - passwd = options.dbpasswd) - conn=connection.cursor() - except MySQLdb.Error, e: - print "Error %d: %s" % (e.args[0], e.args[1]) - sys.exit(1) - - CreateDBSchema(conn) - - -treeid = GetOrInsertTree(conn, options.tree) -logging.info("Reading tinderbox data...") - -chunk = 0 -# add a fudge factor here, since builds can take up to 3 hours to finish, -# and we can't get the changeset unless we ask for time up to the end of the -# build -endtime += 3 * S_IN_H -timespan += 3 * S_IN_H -totalchunks = int(ceil(float(timespan) / chunksize)) - -while curtime < endtime and chunk < totalchunks: - chunk += 1 - logging.info("Chunk %d/%d" % (chunk, totalchunks)) - - if (endtime - curtime) < chunksize: - chunksize = endtime - curtime - - tboxurl = "http://tinderbox.mozilla.org/showbuilds.cgi?tree=%(tree)s&maxdate=%(maxdate)d&noignore=1&hours=%(hours)d&json=1" \ - % {'tree': options.tree, - 'maxdate': curtime + chunksize, # tbox wants the end time - 'hours': int(chunksize / S_IN_H)} - u = urllib.urlopen(tboxurl) - tboxjson = u.read() - #tboxjson = tboxjson.encode('utf-8').decode('string_escape').decode('utf-8') - #tboxjson = ''.join(u.readlines()) - u.close() - - tboxjson = fix_tbox_json(tboxjson) - try: - tboxdata = json.loads(tboxjson) - except Exception, inst: - print >>sys.stderr, "Error parsing JSON: %s" % inst - continue - - # we only care about unit test boxes - unittest_indices = [tboxdata['build_name_index'][x] for x in tboxdata['build_name_index'] if re.search("test|xpc", x)] - # read build table - # 'TestFailed' expected log format is "result | test | optional text". - testfailedRe = re.compile(r"(TEST-UNEXPECTED-.*) \| (.*) \|(.*)") - for timerow in tboxdata['build_table']: - for index in unittest_indices: - if index >= len(timerow) or timerow[index] == -1: - continue - build = timerow[index] - if 'buildname' not in build or \ - 'logfile' not in build: - continue - - status = BuildStatusFromText(build['buildstatus']) - # Skip unavailable "builds". - if status < BuildStatus.Success: - continue - - name = build['buildname'] - os = OSFromBuilderName(name) - starttime = int(build['buildtime']) - # skip builds we've already seen - if HaveBuild(conn, treeid, os, starttime): - logging.info("Skipping already seen build '%s' at %d (%s)" % (name, starttime, ctime(starttime))) - - # Call 'UpdateLogfile()' anyway. - UpdateLogfile(conn, treeid, os, starttime, build['logfile']) - continue - - # must have scrape data for changeset - if build['logfile'] not in tboxdata['scrape']: - continue - changeset = FindChangesetInScrape(tboxdata['scrape'][build['logfile']]) - if changeset is None: - continue - - buildid = InsertBuild(conn, treeid, os, starttime, status, build['logfile'], changeset) - - # 'Success' is fine as is. - if status == BuildStatus.Success: - pass - - # Parse log to save 'TestFailed' results. - elif status == BuildStatus.TestFailed: - logging.info("Checking build log for '%s' at %d (%s)" % (name, starttime, ctime(starttime))) - try: - # Grab the build log. - log, headers = urllib.urlretrieve("http://tinderbox.mozilla.org/%s/%s" % (options.tree, build['logfile'])) - gz = GzipFile(log) - # Look for test failures. - for line in gz: - m = testfailedRe.match(line) - if m: - test = rawtest = m.group(2).strip() or "[unittest-log.py: no logged test]" - if rawtest.find('\\') != -1: - test = rawtest.replace('\\','/') - - if test.find('/') != -1: - tup=test.partition('build/') - if len(tup[2]) > 2: - test=tup[2] - else : - test=tup[0] - - text = m.group(3).strip() or "[unittest-log.py: no logged text]" - InsertTest(conn, buildid, m.group(1).rstrip(), test, text) - except: - logging.error("Unexpected error: %s" % sys.exc_info()[0]) - #XXX: handle me? - - # Ignore 'Burning' builds: tests may have run nontheless, but it's safer to discard them :-| - elif status == BuildStatus.Burning: - continue - - # Ignore 'Exception' builds: should only be worse than 'Burning'. - # (Don't know much at time of writing, since this feature is not active yet: see bug 476656 and follow-ups.) - elif status == BuildStatus.Exception: - continue - - # Save 'Unknown' status failure: this should not happen (unless new statuses are created), but we want to know if it does. - elif status == BuildStatus.Unknown: - # Add a fake test failure. - InsertTest(conn, buildid, "TEST-UNEXPECTED-FAIL", "unittest-log.py", "Unknown status = '%s'!" % build['buildstatus']) - continue - - - - if chunk < totalchunks: - sleep(SLEEP_TIME) - curtime += chunksize - -conn.close() - -logging.info("Done") diff --git a/unittest-logs/unittestweb/__init__.pyc b/unittest-logs/unittestweb/__init__.pyc deleted file mode 100644 index dcd7f904ef760c1da15495e4050e62bb7170f23e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 160 zcmcckiI*$U`;S*L0~9au%IW6h521 z-qP|mur;8Yz}A6o0lN?M4zMqPegA9Rn3`@S6002XoC~2`@p7jTSxcEIo>_2~rKWg>>)mAc*{*o{&CZj9hm+@% z^6>1t=Jfrer~BjbxATL?d{qCs{q@1c`NO@v!|j9pk!-|sq_JPpa#R_T7vnsY+{mkx z@md(~GK@J9h-)aB86=`=>LC{|{)L;4#|g`7K9p6Raq-U%wyzu%8DlxWNNcWoR#c^N zq$h8Vi~TF>VO7dHJ2eFMB&$kcEYPDVwm@8{aYjrVdA3NhQ0Jw@eoOSXz*QUGl$n%V z$P0dIG<7b-I)a8dYljf(Xk0dN7C_DDP)^2}&ekVRK4koY*M5Hq@#`F^zS{lkvvt^o zrpyZY&o;iV?z#B?@BXyK*W2CxeXLPm@wjfdegtgt^5j_FL_8+mz_ntMOrah^mhCxy zBv)|hS-y2l!bsji#kOMWr4^Bc_{WY<ET}w0XpKtRxJAsh_EO z61q~Ie_dZP#RegH<@~HU5jhG;oV+G)rMhbK#<+oHs}?A#=h(JO-dG_f;bJu;k~a`m zff96o6!@=nDRZ*zAXD`jI~rTAOYFoN45B_Fa3#d|sG4V0!Odd+Zky3hzB#+_J9#w{ za}BS*DY%qbITFTrqU(QARIJJQ5Bfl>2ddZVwQ(%rJR8fs4(c5oT^#LR2U@)@v`{Kb G)cyvcTm5 - - - - - - - - - - - - - - - - - -
- -
- -
-
-
Mozilla Firefox Tinderbox Topfails Dashboard
-
- -
- - - diff --git a/unittest-logs/unittestweb/urls.pyc b/unittest-logs/unittestweb/urls.pyc deleted file mode 100644 index 0797dc7d174eb6fa6377fc4f97b56c61a0c422ad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1159 zcma)5UvJYu40qCPKw%R?Jir4mAcJgE6JC*~0uM+?NE6Bs51XiTtFPU${HfyW3eWp! zd;-1-UjXd8rfr5Mkv2ZtKilX0eD~}3X7^qG^WzZa&plq>@=GTykpBUk1AG=Og!2IM z5RO9#bO@#cm%!Q@Uwu5oDBkD# z<_|w{z?v1Y=hbyq6&9wX2dqs?W347T)2GRW(KB7Ug(zfj5Lt;fCF<|g5l0%)4Owli zHF?yjbbsMZ<2RoU#Mw{wcO$#TfD5@J5yLZ8jx}k^$z66VZQ5z$uFL}NpQzsGRqypz zDS4}v==%9%fSKKR@6_VmC$Et2I}@Hgw48wNg%J<5$B;?YRiK$cCUGA4X8@TDz+j z9&|l8{xhi&i)|mWz;ApGt7KS}qhwm=l%O7|X>Q4GwNP7|)6Cr.+)$', 'tree'), - (r'^changesets$', 'changesets'), - (r'^changesets/(?P[a-f0-9]+)$', 'changeset'), - (r'^tests$', 'tests'), - (r'^test$', 'test'), - (r'^timeline$', 'timeline'), - (r'^topfails$', 'topfails'), -) diff --git a/unittest-logs/unittestweb/viewer/__init__.pyc b/unittest-logs/unittestweb/viewer/__init__.pyc deleted file mode 100644 index d95167dbe1dbdcdf9670098d69a83fd8401665ba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 167 zcmcckiI*$U`;S*L0~9a%g*c4$2aUj2J*u*JX&Tb*tQjIljspHX% znHjBZ%C6d~ESEe0Z@?>XLG3HREq6QsH@pCR-)a3g$+AT*Y;4c*>C-*^bIx~urvLV@ z*%|MTUwzzB!=D-a{~4a_si#zkKTqu_)pC46?RY9Gs8&HmMb#=Qk0Xj|r=+5iYL#5O zq;{rMR93CBiYlsAQPGrYO`&f}g%?#=R$nUhQmJ3Hs>)QAomOE*Z5M=}QDJq&pHboT zh_9(|hWs{GnN=aW-cey~JkgvobIQ)Ea8_Obe^!NaBmSHU=STd43eS%C@ub+^q6*I` zQ&4tEZF?$Q7*Bm(g^R~Jmc|{+Dm;IzV|m#n|52a+HPat zgNV%v27GGcFxks;zVS5Z$nKulc(5Xr_s<RF)3 zZS1DDAEXEE9djUyZ$&}8(;;w2&wcP2m3}CuX^KN_IJcrz2<1sDGtu@$y(geqfm^!` zV0Yl|?e_cJ9(_!C;=fN#9=r)bs{J?wp#q*yj+|595)_VMtBT%mtDOg1k(r!FxDz;( zUcqu}c;qBy&#fqaHio-Kx60{pkK^2QP5Q{1D3mjArUMtVY$#~oH2b;q>hl<`FOYDB zQ#i;1mbr#!7&aEX1#h|_(OE*o1lRO*!S!Fjd^4^M;Eae{P%k}?dCtMVsLZs$e`X{p z5&i(XI6hWv_rIWu;qB{~yr zq8C9#`9Mu4i3a^xPEByZDzsv!msrFqu~^qH-)Jm~Mr(%{luQXI$YWsr%U+#ydZO{+HLbnA9_QlQ71sSNg#|O})MvUg;%+G+VzR<&NMRvu`8$x+)6eUGSmZPE-G5 zEr|Ztv3ka2r@R?&#gi!5VUs^}5(z>7Ej#cVKA()C5)fEW+3D|q)r{`?D#;ZRo?X93a!MKIyIAW7cru2!GV;rLJS%uyu9+@O zms}Zzz&J@a3`Anj7L|nDy(#>%RG6M1r>aVGBUZ^oIh>fUL?SqJq2%2mt zq5mzxIK?@5rvD=rA7c-%V3B!fQZ-45@){QPbq=A?Tz$!y;($aPOEnjw+)b@3&rbEqnWm49yQdJEM*eygl`a_gi0m z8Y(1gPO_2xnNyeuU!r~|8N_-0-D~grESP;JZ@)h58wOe%9`AHQ-{M0y^s z68q!v{<;&c4RPiB-832O`dbH+F>cOleh>tcUfDyEB42RqXm36(;YYS_bN_=MI-D^` zN+r`lxKC0+vDr7BL2l%b`bQiZAK0M z5GiKW&EZRPeBIA!3iGF5tf9!ckcrVh?lbuuPeN zaLR$Oq7Ewr;opZKq%&<~%x?AHgzsIe|N5Z67xq58mN8vC)cTpeK={qQmr@x_gQc=oUGZL9upRoOpbZu`ZpX^>xfsyRjihamYFJZAyO*B2xIVNX2hiCNsI4K8k0}g7kD;nBJSUZQSNoQkLn= z9T{|t*gIcbD9n0G-nqghuOh!Ig_%MP66e~JE!J6w>AN8A)9VFhO4h7_?kY>Ku~%{$okr83lgk%s' % ("http://hg.mozilla.org/mozilla-central", self.changeset, self.changeset) - def tinderbox_link(self): - if self.logfile: - return "http://tinderbox.mozilla.org/showlog.cgi?log=%s/%s" % (self.tree.name, self.logfile) - return "http://tinderbox.mozilla.org/showbuilds.cgi?tree=%s&maxdate=%d&hours=3" % (self.tree.name, self.starttime) - class Meta: - db_table = 'builds' - -class Tests(models.Model): - id = models.IntegerField(primary_key=True) - build = models.ForeignKey(Builds, db_column="buildid") - name = models.TextField(blank=True) - description = models.TextField(blank=True) - class Meta: - db_table = 'tests' - -def get_most_failing_tests(): - cursor = connection.cursor() - cursor.execute("select count(*), name from (select builds.id, name from builds inner join tests on builds.id = tests.buildid group by builds.id, name) aaa group by name order by count(*) desc limit 25") - for row in cursor: - yield row - -def get_fails_in_timerange(self): - - # Get current time, in seconds. - endtime = int(time()) - - #print endtime - m = re.match("(\d+)([ymwdh])", self) - #print m.group(1), m.group(2) - if m is None: - print >>sys.stderr, "ERROR: bad timespan = '%s'!" % options.timespan - sys.exit(1) - - timespan = int(m.group(1)) * {'y': 365 * 24 * 3600, - 'm': 30 * 24 * 3600, - 'w': 7 * 24 * 3600, - 'd': 24 * 3600, - 'h': 3600}[m.group(2)] - # Set current time to beginning of requested timespan ending now. - curtime = endtime - timespan - #print curtime, timespan, endtime-curtime - cursor = connection.cursor() - statement = "select count(*), name from (select builds.id, name from builds inner join tests on builds.id = tests.buildid where builds.starttime >"+str(curtime)+" group by builds.id, name) aaa group by name order by count(*) DESC" - cursor.execute(statement) - for row in cursor: - print row - yield row - diff --git a/unittest-logs/unittestweb/viewer/views.pyc b/unittest-logs/unittestweb/viewer/views.pyc deleted file mode 100644 index fecd610806d59b69948278774a1f06f88574c972..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5106 zcmcgw+in}z72PwWNRg6kNr{~ZZId9qF>oxkMZlL{5Y#b}HmD4YjTT^P5Hx2jjy&Yh zGl!7{NPSU({!^cd_6zzeeJ;?hwa)M&rjKDI&EdHW&)IvOwQu_8zxLWcfBlayhgSX6 z@%bs9@^5Hj`~~*PEDNj`SQc6@w1Bgry{cJOw_e?{E$eMr*05f~vZnQ#mTg;a+p?DR zTK?^ty=q&pZE@ZHY}VVccuSpKiyP|fS=?0Tj>X&R+_ku+&c4NMbq*}vQRmR&U3K2F zcu$?TExx19J&W(EbKl~cJ?-p6iS$4C>4fOHLo`J)iIbx5@_vz&(|l4U?k=X!64%et z()IJA|H)52=`{F0n_th;EH2#^y3dLvse1SpQ(UU*c@pPbYnsj+0_AIZIB50lvnE5 z6nJwya^tMS??re_J=a99NM6ryW=FGZ%HN?m8Rg^TWIP#6;`D4V9-KV={prbUk~+%w zFw4)%#poh=adLcoYgir3kMekWDKI1jQ7I{)1=53Ef+jt>=s*t_SQ=Vdvm4w+orHo~ zAkYW+xDE`P;i^V~U17Fv-J1|Pb6>CX!xzNA-!I*ua6~O7JSA_kk}4Ze2jStiF-?qT zxLaLeB!oz6fs?;DPlmX;8YTu=ruXxLe0Xu`aij(jw~2VpMo}bCUU;5YQb-FvTmnfD z1mwr)0LWB862)4DBH;s~;T*nN1s}IM#fsTvFiuvv<49qT6}Q(=Xh(!3+F`THW{(XX z6aR#W&?0KwW0S~4G+RnhVe)P;NSihgV8Gt5az{4f+M0Sc+5szQ+P>Np|ISM_2k(N%hUFD#N zMSSH|UZ$B#iWQUvzj*f+-ih8uvr&k73U#R_(%T?@J;>`7eFHwb{G z17VuE{Y9Ppn#J$v?gwy~jB%u=(~w zh-7+~Tl20gIQ)O{FJiF29nN%&!a^?RrcpiQptsMVnkaDv>R7ZF4I*4{Qv?~ zs}C?gD+CGiiT3`s2wju^S{ zCkM-PLH-sY3~`HX-QN720qnEqf3@o^yV_!^#e@Q3%_kQyo4RZU27}dxT{SFi(n?Uk z09Ncsi)z{x{_1w#wEVyV^wJimuog`4aH3sJTyHaAVtu3&QU7$Wwpsmj@dcWn+mR%@ zc7#gk2t`nrg6)xg=^eHxhu%RY)aCB4e`bF`L4$f|B%x6cb#Yp}j}L_9gNmMqz~@xf ztD;C%%B|!l`VembD4Y?OBt#ox;Hab=7U|Tb`9%1?L;|aFK%vElV!YxmrwP*4Y6sLq z?DzBy=J2=d0%KH4K9iE|DT`V;sPxf@oQp_S?=dKv<5hdv5#1xY4!H~+be^XZ$?Vev zRd-r=R?HHG!@+clVld(+5j|(5c+8=az8HmtPDsoAWnPR2Rd%8G<%$?fB%EFo1gs%7 zq5?WIqN^50obo9MdlEr!r5iO9N=ncP@&oGjBQzH5A?7yl+q6dT9)9T-M$kDh-7Jb*Z%i^aEiaOn+TBo>VFS>eYQ z8eb&ID?c7<-!V*Ujmyrvv}nIQAeOkMlUm%7}O6YhPt`fZ-JlFbt|OU%^!_VZ|Y++RSKS(f~YmtWG`+z*a} P-LO?_)z^M&t$Y6kXVf^S diff --git a/unittest-logs/unittestweb/viewer/views.py~ b/unittest-logs/unittestweb/viewer/views.py~ deleted file mode 100755 index ed8652b..0000000 --- a/unittest-logs/unittestweb/viewer/views.py~ +++ /dev/null @@ -1,55 +0,0 @@ -from django.shortcuts import render_to_response, get_list_or_404 -from unittestweb.viewer.models import Builds, Trees, Tests, OS_CHOICES, get_most_failing_tests - -def index(request): - failures = get_list_or_404(Tests.objects.all().order_by('-build__starttime')[:10]) - return render_to_response('viewer/index.html', {'failures': failures}) - -def trees(request): - alltrees = Trees.objects.all().order_by('name') - return render_to_response('viewer/trees.html', {'trees': alltrees}) - -def tree(request, tree): - newestbuilds = get_list_or_404(Builds.objects.filter(tree__name__exact=tree).order_by('-starttime')[:5]) - return render_to_response('viewer/tree.html', {'tree': tree, 'newestbuilds': newestbuilds}) - -def changesets(request): - build_csets = Builds.objects.values('changeset').distinct() - return render_to_response('viewer/changesets.html', {'changesets': [b['changeset'] for b in build_csets]}) - -def changeset(request, changeset): - builds = get_list_or_404(Builds, changeset__exact=changeset) - return render_to_response('viewer/changeset.html', {'changeset': changeset, 'builds': builds}) - -def tests(request): - test_names = Tests.objects.values('name').distinct() - return render_to_response('viewer/tests.html', {'tests': [t['name'] for t in test_names]}) - -def test(request): - failures = get_list_or_404(Tests.objects.filter(name__exact=request.GET['name']).order_by('-build__starttime')) - return render_to_response('viewer/test.html', {'test': request.GET['name'], 'failures': failures}) - -def topfails(request): - failures = get_most_failing_tests() - return render_to_response('viewer/topfails.html', {'failures': failures}) - -def timeline(request): - name = request.GET['name'] - builds = get_list_or_404(Builds, tests__name__exact=name) - buildlist = [] - desc_list = [] - for b in builds: - descs = b.tests_set.filter(name__exact=name).order_by('ROWID') - desc = '\n'.join(descs.values_list('description', flat=True)) - if desc not in desc_list: - desc_list.append(desc) - desc_i = desc_list.index(desc) - buildlist.append({'build': b, - 'desctype': desc_i, - 'description': desc, - 'os': OS_CHOICES[b.os][1], - 'time': b.startdate().isoformat() + "Z", - }) - return render_to_response('viewer/timeline.html', {'test': name, - 'descriptions': desc_list, - 'builds': buildlist})