So I'm working on this web project that has a custom test harness and nightly automated tests. Right now it runs the tests using Test::Harness, captures the output and then emails it to everyone on the mailing list for the project. It's worked really well so far, but the output is kinda plain and because there are 96 test files, and 3000+ individual tests the test output is a little hard to
skim quickly in the morning to make sure everything worked...
Enter
Test::TAP::HTMLMatrix.
This module will run the desired tests, record the output from any
TAP compatible tests (eg, anything using Test or Test::More, etc) and then format them into nice, pretty and colorful HTML results.
So I decided to try and capture this out and send out a multipart email using
MIME::Lite. And the code looked something like this:
# create the TAP model to run and capture the
# TAP test output
my $model = Test::TAP::Model::Visual->new();
$model->run_tests(@testfiles);
# now get the HTML output
my $matrix = Test::TAP::HTMLMatrix->new($model);
my $output = $matrix->html();
# now send it in an email
my $msg = MIME::Lite->new(
From => 'testing@plusthree.com',
To => 'project_list@plusthree.com,
Subject => 'Automated Test - ' . scalar(localtime),
Type => 'multipart/alternative',
);
$msg->attach(
Type => 'text/html',
Data => $email_output,
);
$msg->send()
Pretty simple huh? But darn cool.
Cool (Score:1)
Re:Cool (Score:1)