[Libreoffice-commits] dev-tools.git: 3 commits - qa/bugzillaChecker.py uitest/mass-testing

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Mon Jul 1 15:23:37 UTC 2019


 qa/bugzillaChecker.py      |   11 +-
 uitest/mass-testing/run.py |  191 ++++++++++++++++++++++-----------------------
 2 files changed, 105 insertions(+), 97 deletions(-)

New commits:
commit c6aa93194bb3a9e20dfc57f48f72dc90d935d8da
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Jun 27 19:08:40 2019 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Mon Jul 1 17:22:46 2019 +0200

    QA: Check for inactive unconfirmed enhancements

diff --git a/qa/bugzillaChecker.py b/qa/bugzillaChecker.py
index 7085fca..5eb7f66 100755
--- a/qa/bugzillaChecker.py
+++ b/qa/bugzillaChecker.py
@@ -288,7 +288,7 @@ def analyze_bugzilla_checkers(statList, bugzillaData, cfg):
                 common.util_check_bugzilla_mail(statList, commentMail, '', commentDate, rowId)
 
             if len(comments) > 0:
-                if rowStatus == 'UNCONFIRMED' and 'needsDevAdvice' not in rowKeywords:
+                if rowStatus == 'UNCONFIRMED' and 'needsDevAdvice' not in rowKeywords and row['severity'] != 'enhancement':
                     if comments[-1]['creator'] != creatorMail and '[Automated Action]' not in comments[-1]['text'] and \
                         datetime.datetime.strptime(row['last_change_time'], "%Y-%m-%dT%H:%M:%SZ") < cfg['retestUnconfirmedPeriod']:
                         value = [ rowId, row['last_change_time'], comments[-1]['creator'] ]
@@ -298,6 +298,11 @@ def analyze_bugzilla_checkers(statList, bugzillaData, cfg):
                         value = [ rowId, row['last_change_time'], comments[-1]['creator'] ]
                         util_add_to_result(lResults, 'unconfirmed_last_comment_from_reporter', value)
 
+            if rowStatus == 'UNCONFIRMED' and row['severity'] == 'enhancement' and 'QA:needsComment' not in row['whiteboard'] and \
+                    datetime.datetime.strptime(row['last_change_time'], "%Y-%m-%dT%H:%M:%SZ") < cfg['retestUnconfirmedPeriod']:
+                value = [ rowId, creationDate, creatorMail ]
+                util_add_to_result(lResults, 'inactive_unconfirmed_enhacements', value)
+
             if autoFixed:
                 util_add_to_result(lResults, 'auto_fixed', autoFixedValue)
 
commit 0f532905265e17c040e69281d87651db318c8dee
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Wed Jun 19 14:38:28 2019 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Mon Jul 1 17:22:46 2019 +0200

    mass-uitesting: Use a tmp folder for the profile

diff --git a/uitest/mass-testing/run.py b/uitest/mass-testing/run.py
index 18f45a7..0c20706 100755
--- a/uitest/mass-testing/run.py
+++ b/uitest/mass-testing/run.py
@@ -15,6 +15,7 @@ from shutil import copyfile
 import pickle
 import time
 import fcntl
