[LNT] r309788 - Show a helpful note if a submission is rejected because of mismatching machine info

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 1 20:50:01 PDT 2017


Author: matze
Date: Tue Aug  1 20:50:01 2017
New Revision: 309788

URL: http://llvm.org/viewvc/llvm-project?rev=309788&view=rev
Log:
Show a helpful note if a submission is rejected because of mismatching machine info

Modified:
    lnt/trunk/lnt/server/db/testsuitedb.py
    lnt/trunk/lnt/util/ImportData.py
    lnt/trunk/tests/lnttool/submit.shtest

Modified: lnt/trunk/lnt/server/db/testsuitedb.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/testsuitedb.py?rev=309788&r1=309787&r2=309788&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/testsuitedb.py (original)
+++ lnt/trunk/lnt/server/db/testsuitedb.py Tue Aug  1 20:50:01 2017
@@ -59,6 +59,10 @@ def make_machine_column(name):
     return Column(name, String(256))
 
 
+class MachineInfoChanged(ValueError):
+    pass
+
+
 class TestSuiteDB(object):
     """
     Wrapper object for an individual test suites database tables.
@@ -804,8 +808,8 @@ class TestSuiteDB(object):
                 existing.set_field(field, new_value)
             elif existing_value != new_value:
                 if not forceUpdate:
-                    raise ValueError("'%s' on machine '%s' changed." %
-                                     (field.name, name))
+                    raise MachineInfoChanged("'%s' on machine '%s' changed." %
+                                             (field.name, name))
                 else:
                     existing.set_field(field, new_value)
         existing_parameters = existing.parameters
@@ -815,8 +819,8 @@ class TestSuiteDB(object):
                 existing_parameters[key] = value
             elif existing_value != value:
                 if not forceUpdate:
-                    raise ValueError("'%s' on machine '%s' changed." %
-                                     (key, name))
+                    raise MachineInfoChanged("'%s' on machine '%s' changed." %
+                                             (key, name))
                 else:
                     existing_parameters[key] = value
         existing.parameters = existing_parameters

Modified: lnt/trunk/lnt/util/ImportData.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/util/ImportData.py?rev=309788&r1=309787&r2=309788&view=diff
==============================================================================
--- lnt/trunk/lnt/util/ImportData.py (original)
+++ lnt/trunk/lnt/util/ImportData.py Tue Aug  1 20:50:01 2017
@@ -98,6 +98,9 @@ def import_and_report(config, db_name, d
         import traceback
         result['error'] = "import failure: %s" % e.message
         result['message'] = traceback.format_exc()
+        if isinstance(e, lnt.server.db.testsuitedb.MachineInfoChanged):
+            result['message'] += '\n\nNote: Use --update-machine to update ' \
+                                 'the existing machine information.\n'
         return result
 
     # If the import succeeded, save the import path.

Modified: lnt/trunk/tests/lnttool/submit.shtest
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/lnttool/submit.shtest?rev=309788&r1=309787&r2=309788&view=diff
==============================================================================
--- lnt/trunk/tests/lnttool/submit.shtest (original)
+++ lnt/trunk/tests/lnttool/submit.shtest Tue Aug  1 20:50:01 2017
@@ -106,7 +106,8 @@ lnt submit "http://localhost:9091/db_def
 lnt submit "http://localhost:9091/db_default/v4/compile/submitRun" --commit "${INPUTS}/compile_submission_machine_diff_reject.json" >> "${OUTPUT_DIR}/submit_errors.txt" 2>&1
 # CHECK-ERRORS: lnt server error: import failure: 'hw.activecpu' on machine 'some-compile-suite-machine' changed.
 # ...
-# ValueError: 'hw.activecpu' on machine 'some-compile-suite-machine' changed.
+# CHECK-ERRORS: MachineInfoChanged: 'hw.activecpu' on machine 'some-compile-suite-machine' changed.
+# CHECK-ERRORS: Note: Use --update-machine to update the existing machine information.
 
 
 




More information about the llvm-commits mailing list