test-bugzilla-files/analyze-logs.py | 16 ++++++-- test-bugzilla-files/test-bugzilla-files.py | 55 +---------------------------- 2 files changed, 15 insertions(+), 56 deletions(-)
New commits: commit 5d429b0c349fc384e03e031cc5d52a595ea991c2 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sat Nov 22 17:30:28 2014 -0500 fix analyze logs script diff --git a/test-bugzilla-files/analyze-logs.py b/test-bugzilla-files/analyze-logs.py index 89bfb74..f3f6aae 100644 --- a/test-bugzilla-files/analyze-logs.py +++ b/test-bugzilla-files/analyze-logs.py @@ -20,13 +20,21 @@ import os import os.path import collections import csv +import re -def analyze_import_crash(directory): +def analyze_import_crash(directory, crashes): crashtest_file = os.path.join(directory, "crashlog.txt") if not os.path.exists(crashtest_file): return 0 - num_lines = sum(1 for line in open(crashtest_file)) - return num_lines + + regex = re.compile("Crash:/srv/crashtestdata/files/(\w*)") + for line in open(crashtest_file): + r = regex.search(line) + format = r.groups()[0] + if format not in crashes: + crashes[format] = 0 + crashes[format] = 1 + crashes[format] + return crashes def analyze_export_crash(directory): crashtest_file = os.path.join(directory, "exportCrash.txt") @@ -72,7 +80,7 @@ def export_csv(filename, data, reader): def update_import(): import_crashes = dict() for directory in get_directories(): - import_crashes[directory] = analyze_import_crash(directory) + analyze_import_crash(directory, import_crashes) reader = import_csv("importCrash.csv") export_csv("importCrash.csv", import_crashes, reader) commit aa58561dc74a1ce212df109f9be6635eb04fd551 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sun Nov 16 05:11:30 2014 -0500 we don't need that files any more diff --git a/test-bugzilla-files/test-bugzilla-files.py b/test-bugzilla-files/test-bugzilla-files.py index e4a5f36..eaee71d 100644 --- a/test-bugzilla-files/test-bugzilla-files.py +++ b/test-bugzilla-files/test-bugzilla-files.py @@ -454,12 +454,9 @@ class ExportFileTest: } return filterNames[format] - - class LoadFileTest: - def __init__(self, file, state): + def __init__(self, file): self.file = file - self.state = state def run(self, xContext, connection): print("Loading document: " + self.file) t = None @@ -479,16 +476,13 @@ class LoadFileTest: if xDoc: exportTest = ExportFileTest(xDoc, self.file) exportTest.run(connection) - self.state.goodFiles.append(self.file) except pyuno.getClass("com.sun.star.beans.UnknownPropertyException"): print("caught UnknownPropertyException " + self.file) if not t.is_alive(): print("TIMEOUT!") - self.state.timeoutFiles.append(self.file) else: t.cancel() handleCrash(self.file, 0) - self.state.badPropertyFiles.append(self.file) connection.tearDown() connection.setUp() xDoc = None @@ -496,11 +490,9 @@ class LoadFileTest: print("caught DisposedException " + self.file) if not t.is_alive(): print("TIMEOUT!") - self.state.timeoutFiles.append(self.file) else: t.cancel() handleCrash(self.file, 1) - self.state.badDisposedFiles.append(self.file) connection.tearDown() connection.setUp() xDoc = None @@ -516,7 +508,6 @@ class LoadFileTest: t.cancel() except pyuno.getClass("com.sun.star.beans.UnknownPropertyException"): print("caught UnknownPropertyException while closing") - self.state.badPropertyFiles.append(self.file) connection.tearDown() connection.setUp() except pyuno.getClass("com.sun.star.lang.DisposedException"): @@ -524,65 +515,25 @@ class LoadFileTest: if t.is_alive(): t.cancel() else: - self.state.badDisposedFiles.append(self.file) + pass connection.tearDown() connection.setUp() print("...done with: " + self.file) subprocess.call("rm core*", shell=True) -class State: - def __init__(self): - self.goodFiles = [] - self.badDisposedFiles = [] - self.badPropertyFiles = [] - self.timeoutFiles = [] - - -def writeReport(state, startTime): - goodFiles = open("goodFiles.log", "w") - goodFiles.write("Files which loaded perfectly:\n") - goodFiles.write("Starttime: " + startTime.isoformat() +"\n") - for file in state.goodFiles: - goodFiles.write(file) - goodFiles.write("\n") - goodFiles.close() - badDisposedFiles = open("badDisposedFiles.log", "w") - badDisposedFiles.write("Files which crashed with DisposedException:\n") - badDisposedFiles.write("Starttime: " + startTime.isoformat() + "\n") - for file in state.badDisposedFiles: - badDisposedFiles.write(file) - badDisposedFiles.write("\n") - badDisposedFiles.close() - badPropertyFiles = open("badPropertyFiles.log", "w") - badPropertyFiles.write("Files which crashed with UnknownPropertyException:\n") - badPropertyFiles.write("Starttime: " + startTime.isoformat() + "\n") - for file in state.badPropertyFiles: - badPropertyFiles.write(file) - badPropertyFiles.write("\n") - badPropertyFiles.close() - timeoutFiles = open("timeoutFiles.log", "w") - timeoutFiles.write("Files which timed out:\n") - timeoutFiles.write("Starttime: " + startTime.isoformat() + "\n") - for file in state.timeoutFiles: - timeoutFiles.write(file) - timeoutFiles.write("\n") - timeoutFiles.close() - def runLoadFileTests(opts, file_list_name): startTime = datetime.datetime.now() connection = PersistentConnection(opts) try: tests = [] - state = State() # print("before map") files = [] files.extend(getFiles(file_list_name[0])) files.sort() - tests.extend( (LoadFileTest(file, state) for file in files) ) + tests.extend( (LoadFileTest(file) for file in files) ) runConnectionTests(connection, simpleInvoke, tests) finally: connection.kill() - writeReport(state, startTime) def parseArgs(argv): (optlist,args) = getopt.getopt(argv[1:], "hr", _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits