Ovid/test-class-moose — pull request #31 by autarch (2014-04-14 05:33:16+00:00)
Title: Separate the runner code from Test::Class::Moose

This is a major refactoring/redesign of the existing code. It includes my previous work to allow parameterized test class instances as well.

The big change is that the code to run tests has been separated from Test::Class::Moose. TCM itself is now just a class to be subclassed by classes which *are* tests.

The runner code now lives (mostly) in Test::Class::Moose::Role::Runner. There are two runners, Sequential & Parallel. The Sequential runner works pretty much exactly like the old code did.

The Parallel runner is rather different. It's a lot less code, but I changed it to run test *instances* in parallel, rather than methods. This is a lot simpler, as it lets us make the test instances up front in the parent process and ensure that the relevant test control methods are only called once per instance.

The previous implementation was very complicated and AFAICT, made it hard to understand when & how many times the startup & shutdown control methods would run.

I think it might be possible to write a parallel runner that parallelized per-method, but it might require further refactoring.

That all said, I think it's just a heck of a lot saner to parallelize per instance. It makes understanding the flow of tests much simpler, and I can't see how this would make parallel tests much slower.

@Ovid - This still requires some doc updates, but I didn't really want to do that until I was sure you were okay with the design.