perl - Can Test::Class tests be run in parallel? (or how to factor out superclass tests) -
in tutorials i've read test::class
, there seems 1 runner script loads of classes. , think perspective of test::harness
1 giant test. don't think can parallelize tests inside runner.
my x problem trying factor out superclass behaviors when testing subclasses. each subclass should have own subclass test (that can parallelized), exercise behaviors inherited superclass. how 1 that?
edit: found these 2 posts 2007 seem imply i'm asking incompatible/not possible. update since then?
- http://www.hexten.net/pipermail/tapx-dev/2007-october/001756.html (speculation
test::class
support parallelism - http://perlbuzz.com/2007/08/organizing-tests-with-testclass.html (implying
test::class
,test::harness
ideologically exclusive)
test::class
doesn't support parallelisation on own. easiest solution have separate .t
runners each of test classes (or logical groups of test classes), , run using e.g. prove -j9
.
if want run of tests in parallel write simple script auto-generate .t
file each test class. you'd lose performance benefit of running multiple test classes within single perl interpreter, parallelisation might compensate additional startup overhead. , i'd argue no matter how test::class
tries provide test isolation, it's impossible guarantee in perl. once start taking advantage of modifying symbol table mocking purposes etc, tests start interfere each other unless cleanup right. running each test in separate perl interpreter better way provide guaranteed isolation.
Comments
Post a Comment