diff --git a/topfails/dbschema.pyc b/topfails/dbschema.pyc new file mode 100644 index 0000000..b914be4 Binary files /dev/null and b/topfails/dbschema.pyc differ diff --git a/topfails/log_parser.py b/topfails/log_parser.py index 13857c8..d1e5f11 100644 --- a/topfails/log_parser.py +++ b/topfails/log_parser.py @@ -68,26 +68,29 @@ class LogParser(object): """return potential test name [None by default]""" return None - def processTestName(self, test, reason, potentialTestName): + def processTestName(self, test, reason, potentialTestName, lines, idx): """substitute the potential name for the test (if applicable)""" # for process crash, take the test-runner (automation) as the test failure # (as already reported in test) and reset the potentialTestName to None if 'PROCESS-CRASH' in reason: - return test + return test, idx # an automation.py failure will ALWAYS be followed by a # automationutils.processLeakLog line; so send a None here # which will cause the parsing to continue and don't record this failure if 'automation.py' in test: - return None + return None, idx if 'automationutils.processLeakLog' and (potentialTestName is not None): - return potentialTestName + len_lines = len(lines) + while (idx+1) < len_lines and ('automationutils.processLeakLog' in lines[idx+1]): + idx += 1 + return potentialTestName, idx # if these conditions are not met, return # the test name and potentialTestName untouched - return test # no name substitution + return test, idx # no name substitution def parse(self, fp): """ @@ -111,6 +114,7 @@ class LogParser(object): # test to see if the line is a failure m = self.testfailedRe.match(line) if not m: + idx += 1 continue # reason for failure [TEST-UNEXPECTED-.* or PROCESS-CRASH] @@ -128,9 +132,10 @@ class LogParser(object): else: # substitute potentialTestName for the test name if # test is automation.py or automationutils.processLeakLog - test = self.processPotentialTestName(test, reason, potentialTestName) + test, idx = self.processTestName(test, reason, potentialTestName, lines, idx) - if test is None: # don't add this test + if test is None: # don't add this test (and don't reset potentialTestName) + idx += 1 continue # reset potentialTestName diff --git a/topfails/log_parser.pyc b/topfails/log_parser.pyc new file mode 100644 index 0000000..225b0df Binary files /dev/null and b/topfails/log_parser.pyc differ diff --git a/topfails/mappings.py b/topfails/mappings.py new file mode 100644 index 0000000..a2bc8c9 --- /dev/null +++ b/topfails/mappings.py @@ -0,0 +1,45 @@ +""" + [type of build] + +Examples: + +The builder: build (e.g. 'Linux mozilla-central build') + +A debug test: debug test + +An opt test: opt test + +A leak test: leak test + +Talos: + talos (e.g. 'Rev3 Fedora 12x64 mozilla-central talos') +-or- + talos (e.g. 'Rev3 Fedora 12x64 mozilla-central talos cold') +""" + +# OS mappings +OSes = [ 'Linux', + 'Linux x86-64', + 'OS X 10.5.2', + 'OS X 10.6.2', + 'Rev3 Fedora 12', + 'Rev3 Fedora 12x64', + 'Rev3 MacOSX Leopard 10.5.8', + 'Rev3 MacOSX Snow Leopard 10.6.2', + 'Rev3 WINNT 5.1', + 'Rev3 WINNT 6.1', + 'WINNT 5.2' ] +OS_to_index = dict([(OS, index) for index, OS in enumerate(OSes)]) +index_to_OS = dict([(index, OS) for index, OS in enumerate(OSes)]) +OSdata = { 'Linux': {'name': 'Linux', 'bits': 32 }, + 'Rev3 Fedora 12': { 'name': 'Fedora', 'bits': 32} + 'Rev3 Fedora 12x64': { 'name': 'Fedora', 'bits': 64} + 'Linux x86-64': { 'name': 'Linux', 'bits': 64} + 'OS X 10.5.2': { 'name': 'MAC OSX', 'bits': 32} + 'OS X 10.6.2': { 'name': 'MAC OSX', 'bits': 64} + 'Rev3 MacOSX Leopard 10.5.8': { 'name': 'MAC OSX', 'bits': 32} + 'Rev3 MacOSX Snow Leopard 10.6.2': { 'name': 'MAC OSX', 'bits': 64} + 'Rev3 WINNT 5.1': { 'name': 'Windows', 'bits': 32} + 'Rev3 WINNT 6.1': { 'name': 'Windows', 'bits': 64} + 'WINNT 5.2': { 'name': 'Windows', 'bits': 32} + } diff --git a/topfails/mappings.py~ b/topfails/mappings.py~ new file mode 100644 index 0000000..a2bc8c9 --- /dev/null +++ b/topfails/mappings.py~ @@ -0,0 +1,45 @@ +""" + [type of build] + +Examples: + +The builder: build (e.g. 'Linux mozilla-central build') + +A debug test: debug test + +An opt test: opt test + +A leak test: leak test + +Talos: + talos (e.g. 'Rev3 Fedora 12x64 mozilla-central talos') +-or- + talos (e.g. 'Rev3 Fedora 12x64 mozilla-central talos cold') +""" + +# OS mappings +OSes = [ 'Linux', + 'Linux x86-64', + 'OS X 10.5.2', + 'OS X 10.6.2', + 'Rev3 Fedora 12', + 'Rev3 Fedora 12x64', + 'Rev3 MacOSX Leopard 10.5.8', + 'Rev3 MacOSX Snow Leopard 10.6.2', + 'Rev3 WINNT 5.1', + 'Rev3 WINNT 6.1', + 'WINNT 5.2' ] +OS_to_index = dict([(OS, index) for index, OS in enumerate(OSes)]) +index_to_OS = dict([(index, OS) for index, OS in enumerate(OSes)]) +OSdata = { 'Linux': {'name': 'Linux', 'bits': 32 }, + 'Rev3 Fedora 12': { 'name': 'Fedora', 'bits': 32} + 'Rev3 Fedora 12x64': { 'name': 'Fedora', 'bits': 64} + 'Linux x86-64': { 'name': 'Linux', 'bits': 64} + 'OS X 10.5.2': { 'name': 'MAC OSX', 'bits': 32} + 'OS X 10.6.2': { 'name': 'MAC OSX', 'bits': 64} + 'Rev3 MacOSX Leopard 10.5.8': { 'name': 'MAC OSX', 'bits': 32} + 'Rev3 MacOSX Snow Leopard 10.6.2': { 'name': 'MAC OSX', 'bits': 64} + 'Rev3 WINNT 5.1': { 'name': 'Windows', 'bits': 32} + 'Rev3 WINNT 6.1': { 'name': 'Windows', 'bits': 64} + 'WINNT 5.2': { 'name': 'Windows', 'bits': 32} + } diff --git a/topfails/topfails/__init__.pyc b/topfails/topfails/__init__.pyc new file mode 100644 index 0000000..eb83dc1 Binary files /dev/null and b/topfails/topfails/__init__.pyc differ diff --git a/topfails/topfails/settings.pyc b/topfails/topfails/settings.pyc new file mode 100644 index 0000000..ab3e43e Binary files /dev/null and b/topfails/topfails/settings.pyc differ diff --git a/topfails/topfails/urls.pyc b/topfails/topfails/urls.pyc new file mode 100644 index 0000000..84c5017 Binary files /dev/null and b/topfails/topfails/urls.pyc differ diff --git a/topfails/topfails/viewer/__init__.pyc b/topfails/topfails/viewer/__init__.pyc new file mode 100644 index 0000000..b4d680a Binary files /dev/null and b/topfails/topfails/viewer/__init__.pyc differ diff --git a/topfails/topfails/viewer/models.pyc b/topfails/topfails/viewer/models.pyc new file mode 100644 index 0000000..ad0b9c1 Binary files /dev/null and b/topfails/topfails/viewer/models.pyc differ diff --git a/topfails/topfails/viewer/views.pyc b/topfails/topfails/viewer/views.pyc new file mode 100644 index 0000000..c32d1e6 Binary files /dev/null and b/topfails/topfails/viewer/views.pyc differ diff --git a/topfails/unittest-log.py b/topfails/unittest-log.py index f6c8607..2cc9add 100755 --- a/topfails/unittest-log.py +++ b/topfails/unittest-log.py @@ -500,53 +500,7 @@ while curtime < endtime and chunk < totalchunks: logging.info("Skipping already recorded failure '%s' in build with id '%s' with failure record '%s' " % (test, buildid, text)) else: InsertTest(conn, buildid, reason, testnames_id, text) - - - # # Look for test failures. - # for line in gz.readlines()): - # # Check all lines if they have INFO Running or url=file:/// stuff. - # # If it is mochitest, we see the former string pattern - # # If it is jsreftest,crashtest we see the later string pattern. - # if "INFO Running" in line or "[url = file:///" in line or "INFO | Loading" in line: - # potentialTestName=line - # if "[url = file:///" in line: - # if "?test=" in line: - # potentialTestName = potentialTestName.split('?test=')[1][0:-2] - # else: - # potentialTestName = potentialTestName.split('url = ')[1][0:-1] - # elif "INFO Running" in line: - # potentialTestName = potentialTestName.split('INFO Running ')[1][0:-4] - # elif "INFO | Loading" in line: - # potentialTestName = potentialTestName.split('INFO | Loading ')[1] - # else : - # potentialTestName= "[unittest-log.py: no logged test]" - - # m = testfailedRe.match(line) - # if m: - # test = rawtest = m.group(2).strip() or "[unittest-log.py: no logged test]" - # if 'automation.py' in test or 'automationutils.processLeakLog' in test: - # if potentialTestName != "": - # test = rawtest = potentialTestName - # potentialTestName="" - - # # Code bits below try to change back slash to forward slash - # # and get rid of varibale prepends to the /test/../.. names - - # 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]" - # testnames_id=GetOrInsertTest(conn,test) - # if HaveFailRecord(conn,buildid, m.group(1).rstrip(), testnames_id): - # logging.info("Skipping already recorded failure '%s' in build with id '%s' with failure record '%s' " % (test, buildid, text)) - # else: - # InsertTest(conn, buildid, m.group(1).rstrip(), testnames_id, text) + except Exception, e: errstring = "Unexpected error: %s" % e if options.debug: