diff --git a/topfails/datascraper.py b/topfails/datascraper.py index 155c07d..6a94f4b 100755 --- a/topfails/datascraper.py +++ b/topfails/datascraper.py @@ -352,17 +352,25 @@ if createdb: 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) + 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) + + # if the database doesn't exist, create the schema using django by + # running models.py syncdb + # set the dbuser and dbpasswd environment vsariables for settings.py + # to work properly + os.environ['dbuser'] = options.dbuser + os.environ['dbpasswd'] = options.dbpasswd + from django.core.management import execute_manager + import settings + execute_manager(settings, ['manage.py','syncdb']) treeid = GetOrInsertTree(conn, options.tree) @@ -403,12 +411,12 @@ while curtime < endtime and chunk < totalchunks: # dictionary of parsers parsers = { - 'check': log_parser.CheckParser, - 'mochitest': log_parser.MochitestParser, - 'reftest': log_parser.ReftestParser, - 'jsreftest': log_parser.ReftestParser, - 'crashtest': log_parser.ReftestParser, - 'xpcshell': log_parser.XPCshellParser, + 'check': logparser.CheckParser, + 'mochitest': logparser.MochitestParser, + 'reftest': logparser.ReftestParser, + 'jsreftest': logparser.ReftestParser, + 'crashtest': logparser.ReftestParser, + 'xpcshell': logparser.XPCshellParser, } # regular expression to find the harness @@ -478,7 +486,7 @@ while curtime < endtime and chunk < totalchunks: # assured to match because we search for this above harness_type = re.match(harness_regex, logname).groups()[0] - parser = parsers.get(harness_type, log_parser.LogParser)() + parser = parsers.get(harness_type, logparser.LogParser)() failures = parser.parse(gz) # add the failures to the database diff --git a/topfails/logparser.py b/topfails/logparser.py index d1e5f11..fb95404 100644 --- a/topfails/logparser.py +++ b/topfails/logparser.py @@ -152,6 +152,9 @@ class LogParser(object): else : test=tup[0] + # remove whitespace and trailing dots + test = test.strip().rstrip('.') + # append interesting data to failures return value failures.append({'test': test, 'text': text, 'reason': reason}) diff --git a/topfails/settings.py b/topfails/settings.py index 0e0f594..d86b85d 100644 --- a/topfails/settings.py +++ b/topfails/settings.py @@ -1,7 +1,7 @@ # Django settings for topfails project. import os -DEBUG = True +DEBUG = False TEMPLATE_DEBUG = DEBUG DBUSER = DBPASSWD = '' diff --git a/topfails/templates/#base.html# b/topfails/templates/#base.html# new file mode 100755 index 0000000..1537976 --- /dev/null +++ b/topfails/templates/#base.html# @@ -0,0 +1,121 @@ + + + +Topfails + + + + + + + + +
+ + Latest Fails + +
+ +
+ + Top 25 Fails + +
+ +
+ + All Failed Tests + +
+ +
+ + Fails from X days + +
+ +
+ + Help + +
+ +
+ Firefox Logo +
+ +
+
+
Mozilla Tinderbox Topfails Dashboard
+
+ +
+ + Firefox + +
+
+ + Firefox3.6 + +
+
+ + Thunderbird + +
+
+ + SeaMonkey + +
+ +
+{% block content %} +{% endblock %} +
+ + diff --git a/topfails/templates/404.html b/topfails/templates/404.html new file mode 100644 index 0000000..bdf10a9 --- /dev/null +++ b/topfails/templates/404.html @@ -0,0 +1,9 @@ + + +404 + + +

404

+

The resource you are looking for can't be found

+ + diff --git a/topfails/templates/500.html b/topfails/templates/500.html new file mode 100644 index 0000000..c210c36 --- /dev/null +++ b/topfails/templates/500.html @@ -0,0 +1,9 @@ + + +500 + + +

500 Internal Server Error

+

There was an error in django. Oops! We're sorry

+ + diff --git a/topfails/templates/viewer/test.html.orig b/topfails/templates/viewer/test.html.orig deleted file mode 100755 index 2670eb3..0000000 --- a/topfails/templates/viewer/test.html.orig +++ /dev/null @@ -1,27 +0,0 @@ -{% extends "base.html" %} -{% block content %} -

Logfile links and Changeset links for {{ test }} failures

-