]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
disable figleaf tracing during py_ecc, since it takes *forever*, especially on the...
authorBrian Warner <warner@allmydata.com>
Sat, 6 Jan 2007 01:12:04 +0000 (18:12 -0700)
committerBrian Warner <warner@allmydata.com>
Sat, 6 Jan 2007 01:12:04 +0000 (18:12 -0700)
Makefile
src/allmydata/encode.py
src/allmydata/test/trial_figleaf.py
src/allmydata/util/figleaf.py

index 515edc769bcf2a7e85299e07391ef4442ace393d..efac3630f9fc6f11c83ed958bbf6fad93b1530b7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -32,7 +32,7 @@ REPORTER=
 test: build
        $(PP) trial $(REPORTER) $(TEST)
 
-test-figleaf:
+test-figleaf: build
        $(PP) trial --reporter=bwverbose-figleaf $(TEST)
 
 figleaf-output:
index ae102789a13a9862d218c72f50d01dc3c8cbf7cc..d337689c997bf1c36b81b0a83a6e8b5587253712 100644 (file)
@@ -114,7 +114,7 @@ class PyRSEncoder(object):
     # of 6.7kBps. Zooko's mom's 1.8GHz G5 got 2.2kBps . slave3 took 40s to
     # construct the LUT and encodes at 1.5kBps, and for some reason took more
     # than 20 minutes to run the test_encode_share tests, so I disabled most
-    # of them.
+    # of them. (uh, hello, it's running figleaf)
 
     def set_params(self, data_size, required_shares, total_shares):
         assert required_shares <= total_shares
index 5b00615b40c9b0f9f8d58027de436bf244eb0694..57859f122551fe0f105a08c10b39fd0d0359e0fb 100644 (file)
@@ -60,7 +60,12 @@ from twisted.trial.reporter import TreeReporter, VerboseTextReporter
 # finish in printSummary.
 
 from allmydata.util import figleaf
-figleaf.start()
+# don't cover py_ecc, it takes forever
+from allmydata.py_ecc import rs_code
+import os
+py_ecc_dir = os.path.realpath(os.path.dirname(rs_code.__file__))
+figleaf.start(ignore_prefixes=[py_ecc_dir])
+
 
 class FigleafReporter(TreeReporter):
     def __init__(self, *args, **kwargs):
index 38045ef4b3ddeecae47c7fd549c92ea45d4de2d3..03d8c08d2469a02efc16190651aa6ff8ac8a8fe7 100644 (file)
@@ -158,10 +158,10 @@ class CodeTracer:
     """
     Basic code coverage tracking, using sys.settrace.
     """
-    def __init__(self, ignore_prefix=None):
+    def __init__(self, ignore_prefixes=[]):
         self.c = {}
         self.started = False
-        self.ignore_prefix = ignore_prefix
+        self.ignore_prefixes = ignore_prefixes
 
     def start(self):
         """
@@ -187,9 +187,9 @@ class CodeTracer:
         global trace function.
         """
         if e is 'call':
-            if self.ignore_prefix and \
-                   f.f_code.co_filename.startswith(self.ignore_prefix):
-                return
+            for p in self.ignore_prefixes:
+                if f.f_code.co_filename.startswith(p):
+                    return
 
             return self.t
 
@@ -316,7 +316,7 @@ def annotate_coverage(in_fp, out_fp, covered, all_lines,
 
 _t = None
 
-def start(ignore_python_lib=True):
+def start(ignore_python_lib=True, ignore_prefixes=[]):
     """
     Start tracing code coverage.  If 'ignore_python_lib' is True,
     ignore all files that live below the same directory as the 'os'
@@ -324,10 +324,10 @@ def start(ignore_python_lib=True):
     """
     global _t
     if _t is None:
-        ignore_path = None
+        ignore_prefixes = ignore_prefixes[:]
         if ignore_python_lib:
-            ignore_path = os.path.realpath(os.path.dirname(os.__file__))
-        _t = CodeTracer(ignore_path)
+            ignore_prefixes.append(os.path.realpath(os.path.dirname(os.__file__)))
+        _t = CodeTracer(ignore_prefixes)
 
     _t.start()