Perl-Critic / Test-Perl-Critic

Run Perl::Critic as a unit test
http://perlcritic.com
Other
9 stars 7 forks source link

Test2 conversion #15

Closed colinnewell closed 6 years ago

colinnewell commented 6 years ago

This converts from Test::Builder to the Test2::API which simplifies the multi-process testing as it is able to link up the test numbers.

This also includes the fix for #9 as that was necessary to ensure this worked.

petdance commented 6 years ago

Thanks for the time you put in on this. I do wish you'd consulted first before you spent the time, because I'm not sure that moving to Test2 is something we want to do. I'm not sure that Test2 is stable enough at this point, or that we want to require everyone to use Test2 in order to use Test::Perl::Critic. I'm hoping others can add their thoughts.

colinnewell commented 6 years ago

I did this partially as an intellectual exercise to see how easy it was to do. It was actually a reasonably pleasant experience as everything needed was publicly available and the new code provides an easy way to deal with complex problems like multi-process testing.

If you don't want to merge this, and want to close the pull request I will understand. It does look like the path to conversion when the time is right should be relatively simple.

I haven't tested the upgrade path from old versions of Test::Builder to Test2::API, so I can't be sure how many issues are likely to be caused by an upgrade of your module switching to Test2.

One thought that had occurred to me when creating the changes was that the module could be cloned to provide a Test2 variant for people who found they wanted full Test2 compatibility. I don't really know whether that's worth doing though. Either way, do with it as you please.

petdance commented 6 years ago

If you don't want to merge this,

I don't know if we should or not. This thread is the only discussion we've had about it.

colinnewell commented 6 years ago

The more that I think about this, the idea of a clone sounds like the best idea to me. We will probably take a closer look at the other open issues this week, but I have a suspicion that an in place upgrade to Test2 will cause backwards compatibility issues here and there. A Test2::Perl::Critic module might make more sense.

Assuming you go with that logic the next question is whether it's worth it. The multi-process potential of the module does probably mean that the newer Test2 infrastructure is a good idea. It's a lot cleaner and simpler to implement from this modules point of view, and it also appears to produce nicer looking results.

petdance commented 6 years ago

Are you saying you want to make a Test2::Perl::Critic that you'll distribute and maintain? That sounds like a fine plan.