[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py
test-bugzilla-files/new-control.py |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit e2cd0bff8726fad5c3971a00a75be628a60eeb75 Author: Gabor Kelemen AuthorDate: Thu Oct 13 22:09:03 2022 +0200 Commit: Caolán McNamara CommitDate: Thu Oct 13 23:49:38 2022 +0200 Use CRASHTESTDATA here as well otherwise it does not find the files under a non-default root dir Change-Id: I50790aa5acea8cba4484528cf3ce37b418e3699d Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/141343 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/test-bugzilla-files/new-control.py b/test-bugzilla-files/new-control.py index 1b68127..60010ca 100644 --- a/test-bugzilla-files/new-control.py +++ b/test-bugzilla-files/new-control.py @@ -169,7 +169,7 @@ if __name__ == "__main__": else: print('%r successfully passed' % (task)) -exported_files = get_list_of_files(os.environ["CRASHTESTDATA"] + "/current/srv/crashtestdata/files/") +exported_files = get_list_of_files(os.environ["CRASHTESTDATA"] + "/current/" + os.environ["CRASHTESTDATA"] + "/files/") checkDiskSpace() if os.getenv('SAVEPREVIOUSSTATE'):
[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py
test-bugzilla-files/new-control.py |1 + 1 file changed, 1 insertion(+) New commits: commit ff26f0789b6fc1577e2e1ba77ed69cdac49b039a Author: Gabor Kelemen AuthorDate: Mon Oct 10 23:02:48 2022 +0200 Commit: Caolán McNamara CommitDate: Tue Oct 11 10:41:15 2022 +0200 Remove task file after use Change-Id: Ic44c4ad2cecf9339b68c990492757a041458928f Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/141196 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/test-bugzilla-files/new-control.py b/test-bugzilla-files/new-control.py index 59dcebe..1b68127 100644 --- a/test-bugzilla-files/new-control.py +++ b/test-bugzilla-files/new-control.py @@ -52,6 +52,7 @@ def execute_task(task_file, asan): elif asan == 0: subprocess.call("./execute.sh " + task_file, shell=True) time.sleep(1) +os.remove(task_file) def saveAsPreviousState(exported_files): odf_file_ext = ['odt', 'odp', 'odb', 'ods', 'odg']
[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py
test-bugzilla-files/new-control.py | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) New commits: commit 5a9fa894bb0e546fc0d825ee3458b89ffce7fd27 Author: Gabor Kelemen AuthorDate: Fri Aug 19 15:31:48 2022 +0200 Commit: Caolán McNamara CommitDate: Wed Sep 14 11:46:05 2022 +0200 Use more CRASHTESTDATA in new-control.py Change-Id: Iddc214708a1c040d9ab974450ad5093b0ef209ef Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/138719 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/test-bugzilla-files/new-control.py b/test-bugzilla-files/new-control.py index e50f01f..cda4cb7 100644 --- a/test-bugzilla-files/new-control.py +++ b/test-bugzilla-files/new-control.py @@ -55,23 +55,23 @@ def execute_task(task_file, asan): def saveAsPreviousState(exported_files): odf_file_ext = ['odt', 'odp', 'odb', 'ods', 'odg'] -previous_path = "/srv/crashtestdata/previous" +previous_path = os.environ["CRASHTESTDATA"] + "/previous" if os.path.exists(previous_path): rmtree(previous_path) for ext in odf_file_ext: -os.makedirs(previous_path + "/srv/crashtestdata/files/"+ ext) +os.makedirs(previous_path + os.environ["CRASHTESTDATA"] + "/files/"+ ext) -prefix = "/srv/crashtestdata/current" +prefix = os.environ["CRASHTESTDATA"] + "/current" for file in exported_files: ext = file[-3:] if ext in odf_file_ext and os.path.exists(file): - os.makedirs(os.path.dirname("/srv/crashtestdata/previous"+file[len(prefix):]), exist_ok=True) -copyfile(file, "/srv/crashtestdata/previous"+file[len(prefix):]) +os.makedirs(os.path.dirname(os.environ["CRASHTESTDATA"] + "/previous"+file[len(prefix):]), exist_ok=True) +copyfile(file, os.environ["CRASHTESTDATA"] + "/previous"+file[len(prefix):]) SHAcmd = "cd $SRCDIR && git rev-parse HEAD" previous_SHA = str(subprocess.check_output(SHAcmd, shell=True), encoding='utf-8') -previous_SHA_file = open("/srv/crashtestdata/previous/hash.txt", "w") +previous_SHA_file = open(os.environ["CRASHTESTDATA"] + "/previous/hash.txt", "w") previous_SHA_file.write(previous_SHA) previous_SHA_file.close() @@ -91,7 +91,7 @@ def checkDiskSpace(): freeGiB = free // (2**30) disk_space_limit = int(os.environ["DISKSPACELIMIT"]) if freeGiB <= disk_space_limit: -diskusagefile = open("/srv/crashtestdata/diskusageinfo.txt", "w") +diskusagefile = open(os.environ["CRASHTESTDATA"] + "/diskusageinfo.txt", "w") diskusagefile.write(str(freeGiB)) diskusagefile.close() @@ -101,7 +101,7 @@ def checkCPULoadAverage(): cpu_loadavg_limit = float(os.environ["CPULOADAVGLIMIT"]) if cpuload > cpu_loadavg_limit: -cpuusagefile = open("/srv/crashtestdata/cpuusageinfo.txt", "w") +cpuusagefile = open(os.environ["CRASHTESTDATA"] + "/cpuusageinfo.txt", "w") cpuusagefile.write(str(cpuload)) cpuusagefile.close() @@ -168,7 +168,7 @@ if __name__ == "__main__": else: print('%r successfully passed' % (task)) -exported_files = get_list_of_files("/srv/crashtestdata/current/srv/crashtestdata/files/") +exported_files = get_list_of_files(os.environ["CRASHTESTDATA"] + "/current/srv/crashtestdata/files/") checkDiskSpace() if os.getenv('SAVEPREVIOUSSTATE'):
[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py test-bugzilla-files/zip.sh
test-bugzilla-files/new-control.py |6 ++ test-bugzilla-files/zip.sh |2 ++ 2 files changed, 8 insertions(+) New commits: commit 53866cbb747772cfbad8f39bac7fb94a1fa9fbee Author: Gülşah Köse AuthorDate: Fri Oct 8 12:08:02 2021 +0300 Commit: Miklos Vajna CommitDate: Fri Oct 8 13:28:43 2021 +0200 Give info about about previous state of version. We add info into the mail about which version of the LibreOffice is created the previous state. Change-Id: I8b05e27ed61c198eee54003ad8e1c01c2c8377b6 Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/123252 Tested-by: Miklos Vajna Reviewed-by: Miklos Vajna diff --git a/test-bugzilla-files/new-control.py b/test-bugzilla-files/new-control.py index 6635db6..e8cc89f 100644 --- a/test-bugzilla-files/new-control.py +++ b/test-bugzilla-files/new-control.py @@ -69,6 +69,12 @@ def saveAsPreviousState(exported_files): os.makedirs(os.path.dirname("/srv/crashtestdata/previous"+file[len(prefix):]), exist_ok=True) copyfile(file, "/srv/crashtestdata/previous"+file[len(prefix):]) +SHAcmd = "cd ~/source/libo-core/ && git rev-parse HEAD" +previous_SHA = str(subprocess.check_output(SHAcmd, shell=True), encoding='utf-8') +previous_SHA_file = open("/srv/crashtestdata/previous/hash.txt", "w") +previous_SHA_file.write(previous_SHA) +previous_SHA_file.close() + def get_list_of_files(directory_name): list_of_file = os.listdir(directory_name) all_files = list() diff --git a/test-bugzilla-files/zip.sh b/test-bugzilla-files/zip.sh index 7a1acad..2c4faf4 100755 --- a/test-bugzilla-files/zip.sh +++ b/test-bugzilla-files/zip.sh @@ -14,6 +14,7 @@ num_of_odf_diffs=$(< "/srv/crashtestdata/logs/$SHA/odfundifflog.txt" wc -l) num_of_import_crashes=$(< "/srv/crashtestdata/logs/$SHA/crashlog.txt" wc -l) num_of_export_crashes=$(< "/srv/crashtestdata/logs/$SHA/exportCrash.txt" wc -l) num_of_excluded_file=$(< "/srv/crashtestdata/odfundiff_exclude_list.txt" wc -l) +previous_hash="$(cat /srv/crashtestdata/previous/hash.txt)" rm -rf /srv/crashtestdata/logs/$SHA/odfundiff cd /srv/crashtestdata/current/srv/crashtestdata/files/ zip -r -q odfundiff.zip */*.odfundiff @@ -63,6 +64,7 @@ $num_of_import_crashes files have crashed during import. $num_of_export_crashes files have crashed during export. $num_of_odf_diffs files have differences compared to the previous run. ($num_of_excluded_file files are excluded.) +Please note that previous state is saved with $previous_hash EOF
[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py
test-bugzilla-files/new-control.py |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) New commits: commit 09ee4776096e3f86360664aa7bf2783f4c7ba3fb Author: Gülşah Köse AuthorDate: Fri Oct 8 11:29:08 2021 +0300 Commit: Miklos Vajna CommitDate: Fri Oct 8 13:18:57 2021 +0200 Control the saving previous state. If SAVEPREVIOUSSTATE env is exist, tool will save the previous state Change-Id: If055e758d76798af50d94493e268deda7ca333cc Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/123251 Tested-by: Miklos Vajna Reviewed-by: Miklos Vajna diff --git a/test-bugzilla-files/new-control.py b/test-bugzilla-files/new-control.py index ee8befe..6635db6 100644 --- a/test-bugzilla-files/new-control.py +++ b/test-bugzilla-files/new-control.py @@ -164,5 +164,7 @@ if __name__ == "__main__": exported_files = get_list_of_files("/srv/crashtestdata/current/srv/crashtestdata/files/") checkDiskSpace() -saveAsPreviousState(exported_files) -checkDiskSpace() + +if os.getenv('SAVEPREVIOUSSTATE'): +saveAsPreviousState(exported_files) +checkDiskSpace()
[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py test-bugzilla-files/zip.sh
test-bugzilla-files/new-control.py | 16 test-bugzilla-files/zip.sh |7 +++ 2 files changed, 23 insertions(+) New commits: commit d26dac1442083ce330c17546d468f042cd90eee8 Author: Gülşah Köse AuthorDate: Fri Sep 17 14:31:55 2021 +0300 Commit: Miklos Vajna CommitDate: Tue Sep 21 09:26:46 2021 +0200 Show a warning if memory usage is higher than limit. If memory usage is higher than limit, we will add a warning line to mail body. Change-Id: Id18b391aad825f61dff0ba2c86f6cab6e4faf8f7 Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/122243 Tested-by: Miklos Vajna Reviewed-by: Miklos Vajna diff --git a/test-bugzilla-files/new-control.py b/test-bugzilla-files/new-control.py index a83c65a..ab82a08 100644 --- a/test-bugzilla-files/new-control.py +++ b/test-bugzilla-files/new-control.py @@ -98,6 +98,21 @@ def checkCPULoadAverage(): cpuusagefile.write(str(cpuload)) cpuusagefile.close() +def checkMemoryUsage(): +memory_info = dict((i.split()[0].rstrip(':'),int(i.split()[1])) for i in open('/proc/meminfo').readlines()) +total_memory = memory_info['MemTotal'] +# Not Total - Free, as that would include caches as well, which is not interesting for us. +used_memory = total_memory - memory_info['MemAvailable'] + +usage = used_memory / total_memory +usage_in_percent = round(round(usage, 2)*100) +limit = 90 + +if usage_in_percent > limit: +memoryusagefile = open(os.environ["CRASHTESTDATA"]+"/memoryusageinfo.txt", "w") +memoryusagefile.write(str(usage_in_percent)+'%') +memoryusagefile.close() + def usage(): message = """usage: {program} [option] dir" - h | --help: print usage information @@ -134,6 +149,7 @@ if __name__ == "__main__": checkCPULoadAverage() checkDiskSpace() +checkMemoryUsage() with concurrent.futures.ThreadPoolExecutor(max_workers=workers) as executor: future_to_task = {executor.submit(execute_task, task_file, asan): task_file for task_file in get_tasks(directory, task_size)} for future in concurrent.futures.as_completed(future_to_task): diff --git a/test-bugzilla-files/zip.sh b/test-bugzilla-files/zip.sh index a0c2202..1e5026e 100755 --- a/test-bugzilla-files/zip.sh +++ b/test-bugzilla-files/zip.sh @@ -46,6 +46,12 @@ if [ -e $cpuusagefile ]; then rm $cpuusagefile fi +memoryusagefile=$CRASHTESTDATA/memoryusageinfo.txt +if [ -e $memoryusagefile ]; then +memory_usage="$(cat $memoryusagefile)" +rm $memoryusagefile +fi + cat << EOF > mail.txt Hi, @@ -61,6 +67,7 @@ EOF [ ! -z "${free_disk_space}" ] && echo "Warning! Remaining disk space is ${free_disk_space} GiB." >> mail.txt && echo "" >> mail.txt [ ! -z "${cpu_usage}" ] && echo "Warning! CPU load average is ${cpu_usage}." >> mail.txt && echo "" >> mail.txt +[ ! -z "${memory_usage}" ] && echo "Warning! Memory usage is ${memory_usage}." >> mail.txt && echo "" >> mail.txt cat << EOF >> mail.txt - Your friendly crashtest bot
[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py test-bugzilla-files/zip.sh
test-bugzilla-files/new-control.py | 11 +++ test-bugzilla-files/zip.sh |8 2 files changed, 19 insertions(+) New commits: commit 6b7fd54d6da91b4253df19692a2ead2d22943f5c Author: Gülşah Köse AuthorDate: Thu Sep 16 19:03:46 2021 +0300 Commit: Miklos Vajna CommitDate: Fri Sep 17 10:11:34 2021 +0200 Show a warning if CPU load average is higher than limit. If CPU load average is higher than limit, we will add a warning line to mail body. Change-Id: If73f82e868639ca02bf224bf07bf0c37fcf1ec3a Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/122200 Tested-by: Miklos Vajna Reviewed-by: Miklos Vajna diff --git a/test-bugzilla-files/new-control.py b/test-bugzilla-files/new-control.py index 10479a4..a83c65a 100644 --- a/test-bugzilla-files/new-control.py +++ b/test-bugzilla-files/new-control.py @@ -88,6 +88,16 @@ def checkDiskSpace(): diskusagefile.write(str(freeGiB)) diskusagefile.close() +def checkCPULoadAverage(): +cpuload, _, _ = os.getloadavg() +cpuload /= float(os.cpu_count()) +limit = 0.9 + +if cpuload > limit: +cpuusagefile = open("/srv/crashtestdata/cpuusageinfo.txt", "w") +cpuusagefile.write(str(cpuload)) +cpuusagefile.close() + def usage(): message = """usage: {program} [option] dir" - h | --help: print usage information @@ -122,6 +132,7 @@ if __name__ == "__main__": if asan == 1: workers = 64 +checkCPULoadAverage() checkDiskSpace() with concurrent.futures.ThreadPoolExecutor(max_workers=workers) as executor: future_to_task = {executor.submit(execute_task, task_file, asan): task_file for task_file in get_tasks(directory, task_size)} diff --git a/test-bugzilla-files/zip.sh b/test-bugzilla-files/zip.sh index 0ad6f11..a0c2202 100755 --- a/test-bugzilla-files/zip.sh +++ b/test-bugzilla-files/zip.sh @@ -39,6 +39,13 @@ if [ -e $diskusagefile ]; then free_disk_space="$(cat $diskusagefile)" rm $diskusagefile fi + +cpuusagefile=$CRASHTESTDATA/cpuusageinfo.txt +if [ -e $cpuusagefile ]; then +cpu_usage="$(cat $cpuusagefile)" +rm $cpuusagefile +fi + cat << EOF > mail.txt Hi, @@ -53,6 +60,7 @@ $num_of_odf_diffs files have differences compared to the previous run. EOF [ ! -z "${free_disk_space}" ] && echo "Warning! Remaining disk space is ${free_disk_space} GiB." >> mail.txt && echo "" >> mail.txt +[ ! -z "${cpu_usage}" ] && echo "Warning! CPU load average is ${cpu_usage}." >> mail.txt && echo "" >> mail.txt cat << EOF >> mail.txt - Your friendly crashtest bot
[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py test-bugzilla-files/zip.sh
test-bugzilla-files/new-control.py | 13 - test-bugzilla-files/zip.sh | 11 +++ 2 files changed, 23 insertions(+), 1 deletion(-) New commits: commit 4f337cfd71a0047e134f4f80476efe3db16a96f5 Author: Gülşah Köse AuthorDate: Wed Sep 15 17:31:32 2021 +0300 Commit: Miklos Vajna CommitDate: Fri Sep 17 08:41:24 2021 +0200 Show a warning if remaining disk space less than 5 GiB We show a warning at the output of the command.sh. Then we added that warning to mail body. Change-Id: I87efd38dc7e370ed497c0f56ebb8e09a1dc26aa3 Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/122111 Tested-by: Miklos Vajna Reviewed-by: Miklos Vajna diff --git a/test-bugzilla-files/new-control.py b/test-bugzilla-files/new-control.py index f5faa0a..10479a4 100644 --- a/test-bugzilla-files/new-control.py +++ b/test-bugzilla-files/new-control.py @@ -23,7 +23,7 @@ import time import subprocess import getopt import sys -from shutil import copyfile, rmtree +from shutil import copyfile, rmtree, disk_usage def partition(l, n): for i in range(0, len(l), n): @@ -80,6 +80,14 @@ def get_list_of_files(directory_name): all_files.append(full_path) return all_files +def checkDiskSpace(): +total, used, free = disk_usage(os.environ["CRASHTESTDATA"]) +freeGiB = free // (2**30) +if freeGiB <= 5: +diskusagefile = open("/srv/crashtestdata/diskusageinfo.txt", "w") +diskusagefile.write(str(freeGiB)) +diskusagefile.close() + def usage(): message = """usage: {program} [option] dir" - h | --help: print usage information @@ -114,6 +122,7 @@ if __name__ == "__main__": if asan == 1: workers = 64 +checkDiskSpace() with concurrent.futures.ThreadPoolExecutor(max_workers=workers) as executor: future_to_task = {executor.submit(execute_task, task_file, asan): task_file for task_file in get_tasks(directory, task_size)} for future in concurrent.futures.as_completed(future_to_task): @@ -126,4 +135,6 @@ if __name__ == "__main__": print('%r successfully passed' % (task)) exported_files = get_list_of_files("/srv/crashtestdata/current/srv/crashtestdata/files/") +checkDiskSpace() saveAsPreviousState(exported_files) +checkDiskSpace() diff --git a/test-bugzilla-files/zip.sh b/test-bugzilla-files/zip.sh index b9bb808..92b9801 100755 --- a/test-bugzilla-files/zip.sh +++ b/test-bugzilla-files/zip.sh @@ -34,6 +34,11 @@ if [ -z "$CRASHTEST_NO_UPLOAD" ]; then ssh upl...@gimli.documentfoundation.org unzip -n /srv/www/dev-builds.libreoffice.org/crashtest/current.zip -d /srv/www/dev-builds.libreoffice.org/crashtest fi cd /srv/crashtestdata/ +diskusagefile=/srv/crashtestdata/diskusageinfo.txt +if [ -e $diskusagefile ]; then +free_disk_space="$(cat $diskusagefile)" +rm $diskusagefile +fi cat << EOF > mail.txt Hi, @@ -45,8 +50,14 @@ $num_of_import_crashes files have crashed during import. $num_of_export_crashes files have crashed during export. +EOF + +[ ! -z "${free_disk_space}" ] && echo "Warning! Remaining disk space is ${free_disk_space} GiB." >> mail.txt && echo "" >> mail.txt + +cat << EOF >> mail.txt - Your friendly crashtest bot EOF + if [ -z "$CRASHTEST_NO_EMAIL" ]; then /srv/crashtestdata/sendEmail -t libreoffice@lists.freedesktop.org -u "Crash test update" -m "$(cat /srv/crashtestdata/mail.txt)" -a logs/*.csv fi
[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py test-bugzilla-files/test-bugzilla-files.py
test-bugzilla-files/new-control.py |7 +-- test-bugzilla-files/test-bugzilla-files.py |3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) New commits: commit d07ab8251361bdfa3d0e6cf2ccaf88dfbd5dfdb9 Author: Gülşah Köse AuthorDate: Wed Sep 8 11:09:00 2021 +0300 Commit: Miklos Vajna CommitDate: Wed Sep 8 11:53:28 2021 +0200 Extend file formats to compare with odfundiff. Before we were comparing only odt files. Now we can compare ods, odb, odg and odp files too. Change-Id: Id10280b67989b8c8cc919f181b205e322a1d1670 Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/121803 Tested-by: Miklos Vajna Reviewed-by: Miklos Vajna diff --git a/test-bugzilla-files/new-control.py b/test-bugzilla-files/new-control.py index 9a56fa3..f5faa0a 100644 --- a/test-bugzilla-files/new-control.py +++ b/test-bugzilla-files/new-control.py @@ -54,10 +54,13 @@ def execute_task(task_file, asan): time.sleep(1) def saveAsPreviousState(exported_files): -odf_file_ext = ['odt'] +odf_file_ext = ['odt', 'odp', 'odb', 'ods', 'odg'] previous_path = "/srv/crashtestdata/previous" if os.path.exists(previous_path): -rmtree("/srv/crashtestdata/previous") +rmtree(previous_path) + +for ext in odf_file_ext: +os.makedirs(previous_path + "/srv/crashtestdata/files/"+ ext) prefix = "/srv/crashtestdata/current" for file in exported_files: diff --git a/test-bugzilla-files/test-bugzilla-files.py b/test-bugzilla-files/test-bugzilla-files.py index 710364d..0f2d7d3 100644 --- a/test-bugzilla-files/test-bugzilla-files.py +++ b/test-bugzilla-files/test-bugzilla-files.py @@ -668,8 +668,9 @@ if __name__ == "__main__": exclude_list = [line.rstrip() for line in exclude_list] if isPreviousExist(): +odf_file_ext = ['odt', 'odp', 'odb', 'ods', 'odg'] for filename in exportedFiles: -if filename[-3:] == 'odt': +if filename[-3:] in odf_file_ext: odfundiffCommandWithURL = getODFunDiffCommand() + " /srv/crashtestdata/previous" + filename + " /srv/crashtestdata/current" + filename print(odfundiffCommandWithURL) try:
[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py
test-bugzilla-files/new-control.py | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) New commits: commit 858af229a711dd6fa28878a095f8a3458c8af8a8 Author: Miklos Vajna AuthorDate: Tue Sep 7 08:34:34 2021 +0200 Commit: Miklos Vajna CommitDate: Tue Sep 7 08:34:34 2021 +0200 crashtest: also copy ODF output for non-ODF input to the previous/ dir We only copied ODF output for ODF input, but then tried to invoke odfundiff for both cases. Change-Id: Id3abe95e84d09a8aac6ca76e5b0345c1e2f030dc diff --git a/test-bugzilla-files/new-control.py b/test-bugzilla-files/new-control.py index 6807d8e..9a56fa3 100644 --- a/test-bugzilla-files/new-control.py +++ b/test-bugzilla-files/new-control.py @@ -55,16 +55,16 @@ def execute_task(task_file, asan): def saveAsPreviousState(exported_files): odf_file_ext = ['odt'] -previous_path = "/srv/crashtestdata/previous/srv/crashtestdata/files/odt" +previous_path = "/srv/crashtestdata/previous" if os.path.exists(previous_path): rmtree("/srv/crashtestdata/previous") -os.makedirs(previous_path) +prefix = "/srv/crashtestdata/current" for file in exported_files: ext = file[-3:] if ext in odf_file_ext and os.path.exists(file): - os.makedirs(os.path.dirname("/srv/crashtestdata/previous"+file[26:]), exist_ok=True) -copyfile(file, "/srv/crashtestdata/previous"+file[26:]) + os.makedirs(os.path.dirname("/srv/crashtestdata/previous"+file[len(prefix):]), exist_ok=True) +copyfile(file, "/srv/crashtestdata/previous"+file[len(prefix):]) def get_list_of_files(directory_name): list_of_file = os.listdir(directory_name) @@ -122,5 +122,5 @@ if __name__ == "__main__": else: print('%r successfully passed' % (task)) -exported_files = get_list_of_files("/srv/crashtestdata/current/srv/crashtestdata/files/odt/") +exported_files = get_list_of_files("/srv/crashtestdata/current/srv/crashtestdata/files/") saveAsPreviousState(exported_files)
[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py test-bugzilla-files/test-bugzilla-files.py
test-bugzilla-files/new-control.py | 28 test-bugzilla-files/test-bugzilla-files.py | 25 - 2 files changed, 32 insertions(+), 21 deletions(-) New commits: commit d7224055ba764836a6984afabd21853a6eed8fa4 Author: Gülşah Köse AuthorDate: Mon Sep 6 18:46:39 2021 +0300 Commit: Miklos Vajna CommitDate: Tue Sep 7 08:23:09 2021 +0200 Move previous dir handling out of the thread. Change-Id: I6fcd7f9e160975eb7730d87a9a667916ec934d5a Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/121582 Tested-by: Miklos Vajna Reviewed-by: Miklos Vajna diff --git a/test-bugzilla-files/new-control.py b/test-bugzilla-files/new-control.py index 79913bc..6807d8e 100644 --- a/test-bugzilla-files/new-control.py +++ b/test-bugzilla-files/new-control.py @@ -23,6 +23,7 @@ import time import subprocess import getopt import sys +from shutil import copyfile, rmtree def partition(l, n): for i in range(0, len(l), n): @@ -52,6 +53,30 @@ def execute_task(task_file, asan): subprocess.call("./execute.sh " + task_file, shell=True) time.sleep(1) +def saveAsPreviousState(exported_files): +odf_file_ext = ['odt'] +previous_path = "/srv/crashtestdata/previous/srv/crashtestdata/files/odt" +if os.path.exists(previous_path): +rmtree("/srv/crashtestdata/previous") +os.makedirs(previous_path) + +for file in exported_files: +ext = file[-3:] +if ext in odf_file_ext and os.path.exists(file): + os.makedirs(os.path.dirname("/srv/crashtestdata/previous"+file[26:]), exist_ok=True) +copyfile(file, "/srv/crashtestdata/previous"+file[26:]) + +def get_list_of_files(directory_name): +list_of_file = os.listdir(directory_name) +all_files = list() +for filename in list_of_file: +full_path = os.path.join(directory_name, filename) +if os.path.isdir(full_path): +all_files = all_files + get_list_of_files(full_path) +else: +all_files.append(full_path) +return all_files + def usage(): message = """usage: {program} [option] dir" - h | --help: print usage information @@ -96,3 +121,6 @@ if __name__ == "__main__": print('%r generated an exception: %s' % (task, exc)) else: print('%r successfully passed' % (task)) + +exported_files = get_list_of_files("/srv/crashtestdata/current/srv/crashtestdata/files/odt/") +saveAsPreviousState(exported_files) diff --git a/test-bugzilla-files/test-bugzilla-files.py b/test-bugzilla-files/test-bugzilla-files.py index 82fba62..0ade4eb 100644 --- a/test-bugzilla-files/test-bugzilla-files.py +++ b/test-bugzilla-files/test-bugzilla-files.py @@ -33,7 +33,6 @@ import sys import time import uuid import datetime -from shutil import copyfile, rmtree import signal import threading @@ -394,28 +393,15 @@ def exportDoc(xDoc, filterName, validationCommand, filename, connection, timer): except subprocess.CalledProcessError: pass # ignore that exception +def getODFunDiffCommand(): +return os.environ["HOME"] + "/source/bin/odfundiff-exe" + def isPreviousExist(): previous_path = "/srv/crashtestdata/previous" if os.path.exists(previous_path): return True return False -def saveAsPreviousState(exported_files): -odf_file_ext = ['odt'] -previous_path = "/srv/crashtestdata/previous/srv/crashtestdata/files/odt" -if os.path.exists(previous_path): -rmtree("/srv/crashtestdata/previous") -os.makedirs(previous_path) - -for file in exportedFiles: -ext = file[-3:] -if ext in odf_file_ext and os.path.exists("/srv/crashtestdata/current"+file): -os.makedirs(os.path.dirname("/srv/crashtestdata/previous"+file), exist_ok=True) -copyfile("/srv/crashtestdata/current"+file, "/srv/crashtestdata/previous"+file) - -def getODFunDiffCommand(): -return os.environ["HOME"] + "/source/bin/odfundiff-exe" - class ExportFileTest: def __init__(self, xDoc, filename, enable_validation, timer): self.xDoc = xDoc @@ -675,9 +661,7 @@ if __name__ == "__main__": # Check the roundtripped files doesn't crash at import time runLoadFileTests(opts, exportedFiles, False) -if not isPreviousExist(): -saveAsPreviousState(exportedFiles) -else: +if isPreviousExist(): for filename in exportedFiles: if filename[-3:] == 'odt': odfundiffCommandWithURL = getODFunDiffCommand() + " /srv/crashtestdata/previous" + filename + " /srv/crashtestdata/current" + filename @@ -691,7 +675,6 @@ if __name__ == "__main__": handleODFunDiff(filename) except subprocess.CalledProcessError: pass -saveAsPreviousState(exportedFiles) else: usage()
[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py
test-bugzilla-files/new-control.py |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit f237c6eae0eb4dc9b30e70f4efe7ce43fce9951a Author: Caolán McNamara AuthorDate: Mon Dec 10 10:05:58 2018 + Commit: Caolán McNamara CommitDate: Mon Dec 10 10:05:58 2018 + use better values for number of jobs diff --git a/test-bugzilla-files/new-control.py b/test-bugzilla-files/new-control.py index 68397bd..f234086 100644 --- a/test-bugzilla-files/new-control.py +++ b/test-bugzilla-files/new-control.py @@ -82,9 +82,9 @@ if __name__ == "__main__": sys.exit(1) task_size = 100 -workers = 20 +workers = 30 if asan == 1: -workers = 32 +workers = 64 with concurrent.futures.ThreadPoolExecutor(max_workers=workers) as executor: future_to_task = {executor.submit(execute_task, task_file, asan): task_file for task_file in get_tasks(directory, task_size)} ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py
test-bugzilla-files/new-control.py | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) New commits: commit 6e752a8be4ab9870b9c47c0f167c2530ed898c16 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Sat Dec 27 18:01:29 2014 +0100 fix script and use 32 processes for asan diff --git a/test-bugzilla-files/new-control.py b/test-bugzilla-files/new-control.py index 69dd9c4..ba90c6e 100644 --- a/test-bugzilla-files/new-control.py +++ b/test-bugzilla-files/new-control.py @@ -61,21 +61,15 @@ def usage(): if __name__ == __main__: opts, args = getopt.getopt(sys.argv[1:], hd:a, [help, directory=, asan]) -print(args) -print(opts) if -h in opts or --help in opts: usage() sys.exit() asan = 0 -print(opts[0]) -print(--asan in opts[0]) -if --asan in opts[0]: +if opts.count() 0 and --asan in opts[0]: print(yeah) asan = 1 -print(asan) - if len(args) == 0: usage() sys.exit(1) @@ -88,7 +82,11 @@ if __name__ == __main__: sys.exit(1) task_size = 100 -with concurrent.futures.ThreadPoolExecutor(max_workers=20) as executor: +workers = 20 +if asan == 1: +workers = 32 + +with concurrent.futures.ThreadPoolExecutor(max_workers=workers) as executor: future_to_task = {executor.submit(execute_task, task_file, asan): task_file for task_file in get_tasks(directory, task_size)} for future in concurrent.futures.as_completed(future_to_task): task = future_to_task[future] ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py
test-bugzilla-files/new-control.py |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 0bc66edb6a63464c3cab2a79b3b8f96ce1c18d10 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Sat Dec 27 18:37:05 2014 +0100 fix my stupid error diff --git a/test-bugzilla-files/new-control.py b/test-bugzilla-files/new-control.py index ba90c6e..4c8e7d7 100644 --- a/test-bugzilla-files/new-control.py +++ b/test-bugzilla-files/new-control.py @@ -66,7 +66,7 @@ if __name__ == __main__: sys.exit() asan = 0 -if opts.count() 0 and --asan in opts[0]: +if count(opts) 0 and --asan in opts[0]: print(yeah) asan = 1 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py
test-bugzilla-files/new-control.py |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 4fa837d13950b86f5e0af2b55fced9aa2efdb74e Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Sat Dec 27 19:05:22 2014 +0100 correct fix diff --git a/test-bugzilla-files/new-control.py b/test-bugzilla-files/new-control.py index 4c8e7d7..68397bd 100644 --- a/test-bugzilla-files/new-control.py +++ b/test-bugzilla-files/new-control.py @@ -66,7 +66,7 @@ if __name__ == __main__: sys.exit() asan = 0 -if count(opts) 0 and --asan in opts[0]: +if len(opts) 0 and --asan in opts[0]: print(yeah) asan = 1 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py
test-bugzilla-files/new-control.py |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 3228b8cbd5710083c13eaae354daa88a0541d5f6 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Fri Nov 21 21:55:32 2014 +0100 use new limit for better server diff --git a/test-bugzilla-files/new-control.py b/test-bugzilla-files/new-control.py index c278a2a..a195d39 100644 --- a/test-bugzilla-files/new-control.py +++ b/test-bugzilla-files/new-control.py @@ -75,7 +75,7 @@ if __name__ == __main__: sys.exit(1) task_size = 100 -with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor: +with concurrent.futures.ThreadPoolExecutor(max_workers=20) as executor: future_to_task = {executor.submit(execute_task, task_file): task_file for task_file in get_tasks(directory, task_size)} for future in concurrent.futures.as_completed(future_to_task): task = future_to_task[future] ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits