I'm writing some web based business application which tends to get too complicated to test - so I'm seeking for some perl wisdom not to reinvent the wheel ;)

Well, most of base packages are tested well in unit testing (Test::More etc.), but the point is that not everyting can be tested that way. I use some bussiness logic based on actual database data, so for some test I require to establish test database. I used to work with SQLite but now I'm forced to use some full-scale SQL with triggers and procedures.

What do I have now

Two separate sets of test, one for unit testing (pretty simple so I will skip them) and second one for use case testing which does the following:

Whole app is built with Module::Build using TAP::Harness

I use Jenkins CI and it currently only runs unit testing via ./Build test and formats them to JUnit (TAP::Formatter::JUnit) so I can see reports online.

What do I want to have

I want to be able to run all tests in Jenkins environment...

So, what's the problem

The problem is that I decided to create two global test cases called ./t/unit.t and ./t/case.t. The first one looks like this:

use strict; use warnings; use TAP::Harness; use Test::More 'no_plan'; my $tap = TAP::Harness->new( { 'color' => 1, 'verbosity' => 1, 'lib' => ['lib', 'blib/lib', 'blib/arch'], 'timer' => 1 } ); my @tests = (glob('t/unit/**/*.t'), glob('t/unit/*.t')); $tap->runtests(@tests); ok(1, "Unit tests run");
and as you can see it just creates another TAP instance and runs all the tests in ./t/unit/ directory recursively. It runs fine, but ./Build test yells that tests are out of sequence, that they fail and so...

So my question is: Is there some other, proper way to this kind of testing

Any clues, hints or CPAN links would be greatly appreciated


In reply to Complex App testing w/ TAP::Harness (nesting/dividing?) by Seba

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.