[tap-l] What's the best way to do logging?
Andy Armstrong
andy at hexten.net
Wed Nov 14 16:22:02 EST 2007
On 14 Nov 2007, at 20:53, Michael Moore wrote:
> I'm glad to have found a TAP mailing list! If Perl specific questions
> aren't appropriate for this list, please let me know and forgive me.
>
>
> I'm working on an automated test suite for some of our software using
> Perl, I had been using Test::Harness and Test::Harness::Straps but
> saw
> just yesterday that Test::Harness::Straps won't be developed anymore.
>
> Since we want to use these tests for some time, I'd like to move to
> something that's not discontinued. Could someone here tell me if
> TAP::Harness and TAP::Parser is what I should be looking at?
Yes. By design TAP::* replaces the existing Straps mechanism. If it
won't do what you want it to do we need to log at that design.
> I need to do fairly extensive logging. Our tests will normally be
> run as
> nightly regression tests, and we want to be able to compare results
> from
> different nights.
>
> On a test by test basis I am currently logging all of the Test::More
> functions. I log the test comment and the result. I also log the many
> external programs that are called, the STDOUT, STDERR, and return
> status. There are several hundred batch tests, which currently use
> Test::Harness's execute_tests. I log which test was called from the
> batch test, and what the result for each was.
>
> I've added the logging functionality by overriding the functions,
> grabbing the results and logging them before returning them to the
> calling function.
>
> I've done this by writing a module which I include instead of
> Test::More, Test::Harness and Test::Harness::Straps.
>
> Is TAP::Harness and TAP::Parser what I should be looking at? Or is
> there
> an easier way to do logging?
I think TAP::Harness is the way forwards. Michael Peters wrote
TAP::Harness::Archive[1] which is designed to capture everything from
a test run. It's used to upload test results to Smolder[2] - which may
also be of interest to you.
Unfortunately the latest release of Test::Harness has broken
T::H::Archive. There's a fixed version in the Test::Harness subversion
repo - I guess I need to give Michael a poke. In the mean time you can
get the latest version here:
http://svn.hexten.net/tapx/TAP-Harness-Archive/trunk/
May I suggest that you start by reading the documentation for
TAP::Harness::Archive and see if that might do what you want?
[1] http://search.cpan.org/~wonko/TAP-Harness-Archive/
[2] http://sourceforge.net/projects/smolder
More information about the tap-l
mailing list