[LNT] r308860 - runtest: Do not print result URL when not submitting

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 23 18:04:42 PDT 2017


Author: matze
Date: Sun Jul 23 18:04:42 2017
New Revision: 308860

URL: http://llvm.org/viewvc/llvm-project?rev=308860&view=rev
Log:
runtest: Do not print result URL when not submitting

Avoid `lnt runtest` printing "Results available at: db_None/v4/nts/1"
when not submitting the results.

Modified:
    lnt/trunk/lnt/tests/builtintest.py
    lnt/trunk/lnt/tests/test_suite.py
    lnt/trunk/lnt/util/ImportData.py

Modified: lnt/trunk/lnt/tests/builtintest.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/tests/builtintest.py?rev=308860&r1=308859&r2=308860&view=diff
==============================================================================
--- lnt/trunk/lnt/tests/builtintest.py (original)
+++ lnt/trunk/lnt/tests/builtintest.py Sun Jul 23 18:04:42 2017
@@ -88,6 +88,7 @@ class BuiltinTest(object):
                                          server_config.Config.dummy_instance())
             server_report = ImportData.import_and_report(
                 None, None, db, report_path, 'json', ts_name, commit)
+            server_report['result_url'] = None
 
         assert server_report is not None, "Results were not submitted."
 
@@ -98,7 +99,6 @@ class BuiltinTest(object):
     @staticmethod
     def show_results_url(server_results):
         """Print the result URL"""
-        if server_results.get('result_url'):
+        result_url = server_results.get('result_url', None)
+        if result_url is not None:
             print "Results available at:", server_results['result_url']
-        else:
-            print "Results available at: no URL available"

Modified: lnt/trunk/lnt/tests/test_suite.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/tests/test_suite.py?rev=308860&r1=308859&r2=308860&view=diff
==============================================================================
--- lnt/trunk/lnt/tests/test_suite.py (original)
+++ lnt/trunk/lnt/tests/test_suite.py Sun Jul 23 18:04:42 2017
@@ -942,17 +942,7 @@ class TestSuiteTest(BuiltinTest):
                            "this is not Darwin.")
         logger.info("Report produced in: " + report_path)
 
-        # Run through the rest of LNT, but don't allow this to be submitted
-        # because there is no data.
-        class DontSubmitResults(object):
-
-            def get(self, url):
-                return report_path
-
-            def __getitem__(self, key):
-                return report_path
-
-        return DontSubmitResults()
+        return lnt.util.ImportData.no_submit()
 
 @click.command("test-suite", short_help=__doc__)
 @click.argument("label", default=platform.uname()[1], required=False,

Modified: lnt/trunk/lnt/util/ImportData.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/util/ImportData.py?rev=308860&r1=308859&r2=308860&view=diff
==============================================================================
--- lnt/trunk/lnt/util/ImportData.py (original)
+++ lnt/trunk/lnt/util/ImportData.py Sun Jul 23 18:04:42 2017
@@ -165,6 +165,16 @@ def import_and_report(config, db_name, d
     result['success'] = True
     return result
 
+
+def no_submit():
+    """Do not submit but create dummy submission report."""
+    return {
+        'success': True,
+        'result_url': None,
+        'test_results': None,
+    }
+
+
 def print_report_result(result, out, err, verbose = True):
     """
     print_report_result(result, out, [err], [verbose]) -> None




More information about the llvm-commits mailing list