test-bugzilla-files/test-bugzilla-files.py |   29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

New commits:
commit 3bd76e3e969c25fd1021dea12ab53653625bbf8e
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Mon Nov 11 17:31:39 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon Nov 11 17:31:39 2024 +0000

    use AbortOnLoadFailure to assert if we can't load our own output

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 689843ed..648e17cc 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -267,10 +267,10 @@ def getComponent(xDoc):
 
 ### tests ###
 
-def loadFromURL(xContext, url, t):
+def loadFromURL(xContext, url, t, AbortOnLoadFailure):
     xDesktop = xContext.ServiceManager.createInstanceWithContext(
             "com.sun.star.frame.Desktop", xContext)
-    props = [("Hidden", True), ("ReadOnly", True)] # FilterName?
+    props = [("Hidden", True), ("ReadOnly", True), ("AbortOnLoadFailure", 
AbortOnLoadFailure)] # FilterName?
     loadProps = tuple([mkPropertyValue(name, value) for (name, value) in 
props])
 
     xListener = EventListener()
@@ -548,8 +548,11 @@ class LoadFileTest:
             xDoc = None
             args = [connection]
             t = threading.Timer(self.timer.getImportTime(), alarm_handler, 
args)
-            t.start()      
-            xDoc = loadFromURL(xContext, url, t)
+            t.start()
+            # when doExport is false we are reloading out own output, so force
+            # that to abort on failure to load to detect if we cannot load our
+            # own output
+            xDoc = loadFromURL(xContext, url, t, not self.doExport)
             print("doc loaded")
             t.cancel()
             if xDoc and self.doExport:
commit 108c5b4fb4321bccfb4b23b44752d145a2d0fafe
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Mon Nov 11 17:29:55 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon Nov 11 17:29:55 2024 +0000

    don't remove exported files before roundtripping
    
    a problem since:
    
    commit ff73b7b3c312b9da1e7fa929b32200859061edac
    CommitDate: Wed Dec 14 10:41:52 2022 +0000
    
        remove exported files immediately after no longer need them
    
    but the roundtrip import wasn't looking in the right place anyway.

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 794de8b7..689843ed 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -414,11 +414,6 @@ def exportDoc(xDoc, filterName, validationCommand, 
filename, connection, timer):
         except subprocess.CalledProcessError:
             pass # ignore that exception
 
-    try:
-        os.remove(filePath)
-    except Exception:
-        pass
-
 def getODFunDiffCommand():
     return os.environ["HOME"] + "/source/bin/odfundiff-exe"
 
@@ -697,6 +692,14 @@ if __name__ == "__main__":
                             handleODFunDiff(filename, output)
                     except subprocess.CalledProcessError:
                         pass
+
+        # remove exported files so used size doesn't balloon
+        for filePath in exportedFileLocations:
+            try:
+                os.remove(filePath)
+            except Exception:
+                pass
+
     else:
         usage()
         sys.exit(1)
commit 3fde518eded1accdd4fd0307659d26132b136ccc
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Mon Nov 11 17:27:28 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon Nov 11 17:27:28 2024 +0000

    roundtripped import attempt doesn't look in the right place for input
    
    not that it matters, because the input is not at the right place
    either.

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index fdfcaad7..794de8b7 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -665,7 +665,10 @@ if __name__ == "__main__":
         exportedFiles = runLoadFileTests(opts, files, True)
 
         # Check the roundtripped files doesn't crash at import time
-        runLoadFileTests(opts, exportedFiles, False)
+        exportedFileLocations = []
+        for filename in exportedFiles:
+            exportedFileLocations.append(os.environ["CRASHTESTDATA"] + 
"/current" + filename)
+        runLoadFileTests(opts, exportedFileLocations, False)
 
         exclude_list = []
         if os.path.exists(os.environ["CRASHTESTDATA"] + 
"/odfundiff_exclude_list.txt"):

Reply via email to