[Erp5-report] r9924 - /erp5/trunk/utils/erp5mechanize/smartRun.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Sep 14 18:12:26 CEST 2006


Author: vincent
Date: Thu Sep 14 18:12:23 2006
New Revision: 9924

URL: http://svn.erp5.org?rev=9924&view=rev
Log:
Fix parameter gathering on test suite.

Modified:
    erp5/trunk/utils/erp5mechanize/smartRun.py

Modified: erp5/trunk/utils/erp5mechanize/smartRun.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5mechanize/smartRun.py?rev=9924&r1=9923&r2=9924&view=diff
==============================================================================
--- erp5/trunk/utils/erp5mechanize/smartRun.py (original)
+++ erp5/trunk/utils/erp5mechanize/smartRun.py Thu Sep 14 18:12:23 2006
@@ -113,7 +113,9 @@
 file, path, description = imp.find_module(testsuite, sys.path)
 module = imp.load_module(testsuite, file, path, description)
 file.close()
-resultpath = runBenchmarks_parameter_list['results']
+if 'runBenchmarks_parameter_list' not in dir(module) or not module.runBenchmarks_parameter_list.has_key('results'):
+  raise KeyError, 'Test suite must contain its parameter set (runBenchmarks_parameter_list) to be automated and must define the value for key "results".'
+resultpath = module.runBenchmarks_parameter_list['results']
 
 if usercoef is None:
   print 'Mandatory usercoef agument not given.'
@@ -124,7 +126,7 @@
 current_usercount = min_user
 for current_zopecount in xrange(min_zope, max_zope + 1):
   if current_usercount < current_zopecount:
-    print 'Less successfull users than zope to test, aborting.'
+    print 'FINAL LIMIT REACHED: Less successfull users than zope to test, continuing has no meaning.'
     break
   min_usercount = max(min_user, current_usercount)
   max_usercount = current_zopecount * usercoef
@@ -132,7 +134,11 @@
     max_usercount = min(max_user, max_usercount)
   for current_usercount in xrange(min_usercount, max_usercount + 1):
     execute('%s --config %s --usercount %s --zopecount %s' % (runBenchmarks, testsuite, current_usercount, current_zopecount))
-    if execute('%s %s %s' % (userperzope, userperzope_args, resultpath(kw={'usercount': current_usercount, 'zopecount': current_zopecount}))) != 0:
-      print 'Test with %s users and %s zopes is out of limits.' % (current_usercount, current_zopecount)
+    if callable(resultpath):
+      current_resultpath = resultpath(kw={'usercount': current_usercount, 'zopecount': current_zopecount})
+    else:
+      current_resultpath = resultpath
+    if execute('%s %s %s' % (userperzope, userperzope_args, current_resultpath)) != 0:
+      print 'LIMIT REACHED: Test with %s users and %s zopes is out of limits.' % (current_usercount, current_zopecount)
       break
 




More information about the Erp5-report mailing list