← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~mwhudson/launchpad/reenable-layer-profiling-bug-605875 into lp:launchpad/devel

 

Michael Hudson has proposed merging lp:~mwhudson/launchpad/reenable-layer-profiling-bug-605875 into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  #605875 layer profiling is broken
  https://bugs.launchpad.net/bugs/605875


As mentioned in the bug report, ./bin/test -vvv no longer prints out the time taken by the various layer methods.  This turned out to be because the interface of zope.testrunner.run changed recently to always raise SystemExit, so the code in ./bin/test that printed the results is now never executed.

This branch moves the code into an 'except SystemExit' clause.
-- 
https://code.launchpad.net/~mwhudson/launchpad/reenable-layer-profiling-bug-605875/+merge/29990
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~mwhudson/launchpad/reenable-layer-profiling-bug-605875 into lp:launchpad/devel.
=== modified file 'buildout-templates/bin/test.in'
--- buildout-templates/bin/test.in	2010-05-15 17:43:59 +0000
+++ buildout-templates/bin/test.in	2010-07-15 13:46:46 +0000
@@ -236,15 +236,14 @@
     # tree. This is very useful for IDE integration, so an IDE can
     # e.g. run the test that you are currently editing.
     try:
-        there = os.getcwd()
-        os.chdir(BUILD_DIR)
-        result = testrunner.run([])
+        try:
+            there = os.getcwd()
+            os.chdir(BUILD_DIR)
+            testrunner.run([])
+        except SystemExit:
+            # Print Layer profiling report if requested.
+            if main_process and local_options.verbose >= 3:
+                profiled.report_profile_stats()
+            raise
     finally:
         os.chdir(there)
-    # Cribbed from sourcecode/zope/test.py - avoid spurious error during exit.
-    logging.disable(999999999)
-
-    # Print Layer profiling report if requested.
-    if main_process and local_options.verbose >= 3:
-        profiled.report_profile_stats()
-    sys.exit(result)