Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

rblackwe (5489)

rblackwe
  (email not shown publicly)
http://robertblackwell.com/
AOL IM: robertdblackwell (Add Buddy, Send Message)
Yahoo! ID: robertblackwell (Add User, Send Message)

Journal of rblackwe (5489)

Saturday June 09, 2007
09:29 AM

Running your tests with Apache

[ #33481 ]

I have been working with TAP to test environment and other things that are not code.

Did I win the lottery?

http://pl129.pairlitesite.com/tests/action/lottery.txt
http://pl129.pairlitesite.com/tests/action/lottery.t

Is my server up?

http://pl129.pairlitesite.com/tests/action/ping.txt
http://pl129.pairlitesite.com/tests/action/ping.t

etc.

I have been running these with cron and I get email about the results. Well the trouble is when I have failing tests I want to see if the tests are still failing. I was in a place that was blocking ssh traffic. So it lead me to this solution.

I wrote a little prove wrapper.

#!/usr/local/bin/perl
use CGI;
 
my $q = new CGI;
print $q->header;
print $q->start_html('prove');
 
my $file = $q->param('file');
 
my $ok_file = {
        '/tests/action/ping.t'    => 1,
        '/tests/action/lottery.t' => 1,
};
 
my $out;
 
if ( $ok_file->{$file} ) {
        my $command = "/usr/home/pl129/public_html/bin/prove /usr/home/pl129/public_html$file 2>&1";
        $out = `$command`;
} else {
        $out = "<pre> $file not allowed </pre>";
}
 
print $q->h1($file);
 
print "<hr>";
 
print "<pre>$out</pre>";
 
print $q->end_html;

I added this to my .htaccess

AddHandler prove-type .t
Action prove-type /bin/proveit.cgi?v=1&file=

So know I can link to my tests:
http://pl129.pairlitesite.com/tests/action/ping.t

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.