[Erp5-report] r8431 - /erp5/trunk/utils/erp5mechanize/runBenchmarks.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Jul 13 10:38:11 CEST 2006


Author: vincent
Date: Thu Jul 13 10:38:10 2006
New Revision: 8431

URL: http://svn.erp5.org?rev=8431&view=rev
Log:
Use easilly grepable test results.
Stop saying the thread ended (useless noise).
Change 'conf' argument name to 'config'

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

Modified: erp5/trunk/utils/erp5mechanize/runBenchmarks.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5mechanize/runBenchmarks.py?rev=8431&r1=8430&r2=8431&view=diff
==============================================================================
--- erp5/trunk/utils/erp5mechanize/runBenchmarks.py (original)
+++ erp5/trunk/utils/erp5mechanize/runBenchmarks.py Thu Jul 13 10:38:10 2006
@@ -182,8 +182,9 @@
       thread_url = thread.getUrl()
       test_result = thread.getResult()
       while test_result is not None:
+        sys.stdout.write('%s: Thread %s, test %s : ' % (time(), thread_name, test_result['id']))
         if len(test_result['step_list']) > 0: # Thread produced exploitable results (the test did not fail).
-          print '%s: Thread %s finished test %s.' % (time(), thread_name, test_result['id'])
+          print 'Success'
           test_result['step_list'].sort()
           step_list = test_result['step_list']
           # Simple profiling : store an entry containing start & stop timestamps for each test
@@ -206,10 +207,9 @@
                   server_load_list[thread_url][timestamp]['delta'] += delta
                   server_load_list[thread_url][timestamp]['cause_list'].append(cause)
         else: # Test did fail.
-          print '%s: Thread %s failed to execute test %s.' % (time(), thread_name, test_result['id'])
+          print 'Failed'
         test_result = thread.getResult() # Get next test result
       if not thread.isAlive():
-        print '%s: Test thread %s ended.' % (time(), thread.getName(), )
         del thread_list[pos] # This thread won't move anymore, throw it.
 
   # Post processing of load computation : as threads can produce results in any order, we must wait for everything to be finished to compute the load.
@@ -224,7 +224,7 @@
 
 if __name__ == '__main__':
   import getopt
-  possible_arg_list = ('conf', 'dresults', 'results', 'load', 'minsleep', 'Maxsleep', 'usercount')
+  possible_arg_list = ('config', 'dresults', 'results', 'load', 'minsleep', 'Maxsleep', 'usercount')
   possible_opt_list = ('verbose', )
   kw = {}
   args = []
@@ -239,20 +239,20 @@
   for o, a in opt_list:
     if o in combined_arg_list:
       kw['%s' % combined_arg_list[o]] = a
-  if kw.has_key('conf'):
+  if kw.has_key('config'):
     import imp
     import os
     # XXX This is a workaround for the case where PWD != path of the script
     # It can happend when calling script using a symlink, in which case the actual PWD isn't prepended to path.
     sys.path.insert(0, os.environ['PWD']) # Modify sys.path to make sure imports from inside the tests suite will also have a correct path. 
-    file, path, description = imp.find_module(kw['conf'], sys.path)
-    module = imp.load_module(kw['conf'], file, path, description)
+    file, path, description = imp.find_module(kw['config'], sys.path)
+    module = imp.load_module(kw['config'], file, path, description)
     file.close()
-    del kw['conf']
+    del kw['config']
     args.append(module.instance_list)
     args.append(module.test_list)
   else:
-    print "'conf' argument is required. Configuration file must be a python module and define :"
+    print "'config' argument is required. Configuration file must be a python module and define :"
     print "  instance_list ex: [{'url': 'http://127.0.0.1/erp5',"
     print "                      'user_list': [{'name': 'testuser1', 'password': 'secret'}]}]"
     print "  test_list     ex: [{'id': 'theFirstTest',"




More information about the Erp5-report mailing list