[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py test-bugzilla-files/zip.sh

2022-08-17 Thread Caolán McNamara (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |   29 +
 test-bugzilla-files/zip.sh |   12 
 2 files changed, 13 insertions(+), 28 deletions(-)

New commits:
commit de1ee0e1bf530ac2a5eb3e4c046351cc40ba57f4
Author: Caolán McNamara 
AuthorDate: Wed Aug 17 10:17:30 2022 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 17 11:23:07 2022 +0200

add a --validate option and default it off

no one appears to be tracking these results and working on improving
them and the runs are quite slow so default it off for now

Change-Id: I30b8ec594a7a4704cb33b86b6e2cd37ab7edef41
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/138412
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index ac219ac..32d6bde 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -602,39 +602,20 @@ class NormalTimer:
 def getImportTime(self):
 return 60
 
-
 def getExportTime(self):
 return 180
 
-
-class AsanTimer:
-def __init__(self):
-pass
-
-def getImportTime(self):
-return 300
-
-def getExportTime(self):
-return 900
-
-
 def runLoadFileTests(opts, files, doExport):
 startTime = datetime.datetime.now()
 connection = PersistentConnection(opts)
 exportedFiles = []
 try:
 tests = []
-#print("before map")
 files.sort()
-asan = "--asan" in opts
-print(asan)
-timer = None
-if asan is True:
-timer = AsanTimer()
-else:
-timer = NormalTimer()
+validate = "--validate" in opts
+timer = NormalTimer()
 
-tests.extend( (LoadFileTest(file, not asan, timer, doExport) for file 
in files) )
+tests.extend( (LoadFileTest(file, validate, timer, doExport) for file 
in files) )
 runConnectionTests(connection, simpleInvoke, tests)
 
 exportedFiles = [item for sublist in tests for item in 
sublist.exportedFiles]
@@ -645,7 +626,7 @@ def runLoadFileTests(opts, files, doExport):
 
 def parseArgs(argv):
 (optlist,args) = getopt.getopt(argv[1:], "hr",
-["help", "soffice=", "userdir=", "valgrind", "asan"])
+["help", "soffice=", "userdir=", "valgrind", "validate"])
 #print optlist
 return (dict(optlist), args)
 
@@ -657,7 +638,7 @@ def usage():
supported methods: 'path', 'connect'
  --userdir=URL specify user installation directory for 'path' method
  --valgrindpass --valgrind to soffice for 'path' method
- --asanrun under asan, don't run export tests
+ --validaterun with validation of exported files
 
  'location' is a pathname, not a URL. 'userdir' is a URL. the 'task_file' 
parameters should be
   full absolute pathnames, not URLs."""
diff --git a/test-bugzilla-files/zip.sh b/test-bugzilla-files/zip.sh
index 4808b43..b57e0bb 100755
--- a/test-bugzilla-files/zip.sh
+++ b/test-bugzilla-files/zip.sh
@@ -22,11 +22,15 @@ cd /srv/crashtestdata/current/srv/crashtestdata/files/
 rm -f odfundiff.zip
 zip -r -q odfundiff.zip */*.odfundiff
 mv odfundiff.zip /srv/crashtestdata/logs/$SHA/.
-rm -f validation.zip
-zip -r -q validation.zip */*.log
-mv validation.zip /srv/crashtestdata/logs/$SHA/.
+if [ -e validation.zip ]; then
+rm -f validation.zip
+zip -r -q validation.zip */*.log
+mv validation.zip /srv/crashtestdata/logs/$SHA/.
+fi
 cd /srv/crashtestdata/logs/$SHA
-unzip validation.zip -d validation
+if [ -e validation.zip ]; then
+unzip validation.zip -d validation
+fi
 unzip odfundiff.zip -d odfundiff
 rm *.zip
 cp ~/source/dev-tools/test-bugzilla-files/analyze_logs.py .


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py test-bugzilla-files/zip.sh

2021-10-18 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |7 ---
 test-bugzilla-files/zip.sh |2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 5f98759d3b424308c5688c30ec87110fbab0faf7
Author: Gülşah Köse 
AuthorDate: Mon Oct 18 17:08:29 2021 +0300
Commit: Miklos Vajna 
CommitDate: Mon Oct 18 16:31:00 2021 +0200

Create odfundifflog.csv in a simple way.

Remove import_csv and export_csv functions and just write the data to a
file directly.

Change-Id: Ia28f15984e630647f2097516c3da2c8f61257034
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/123751
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 6dec0e0..ac219ac 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -34,7 +34,6 @@ import time
 import uuid
 import datetime
 import re
-from analyze_logs import import_csv, export_csv
 
 import signal
 import threading
@@ -340,8 +339,10 @@ def handleODFunDiff(file, odfundifflog):
 result["total-diff-count"] = len(odfundifflog.splitlines()) - 1 # Last 
line of log is not a real difference
 result["attr-diff-count"]  = getDifferencesByType("Attribute" , 
odfundifflog)
 result["node-diff-count"] = getDifferencesByType("Node", odfundifflog)
-reader = import_csv("odfundifflog.csv")
-export_csv("odfundifflog.csv", result, reader, header=False)
+
+odfundifflog_f = open("odfundifflog.csv", "a")
+odfundifflog_f.write(file + "," + str(result["total-diff-count"]) + "," + 
str(result["attr-diff-count"]) + "," + str(result["node-diff-count"]) + "\n")
+odfundifflog_f.close()
 
 def getDifferencesByType(type, odfundifflog):
 difflist = odfundifflog.splitlines()
diff --git a/test-bugzilla-files/zip.sh b/test-bugzilla-files/zip.sh
index a923cb5..b35117f 100755
--- a/test-bugzilla-files/zip.sh
+++ b/test-bugzilla-files/zip.sh
@@ -9,7 +9,7 @@ mkdir -p /srv/crashtestdata/logs/$SHA/backtraces
 for a in */core*; do gdb ~/build/instdir/program/soffice.bin $a -ex "thread 
apply all backtrace full" --batch > 
/srv/crashtestdata/logs/$SHA/backtraces/`dirname "$a"`-`basename 
"$a"`.backtrace.txt; done
 cat */crashlog.txt > /srv/crashtestdata/logs/$SHA/crashlog.txt
 cat */exportCrash.txt > /srv/crashtestdata/logs/$SHA/exportCrash.txt
-echo "attr-diff-count,filename,node-diff-count,total-diff-count" > 
/srv/crashtestdata/logs/$SHA/odfundifflog.csv
+echo "filename,total-diff-count,attr-diff-count,node-diff-count" > 
/srv/crashtestdata/logs/$SHA/odfundifflog.csv
 cat */odfundifflog.csv >> /srv/crashtestdata/logs/$SHA/odfundifflog.csv
 # Ignore the header.
 num_of_odf_diffs=$(($(< "/srv/crashtestdata/logs/$SHA/odfundifflog.csv" wc 
-l)-1))