[LNT] r212736 - Change submit so that the results from the server can be used on the client.

Chris Matthews cmatthews5 at apple.com
Thu Jul 10 09:59:44 PDT 2014


Author: cmatthews
Date: Thu Jul 10 11:59:44 2014
New Revision: 212736

URL: http://llvm.org/viewvc/llvm-project?rev=212736&view=rev
Log:
Change submit so that the results from the server can be used on the client.

Rename results to server_report, to help distinguish between that and the local report object.

Make submit pass on the commit flag.

Return the server report so that the client can use it.

Modified:
    lnt/trunk/lnt/tests/builtintest.py

Modified: lnt/trunk/lnt/tests/builtintest.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/tests/builtintest.py?rev=212736&r1=212735&r2=212736&view=diff
==============================================================================
--- lnt/trunk/lnt/tests/builtintest.py (original)
+++ lnt/trunk/lnt/tests/builtintest.py Thu Jul 10 11:59:44 2014
@@ -9,7 +9,7 @@ from lnt.testing.util.misc import timest
 
 import lnt.util.ServerUtil as ServerUtil 
 import lnt.util.ImportData as ImportData
-
+import lnt.server.config as server_config
 import lnt.server.db.v4db
 import lnt.server.config
 
@@ -46,7 +46,7 @@ class BuiltinTest(object):
         if output_stream is not sys.stdout:
             output_stream.close()
 
-    def submit(self, report_path, config, commit=True, print_report=True):
+    def submit(self, report_path, config, commit=True):
         """Submit the results file to the server.  If no server
         was specified, use a local mock server.
         
@@ -55,15 +55,17 @@ class BuiltinTest(object):
         is true, results will be saved in the server, otherwise you
         will just get back a report but server state is not altered.
 
-        Returns the report generated by the LNT server.
+        Returns the report from the server.
         """
-        assert os.path.exists(report_path), "Failed report should have never gotten here!"
-        result = None
+        assert os.path.exists(report_path), "Failed report should have" \
+            " never gotten here!"
+
+        server_report = None
         if config.submit_url is not None:
             self.log("submitting result to %r" % (config.submit_url,))
-            commit = True
-            result = ServerUtil.submitFile(config.submit_url, report_path,
-                                           commit, config.verbose)
+            server_report = ServerUtil.submitFile(config.submit_url,
+                                                  report_path,
+                                                  commit)
         else:
             # Simulate a submission to retrieve the results report.
 
@@ -71,12 +73,12 @@ class BuiltinTest(object):
             self.log("submitting result to dummy instance")
 
             db = lnt.server.db.v4db.V4DB("sqlite:///:memory:",
-                                         lnt.server.config.Config.dummyInstance())
-            result = ImportData.import_and_report(
-                None, None, db, report_path, 'json', commit = True)
-        assert result is not None, "Results were not submitted."
-        if print_report:
-            ImportData.print_report_result(result, sys.stdout, sys.stderr,
-                                           config.verbose)
-        return result
-
+                                         server_config.Config.dummyInstance())
+            server_report = ImportData.import_and_report(
+                None, None, db, report_path, 'json', commit)
+
+        assert server_report is not None, "Results were not submitted."
+
+        ImportData.print_report_result(server_report, sys.stdout, sys.stderr,
+                                       config.verbose)
+        return server_report





More information about the llvm-commits mailing list