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

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Sep 4 14:20:58 CEST 2006


Author: vincent
Date: Mon Sep  4 14:20:56 2006
New Revision: 9640

URL: http://svn.erp5.org?rev=9640&view=rev
Log:
Name variables a bit more consistently.
Actually use min_user.
Remove debug print.

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=9640&r1=9639&r2=9640&view=diff
==============================================================================
--- erp5/trunk/utils/erp5mechanize/smartRun.py (original)
+++ erp5/trunk/utils/erp5mechanize/smartRun.py Mon Sep  4 14:20:56 2006
@@ -42,7 +42,8 @@
 max_zope = 1
 runBenchmarks = 'runBenchmarks.py'
 userperzope = 'userperzope.py'
-maxuser = None
+min_user = None
+max_user = None
 testsuite = None
 usercoef = None
 
@@ -80,8 +81,6 @@
 ''' % (sys.argv[0], min_zope, max_zope, runBenchmarks, userperzope)
   sys.exit(2)
 
-usercount = None
-
 for o, a in opt_list:
   if o == '--minzope':
     min_zope = int(a)
@@ -92,9 +91,9 @@
   elif o == '--userperzope':
     userperzope = a
   elif o == '--minuser':
-    minuser = int(a)
+    min_user = int(a)
   elif o == '--maxuser':
-    maxuser = int(a)
+    max_user = int(a)
   elif o == '--testsuite':
     testsuite = a
   elif o == '--usercoef':
@@ -110,8 +109,8 @@
   print 'Mandatory usercoef agument not given.'
   sys.exit(2)
 
-if usercount is None:
-  usercount = min_zope
+if min_user is None:
+  min_user = min_zope
 
 userperzope_arguments = ' '.join(arg_list)
 fd, resultpath = tempfile.mkstemp()
@@ -119,21 +118,19 @@
 fd, dresultpath = tempfile.mkstemp()
 os.close(fd)
 
+current_usercount = min_user
 for current_zopecount in xrange(min_zope, max_zope + 1):
-  if usercount < current_zopecount:
+  if current_usercount < current_zopecount:
     print 'Less successfull users than zope to test, aborting.'
     break
-  max_usercount = current_zopecount * usercoef
-  if maxuser is not None:
+  min_usercount = max(min_user, current_usercount)
+  if max_user is not None:
     max_usercount = min(maxuser, max_usercount)
-  for current_usercount in xrange(usercount, max_usercount):
+  for current_usercount in xrange(min_usercount, max_usercount + 1):
     execute('%s --config %s --results %s --dresults %s --usercount %s --zopecount %s' % (runBenchmarks, testsuite, resultpath, dresultpath, current_usercount, current_zopecount))
-    result = execute('%s %s %s' % (userperzope, userperzope_args, resultpath))
-    print 'Result : %s' % (result, )
-    if result != 0:
+    if execute('%s %s %s' % (userperzope, userperzope_args, resultpath)) != 0:
       print 'Test with %s users and %s zopes is out of limits.' % (current_usercount, current_zopecount)
       break
-    usercount = current_usercount
 
 os.unlink(resultpath)
 os.unlink(dresultpath)




More information about the Erp5-report mailing list