PrePAN

Sign in to PrePAN

Test::Skipper Skip tests that passed

Author
ziuq@github
Date
URL
Status
In Review
Good

Synopsis

use Test::Skipper;

skipper( 'Module::To::Test');

$aok &&= ok( whatever(), 'Whatevered');
$aok &&= dies_ok( die, 'Died');
...
passing();

Description

Test::Skipper treats testing like a make target depending on no changes to the test.t script or the Module::To::Test since all significant tests passed.

passing() saves state indicating success when $aok is true.

skipper() runs one succeeding test to report the skipping and exits cleanly.

$aok is the only communication that "all" tests have passed, so peripheral tests may be included for information.

Is there an older wheel, that I missed?

Comments

I’m not aware of such a module… and frankly I hope there isn’t… because this job belongs in the harness, not the test. I’m not aware of any implementation of this exact feature on the harness side either, but off the top of my head I would expect that App::Prove::State is half of what you need, already written. You’d just have to write a dep system on top of it, so the harness can decide which tests to not even run – instead of the harness running the tests for lack of knowledge about the deps, and then having to fake out each superfluously run test using a made-up skip.
Thanks for a good pointer, ap. I'll be glad to hear any more you care to offer.

The fact that this functionality is not in common circulation gives me pause that I may be missing more subtle aspects of concern. With ugliness as the only downside, I'm cutting my test time 75%+.

Regarding this belonging in the harness, I think that would be good, but I also see validity in having SKIP block's granularity. I dislike the remoteness of having this in the harness or in my makefiles.

Most of what I do is small and as the code stabilizes it is done; I suppose it differs in larger projects but it still seems a lurking trap. My ignorance invites education.

As you comment, my code should emit a TAP skip and could live to skip again rather than exit after one bracket.

I have been looking at it as much as a productivity aid as QA. That intent aimed me toward instrumentation that would be a barely visible no-op when not turned on. I have not yet found an agreeable plan for that unobstrusiveness.

Appreciation, fear, greed, astonishment, herd instinct, impatience and happiness are all expressed in the above. What is this logical thought thing I keep hearing about?

Please sign up to post a review.