[gnome-continuous] integrationtest: Collect test results from gnome-desktop-testing-runner



commit 5e1cbc0970f209d44e51cadca29583b1839fb319
Author: Colin Walters <walters verbum org>
Date:   Fri Nov 22 17:52:19 2013 -0500

    integrationtest: Collect test results from gnome-desktop-testing-runner
    
    Then the web UI can present this in a useful way.

 src/js/tasks/task-integrationtest.js |   23 +++++++++++++++++++++--
 src/js/tasks/testbase.js             |    8 ++++----
 2 files changed, 25 insertions(+), 6 deletions(-)
---
diff --git a/src/js/tasks/task-integrationtest.js b/src/js/tasks/task-integrationtest.js
index db5cbea..06649a7 100644
--- a/src/js/tasks/task-integrationtest.js
+++ b/src/js/tasks/task-integrationtest.js
@@ -58,13 +58,30 @@ const TaskIntegrationTest = new Lang.Class({
     CompletedTag: 'integrated',
     
     _handleMessage: function(message, cancellable) {
-        if (message['MESSAGE_ID'] == "0eee66bf98514369bef9868327a43cf1") {
-            print(message['MESSAGE']);
+        let gdtrTest = message['GDTR_TEST'];
+        if (!gdtrTest)
+            return;
+        let msgId = message['MESSAGE_ID'];
+        if (!msgId)
+            return;
+        let msg = message['MESSAGE'];
+        if (msgId == "0eee66bf98514369bef9868327a43cf1") {
             this._oneTestFailed = true;
+            this._allTests[gdtrTest] = 'failed';
+        } else if (msgId == 'ca0b037012363f1898466829ea163e7d') {
+            this._allTests[gdtrTest] = 'skipped';
+        } else if (msgId == '142bf5d40e9742e99d3ac8c1ace83b36') {
+            this._allTests[gdtrTest] = 'success';
+        } else {
+            return;
         }
+        print(msg);
     },
 
     _postQemu: function(cancellable) {
+        let testsJson = Gio.File.new_for_path('installed-test-results.json');
+        JSONUtil.writeJsonFileAtomic(testsJson, this._allTests, null);
+
         if (this._oneTestFailed) {
             throw new Error("Not all tests passed");
         }
@@ -105,5 +122,7 @@ Type=Application\n';
         GSystem.file_ensure_directory(dest.get_parent(), true, cancellable);
         dest.replace_contents(desktopFile, null, false, Gio.FileCreateFlags.REPLACE_DESTINATION,
                               cancellable);
+
+        this._allTests = {};
     }
 });
diff --git a/src/js/tasks/testbase.js b/src/js/tasks/testbase.js
index 2162ab3..2b86859 100644
--- a/src/js/tasks/testbase.js
+++ b/src/js/tasks/testbase.js
@@ -498,14 +498,14 @@ const TestOneDisk = new Lang.Class({
 
         GLib.source_remove(timeoutId);
         
-        if (this._failed) {
-            throw new Error(this._failedMessage);
-        }
-
         GSystem.shutil_rm_rf(diskClone, cancellable);
 
         this._parentTask._postQemu(cancellable);
 
+        if (this._failed) {
+            throw new Error(this._failedMessage);
+        }
+
         print("Completed testing of " + diskPath.get_basename());
     }
 });


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]