Seba has asked for the wisdom of the Perl Monks concerning the following question:
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.
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.
I want to be able to run all tests in Jenkins environment...
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:
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...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");
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Complex App testing w/ TAP::Harness (nesting/dividing?)
by Anonymous Monk on Jun 13, 2012 at 09:48 UTC | |
by Seba (Acolyte) on Jun 13, 2012 at 13:26 UTC |