mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-12 13:18:19 +00:00
disable figleaf tracing during py_ecc, since it takes *forever*, especially on the slow buildslave
This commit is contained in:
parent
3d3a7a5b8d
commit
42c0d2e336
2
Makefile
2
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:
|
||||
|
@ -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
|
||||
|
@ -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):
|
||||
|
@ -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()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user