Grokbase Groups Perl qa January 2014
FAQ
I’m looking at using TAP::Harness to process our test suite. Up to now we’ve been using some home grown code that IMHO is a heroic attempt to re-implement TAP::Harness.

It seems to do everything we need with one exception. We have rules that disallow a unit test from taking more than XXX seconds to run. If it exceeds that, we abort the test and move on to the next one, declaring the long test file a failure. Before I look at subclassing, can anyone tell me if there’s a way to do this with the existing code?

Thanks,
Todd

Search Discussions

  • Ovid at Jan 29, 2014 at 4:04 pm
    I don't know how easy that is to do with Test::Harness, though my App::Prove::Plugin::ProgressBar[1] might put you in the right direction. Alternatively, Test::Class::Moose[2] has a "reporting" feature that reports on timing and breaks it down into system, real and user time. You should be able to hook into that (or just take advantage of the fact that it's an OO feature and use the normal timeout features with alarm that you would do for regular classes.
      1. https://github.com/Ovid/App-Prove-Plugin-ProgressBar

      2. http://search.cpan.org/dist/Test-Class-Moose/

    Cheers,
    Ovid
    --
    IT consulting, training, international recruiting
           http://www.allaroundtheworld.fr/.
    Buy my book! - http://bit.ly/beginning_perl
    Live and work overseas - http://www.overseas-exile.com/



    On Wednesday, 29 January 2014, 6:50, Todd Rinaldo wrote:

    I’m looking at using TAP::Harness to process our test suite. Up to now we’ve been using some home grown code that IMHO is a heroic attempt to re-implement TAP::Harness.
    It seems to do everything we need with one exception. We have rules that disallow a unit test from taking more than XXX seconds to run. If it exceeds that, we abort the test and move on to the next one, declaring the long test file a failure. Before I look at subclassing, can anyone tell me if there’s a way to do this with the existing code?

    Thanks,
    Todd

  • Leon Timmermans at Jan 30, 2014 at 3:54 am

    On Wed, Jan 29, 2014 at 6:50 AM, Todd Rinaldo wrote:

    I’m looking at using TAP::Harness to process our test suite. Up to now
    we’ve been using some home grown code that IMHO is a heroic attempt to
    re-implement TAP::Harness.

    It seems to do everything we need with one exception. We have rules that
    disallow a unit test from taking more than XXX seconds to run. If it
    exceeds that, we abort the test and move on to the next one, declaring the
    long test file a failure. Before I look at subclassing, can anyone tell me
    if there’s a way to do this with the existing code?
    I don't think there's a clean way of doing that. You could hack something
    up with alarm, but that wouldn't work well with parallelization (or
    multi-threading for that matter). Another possibly route is subclassing
    TAP::Parser::Iterator::Process to use a timeout (not that IO::Select makes
    it easy to do that correctly, given crappy error signaling), and you'd have
    to do the same in TAP::Parser::Multiplexer if you want parallelization.

    Leon

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupqa @
categoriesperl
postedJan 29, '14 at 5:50a
activeJan 30, '14 at 3:54a
posts3
users3
websiteqa.perl.org

People

Translate

site design / logo © 2019 Grokbase