Browse Source

Adds more logging to toolset/

Hamilton Turner 11 years ago
parent
commit
a20aa9a558

+ 1 - 2
toolset/benchmark/benchmarker.py

@@ -15,7 +15,6 @@ import csv
 import sys
 import sys
 import logging
 import logging
 import socket
 import socket
-import glob
 from multiprocessing import Process
 from multiprocessing import Process
 from datetime import datetime
 from datetime import datetime
 
 
@@ -827,7 +826,7 @@ class Benchmarker:
     self.run_test_timeout_seconds = 3600
     self.run_test_timeout_seconds = 3600
 
 
     # setup logging
     # setup logging
-    logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
+    logging.basicConfig(stream=sys.stderr, level=logging.INFO)
     
     
     # setup some additional variables
     # setup some additional variables
     if self.database_user == None: self.database_user = self.client_user
     if self.database_user == None: self.database_user = self.client_user

+ 4 - 4
toolset/benchmark/framework_test.py

@@ -458,7 +458,7 @@ class FrameworkTest:
     #       use subprocess's cwd argument already
     #       use subprocess's cwd argument already
     previousDir = os.getcwd()
     previousDir = os.getcwd()
     os.chdir(os.path.dirname(self.troot))
     os.chdir(os.path.dirname(self.troot))
-    logging.warning("Running setup module (cwd=%s)", os.path.dirname(self.troot))
+    logging.info("Running setup module start (cwd=%s)", os.path.dirname(self.troot))
     retcode = self.setup_module.start(self, out, err)    
     retcode = self.setup_module.start(self, out, err)    
     os.chdir(previousDir)
     os.chdir(previousDir)
 
 
@@ -487,8 +487,7 @@ class FrameworkTest:
     #       use subprocess's cwd argument already
     #       use subprocess's cwd argument already
     previousDir = os.getcwd()
     previousDir = os.getcwd()
     os.chdir(os.path.dirname(self.troot))
     os.chdir(os.path.dirname(self.troot))
-    logging.warning("Running setup module (cwd=%s)", os.path.dirname(self.troot))
-    os.chdir(self.troot)
+    logging.info("Running setup module stop (cwd=%s)", os.path.dirname(self.troot))
     retcode = self.setup_module.stop(out, err)
     retcode = self.setup_module.stop(out, err)
     os.chdir(previousDir)
     os.chdir(previousDir)
 
 
@@ -1270,7 +1269,7 @@ class FrameworkTest:
     self.fwroot = benchmarker.fwroot
     self.fwroot = benchmarker.fwroot
     
     
     # setup logging
     # setup logging
-    logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
+    logging.basicConfig(stream=sys.stderr, level=logging.INFO)
     
     
     self.install_root="%s/%s" % (self.fwroot, "installs")
     self.install_root="%s/%s" % (self.fwroot, "installs")
     if benchmarker.install_strategy is 'pertest':
     if benchmarker.install_strategy is 'pertest':
@@ -1280,6 +1279,7 @@ class FrameworkTest:
 
 
     # ensure directory has __init__.py file so that we can use it as a Python package
     # ensure directory has __init__.py file so that we can use it as a Python package
     if not os.path.exists(os.path.join(directory, "__init__.py")):
     if not os.path.exists(os.path.join(directory, "__init__.py")):
+      logging.warning("Please add an empty __init__.py file to directory %s", directory)
       open(os.path.join(directory, "__init__.py"), 'w').close()
       open(os.path.join(directory, "__init__.py"), 'w').close()
 
 
     # Import the module (TODO - consider using sys.meta_path)
     # Import the module (TODO - consider using sys.meta_path)

+ 8 - 4
toolset/setup/linux/installer.py

@@ -53,11 +53,15 @@ class Installer:
     for test_install_file in install_files:
     for test_install_file in install_files:
       test_dir = os.path.dirname(test_install_file)
       test_dir = os.path.dirname(test_install_file)
       test_rel_dir = os.path.relpath(test_dir, self.fwroot)
       test_rel_dir = os.path.relpath(test_dir, self.fwroot)
+      logging.debug("Considering install of %s (%s, %s)", test_install_file, test_rel_dir, test_dir)
 
 
       if test_dir not in dirs:
       if test_dir not in dirs:
         continue
         continue
-              
-      logging.info("Running installation for directory %s", test_dir)
+
+      logging.info("Running installation for directory %s (cwd=%s)", test_dir, test_dir)
+
+      # Collect the tests in this directory
+      # local_tests = [t for t in tests if t.directory == test_dir]
 
 
       # Find installation directory 
       # Find installation directory 
       #   e.g. FWROOT/installs or FWROOT/installs/pertest/<test-name>
       #   e.g. FWROOT/installs or FWROOT/installs/pertest/<test-name>
@@ -77,7 +81,7 @@ class Installer:
         logging.warning("Directory %s does not have a bash_profile"%test_dir)
         logging.warning("Directory %s does not have a bash_profile"%test_dir)
         profile="$FWROOT/config/benchmark_profile"
         profile="$FWROOT/config/benchmark_profile"
       else:
       else:
-        logging.info("Loading environment from %s", profile)
+        logging.info("Loading environment from %s (cwd=%s)", profile, test_dir)
       setup_util.replace_environ(config=profile, 
       setup_util.replace_environ(config=profile, 
         command='export TROOT=%s && export IROOT=%s' %
         command='export TROOT=%s && export IROOT=%s' %
         (test_dir, test_install_dir))
         (test_dir, test_install_dir))
@@ -401,7 +405,7 @@ EOF
     self.strategy = install_strategy
     self.strategy = install_strategy
     
     
     # setup logging
     # setup logging
-    logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
+    logging.basicConfig(stream=sys.stderr, level=logging.INFO)
 
 
     try:
     try:
       os.mkdir(self.install_dir)
       os.mkdir(self.install_dir)