+import tempfile
 
 extensions = {
     'writer' : [ "odt", "doc", "docx", "rtf" ],
@@ -64,12 +65,6 @@ def get_file_names(component, filesPath):
 
 def run_tests_and_get_results(liboPath, listFiles, isDebug, isResume):
 
-    #Create directory for the user profile
-    profilePath = '/tmp/libreoffice/4/'
-    userPath = profilePath + 'user/'
-    if not os.path.exists(userPath):
-        os.makedirs(userPath)
-
     results = {
         'pass' : 0,
         'fail' : 0,
@@ -103,105 +98,112 @@ def run_tests_and_get_results(liboPath, listFiles, isDebug, isResume):
                 print("SKIP: " + fileName)
                 continue
 
-        # Replace the profile file with
-        # 1. DisableMacrosExecution = True
-        # 2. IgnoreProtectedArea = True
-        # 3. AutoPilot = False
-        copyfile(os.getcwd() + '/registrymodifications.xcu', userPath + 'registrymodifications.xcu')
-
-        #TODO: Find a better way to pass fileName parameter
-        os.environ["TESTFILENAME"] = fileName
-
-        process = Popen(["python3.5",
-                    liboPath + "uitest/test_main.py",
-                    "--debug",
-                    "--soffice=path:" + sofficePath,
-                    "--userdir=file://" + profilePath,
-                    "--file=" + component + ".py"], stdin=PIPE, stdout=PIPE, stderr=PIPE,
-                    preexec_fn=os.setsid)
-
-        # Do not block on process.stdout
-        fcntl.fcntl(process.stdout.fileno(), fcntl.F_SETFL, os.O_NONBLOCK)
-
-        # Kill the process if:
-        # 1. The file can't be loaded in 'fielInterval' seconds
-        # 2. The test can't be executed in 'testInterval' seconds
-        fileInterval = 10
-        testIternval = 20
-        timeout = time.time() + fileInterval
-        notLoaded = True
-        while True:
-            time.sleep(1)
-
-            if time.time() > timeout:
-                if notLoaded:
-                    logger.info("SKIP: " + fileName)
-                    results['skip'] += 1
-                else:
-                    logger.info("TIMEOUT: " + fileName)
-                    results['timeout'] += 1
-
-                # kill popen process
-                os.killpg(process.pid, signal.SIGKILL)
-                break
-
-            try:
-                outputLines = process.stdout.readlines()
-            except IOError:
-                pass
-
-            importantInfo = ''
-            isFailure = False
-            for line in outputLines:
-                line = line.decode("utf-8").strip()
-
-                if not line:
-                    continue
-
-                if isDebug:
-                    print(line)
-
-                if line.startswith("mass-uitesting:"):
-                    message = line.split(":")[1]
-                    if message == 'skipped':
-                        logger.info("SKIP: " + fileName + " : " + importantInfo)
+        #Create temp directory for the user profile
+        with tempfile.TemporaryDirectory() as tmpdirname:
+            profilePath = os.path.join(tmpdirname, 'libreoffice/4')
+            userPath = os.path.join(profilePath, 'user')
+            os.makedirs(userPath)
+
+            # Replace the profile file with
+            # 1. DisableMacrosExecution = True
+            # 2. IgnoreProtectedArea = True
+            # 3. AutoPilot = False
+            copyfile(os.getcwd() + '/registrymodifications.xcu', userPath + '/registrymodifications.xcu')
+
+            #TODO: Find a better way to pass fileName parameter
+            os.environ["TESTFILENAME"] = fileName
+
+            process = Popen(["python3.5",
+                        liboPath + "uitest/test_main.py",
+                        "--debug",
+                        "--soffice=path:" + sofficePath,
+                        "--userdir=file://" + profilePath,
+                        "--file=" + component + ".py"], stdin=PIPE, stdout=PIPE, stderr=PIPE,
+                        preexec_fn=os.setsid)
+
+            # Do not block on process.stdout
+            fcntl.fcntl(process.stdout.fileno(), fcntl.F_SETFL, os.O_NONBLOCK)
+
+            # Kill the process if:
+            # 1. The file can't be loaded in 'fielInterval' seconds
+            # 2. The test can't be executed in 'testInterval' seconds
+            fileInterval = 10
+            testIternval = 20
+            timeout = time.time() + fileInterval
+            notLoaded = True
+            while True:
+                time.sleep(1)
+
+                if time.time() > timeout:
+                    if notLoaded:
+                        logger.info("SKIP: " + fileName)
                         results['skip'] += 1
+                    else:
+                        logger.info("TIMEOUT: " + fileName)
+                        results['timeout'] += 1
 
-                        # kill popen process
-                        os.killpg(process.pid, signal.SIGKILL)
+                    # kill popen process
+                    os.killpg(process.pid, signal.SIGKILL)
+                    break
 
-                        break
-                    elif message == 'loaded':
-                        notLoaded = False
+                try:
+                    outputLines = process.stdout.readlines()
+                except IOError:
+                    pass
 
-                        #Extend timeout
-                        timeout += testIternval
+                importantInfo = ''
+                isFailure = False
+                for line in outputLines:
+                    line = line.decode("utf-8").strip()
 
-                elif 'Execution time' in line:
-                    importantInfo = line.split('for ')[1]
+                    if not line:
+                        continue
 
-                elif importantInfo and 'error' == line.lower() or 'fail' == line.lower():
-                    isFailure = True
+                    if isDebug:
+                        print(line)
 
-            if importantInfo:
-                if isFailure:
-                    logger.info("FAIL: " + fileName + " : " + importantInfo)
-                    results['fail'] += 1
-                else:
-                    # No error found between the Execution time line and the end of stdout
-                    logger.info("PASS: " + fileName + " : " + str(importantInfo))
-                    results['pass'] += 1
+                    if line.startswith("mass-uitesting:"):
+                        message = line.split(":")[1]
+                        if message == 'skipped':
+                            logger.info("SKIP: " + fileName + " : " + importantInfo)
+                            results['skip'] += 1
 
-            if process.poll() is not None:
-                break
+                            # kill popen process
+                            os.killpg(process.pid, signal.SIGKILL)
 
-        if isResume:
-            filesRun[sourceHash]['files'].append(fileName)
+                            break
+                        elif message == 'loaded':
+                            notLoaded = False
+
+                            #Extend timeout
+                            timeout += testIternval
+
+                    elif 'Execution time' in line:
+                        importantInfo = line.split('for ')[1]
+
+                    elif importantInfo and 'error' == line.lower() or 'fail' == line.lower():
+                        isFailure = True
+
+                if importantInfo:
+                    if isFailure:
+                        logger.info("FAIL: " + fileName + " : " + importantInfo)
+                        results['fail'] += 1
+                    else:
+                        # No error found between the Execution time line and the end of stdout
+                        logger.info("PASS: " + fileName + " : " + str(importantInfo))
+                        results['pass'] += 1
+
+                if process.poll() is not None:
+                    break
+
+            if isResume:
+                filesRun[sourceHash]['files'].append(fileName)
+
+                filesRun[sourceHash]['results'] = results
 
-            filesRun[sourceHash]['results'] = results
+                with open(pklFile, 'wb') as pickle_out:
+                    pickle.dump(filesRun, pickle_out)
 
-            with open(pklFile, 'wb') as pickle_out:
-                pickle.dump(filesRun, pickle_out)
 
     totalTests = sum(results.values())
     if totalTests > 0:
@@ -254,6 +256,7 @@ if __name__ == '__main__':
     logger = start_logger(component)
 
     listFiles = get_file_names(component, filesPath)
+    listFiles.sort()
 
     run_tests_and_get_results(liboPath, listFiles, argument.debug, argument.resume)
 
commit 9a5bad46c61adf8f7995e1792e5953edb2ebb587
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Tue Jun 11 10:28:55 2019 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Mon Jul 1 17:22:46 2019 +0200

    QA: only check the first 2 digits in the version

diff --git a/qa/bugzillaChecker.py b/qa/bugzillaChecker.py
index 0b54709..7085fca 100755
--- a/qa/bugzillaChecker.py
+++ b/qa/bugzillaChecker.py
@@ -143,14 +143,14 @@ def analyze_bugzilla_checkers(statList, bugzillaData, cfg):
                             elif addedVersion == 'Inherited From OOo':
                                 addedVersion = 0
                             else:
-                                addedVersion = int(''.join([s for s in re.split('\.|\s',addedVersion) if s.isdigit()]).ljust(3, '0')[:3] )
+                                addedVersion = int(''.join([s for s in re.split('\.|\s',addedVersion) if s.isdigit()]).ljust(3, '0')[:2] )
 
                             if removedVersion == 'unspecified':
                                 removedVersion = 999999
                             elif removedVersion == 'Inherited From OOo':
                                 removedVersion = 0
                             else:
-                                removedVersion = int(''.join([s for s in re.split('\.|\s',removedVersion) if s.isdigit()]).ljust(3, '0')[:3] )
+                                removedVersion = int(''.join([s for s in re.split('\.|\s',removedVersion) if s.isdigit()]).ljust(3, '0')[:2] )
 
                             if removedVersion < oldestVersion:
                                 oldestVersion = removedVersion


More information about the Libreoffice-commits mailing list