From e0f9ce9218fe3151fe6e395038bcd088dbafad2a Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Sat, 8 Jan 2011 01:44:59 -0800 Subject: Add ability to disable perlbrew This option comes in handy for those that want to run long test suites on just one version of Perl and/or those using local::lib (which doesn't play nice with perlbrew with XS modules). --- config.yml | 2 ++ lib/jitterbug/Builder.pm | 4 +++- scripts/capsule.sh | 37 +++++++++++++++++++++++-------------- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/config.yml b/config.yml index e4144c3..91e7265 100644 --- a/config.yml +++ b/config.yml @@ -18,6 +18,8 @@ jitterbug: build_process: builder: ./scripts/capsule.sh on_failure: ./scripts/build-failed.sh + options: + perlbrew: 1 plugins: DBIC: diff --git a/lib/jitterbug/Builder.pm b/lib/jitterbug/Builder.pm index 72b4216..6441c0d 100644 --- a/lib/jitterbug/Builder.pm +++ b/lib/jitterbug/Builder.pm @@ -113,7 +113,9 @@ sub run_task { my $builder = $conf->{'jitterbug'}{'build_process'}{'builder'}; - my $builder_command = "$builder $build_dir $report_path"; + my $perlbrew = $conf->{'options'}{'perlbrew'} || 1; + + my $builder_command = "$builder $build_dir $report_path $perlbrew"; debug("Going to run builder : $builder_command"); my $res = `$builder_command`; diff --git a/scripts/capsule.sh b/scripts/capsule.sh index 7411639..cd102a7 100755 --- a/scripts/capsule.sh +++ b/scripts/capsule.sh @@ -3,27 +3,36 @@ # first arg: build_dir # second arg: report path +# this is getting smelly builddir=$1 report_path=$2 +perlbrew=$3 echo "Creating report_path=$report_path" mkdir -p $report_path cd $builddir -source $HOME/perl5/perlbrew/etc/bashrc - -for perl in $HOME/perl5/perlbrew/perls/perl-5.* -do - theperl="$(basename $perl)" - - echo ">perlbrew switch $theperl" - perlbrew switch $theperl - # TODO: check error condition - - perlversion=$(perl -v) - logfile="$report_path/$theperl.txt" - +if [ $use_perlbrew ]; then + source $HOME/perl5/perlbrew/etc/bashrc + for perl in $HOME/perl5/perlbrew/perls/perl-5.* + do + theperl="$(basename $perl)" + + echo ">perlbrew switch $theperl" + perlbrew switch $theperl + # TODO: check error condition + + logfile="$report_path/$theperl.txt" + jitterbug_build + done +else + theperl="$(basename perl -e \"print $]\")" + logfile="$report_path/$theperl.txt" + jitterbug_build +fi + +function jitterbug_build () { if [ -f 'dist.ini' ]; then echo "Found dist.ini, using Dist::Zilla" dzil authordeps | cpanm @@ -42,4 +51,4 @@ do make HARNESS_VERBOSE=1 make test >> $logfile 2>&1 fi -done +} -- cgit v1.2.3 From 512cb117b8c45c6770c2e8bec5c0bd32902492c0 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Sun, 9 Jan 2011 01:01:41 -0800 Subject: Function must be defined before it is used --- scripts/capsule.sh | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/scripts/capsule.sh b/scripts/capsule.sh index cd102a7..45188f0 100755 --- a/scripts/capsule.sh +++ b/scripts/capsule.sh @@ -3,6 +3,27 @@ # first arg: build_dir # second arg: report path +function jitterbug_build () { + if [ -f 'dist.ini' ]; then + echo "Found dist.ini, using Dist::Zilla" + dzil authordeps | cpanm + cpanm --installdeps . + HARNESS_VERBOSE=1 dzil test >> $logfile 2>&1 + elif [ -f 'Build.PL' ]; then + echo "Found Build.PL, using Build.PL" + perl Build.PL + # ./Build installdeps is not available in older Module::Build's + cpanm --installdeps . + HARNESS_VERBOSE=1 ./Build test --verbose >> $logfile 2>&1 + else + echo "Hoping to find Makefile.PL" + perl Makefile.PL + cpanm --installdeps . + make + HARNESS_VERBOSE=1 make test >> $logfile 2>&1 + fi +} + # this is getting smelly builddir=$1 report_path=$2 @@ -31,24 +52,3 @@ else logfile="$report_path/$theperl.txt" jitterbug_build fi - -function jitterbug_build () { - if [ -f 'dist.ini' ]; then - echo "Found dist.ini, using Dist::Zilla" - dzil authordeps | cpanm - cpanm --installdeps . - HARNESS_VERBOSE=1 dzil test >> $logfile 2>&1 - elif [ -f 'Build.PL' ]; then - echo "Found Build.PL, using Build.PL" - perl Build.PL - # ./Build installdeps is not available in older Module::Build's - cpanm --installdeps . - HARNESS_VERBOSE=1 ./Build test --verbose >> $logfile 2>&1 - else - echo "Hoping to find Makefile.PL" - perl Makefile.PL - cpanm --installdeps . - make - HARNESS_VERBOSE=1 make test >> $logfile 2>&1 - fi -} -- cgit v1.2.3 From 969b62c1be0b8e3b548ad1ba395d09f6393b89b8 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Sun, 9 Jan 2011 01:21:56 -0800 Subject: Attempt grab perl version correctly --- scripts/capsule.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/capsule.sh b/scripts/capsule.sh index 45188f0..818dcf4 100755 --- a/scripts/capsule.sh +++ b/scripts/capsule.sh @@ -38,17 +38,17 @@ if [ $use_perlbrew ]; then source $HOME/perl5/perlbrew/etc/bashrc for perl in $HOME/perl5/perlbrew/perls/perl-5.* do - theperl="$(basename $perl)" + theperl="$(perl -e \"print $]\")" + logfile="$report_path/perl-$theperl.txt" echo ">perlbrew switch $theperl" perlbrew switch $theperl # TODO: check error condition - logfile="$report_path/$theperl.txt" jitterbug_build done else - theperl="$(basename perl -e \"print $]\")" - logfile="$report_path/$theperl.txt" + theperl="$(perl -e \"print $]\")" + logfile="$report_path/perl-$theperl.txt" jitterbug_build fi -- cgit v1.2.3 From 87e5699a92b74e4b5ea53ed990a776e322c56a90 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Sun, 9 Jan 2011 01:26:56 -0800 Subject: Use a stringified version object, because it is prettier --- scripts/capsule.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/capsule.sh b/scripts/capsule.sh index 818dcf4..c91d50a 100755 --- a/scripts/capsule.sh +++ b/scripts/capsule.sh @@ -38,7 +38,7 @@ if [ $use_perlbrew ]; then source $HOME/perl5/perlbrew/etc/bashrc for perl in $HOME/perl5/perlbrew/perls/perl-5.* do - theperl="$(perl -e \"print $]\")" + theperl=$(perl -e 'print $^V') logfile="$report_path/perl-$theperl.txt" echo ">perlbrew switch $theperl" @@ -48,7 +48,7 @@ if [ $use_perlbrew ]; then jitterbug_build done else - theperl="$(perl -e \"print $]\")" + theperl=$(perl -e 'print $^V') logfile="$report_path/perl-$theperl.txt" jitterbug_build fi -- cgit v1.2.3 From b1a5bddc4c42308942d007ad71654f4bf4c0f282 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Mon, 10 Jan 2011 14:08:27 -0800 Subject: Add the ability to CC an email when builds fail --- config.yml | 1 + lib/jitterbug/Builder.pm | 4 +++- scripts/build-failed.sh | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config.yml b/config.yml index 91e7265..6230cf7 100644 --- a/config.yml +++ b/config.yml @@ -18,6 +18,7 @@ jitterbug: build_process: builder: ./scripts/capsule.sh on_failure: ./scripts/build-failed.sh + on_failure_email: alice@example.com options: perlbrew: 1 diff --git a/lib/jitterbug/Builder.pm b/lib/jitterbug/Builder.pm index 6441c0d..0d24620 100644 --- a/lib/jitterbug/Builder.pm +++ b/lib/jitterbug/Builder.pm @@ -142,7 +142,9 @@ sub run_task { my $sha = $desc->{'id'}; my $on_failure = $conf->{'jitterbug'}{'build_process'}{'on_failure'}; - my $failure_cmd = "$on_failure $commiter $message $output $sha"; + my $on_failure_email = + $conf->{'jitterbug'}{'build_process'}{'on_failure_email'}; + my $failure_cmd = "$on_failure $commiter $message $output $sha $on_failure_email"; debug("Running failure command: $failure_cmd"); `$failure_cmd`; } diff --git a/scripts/build-failed.sh b/scripts/build-failed.sh index 43463b3..644e35f 100755 --- a/scripts/build-failed.sh +++ b/scripts/build-failed.sh @@ -2,10 +2,11 @@ COMMITER=$1 MESSAGE=$2 OUTPUT=$3 SHA=$4 +CC_EMAIL=$5 echo " Message: $MESSAGE $OUTPUT -" | mail -s "[jitterbug] BUILD FAILED $SHA" $COMMITER +" | mail -c "$CC_EMAIL" -s "[jitterbug] BUILD FAILED $SHA" $COMMITER -- cgit v1.2.3 From 0f24016d696f5a7fbac7de7e7712c8e26278bc8f Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Tue, 11 Jan 2011 10:47:35 -0800 Subject: Attempt to fix the mangled build failure email bug --- lib/jitterbug/Builder.pm | 18 +++++++++--------- scripts/build-failed.sh | 7 +------ 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/lib/jitterbug/Builder.pm b/lib/jitterbug/Builder.pm index 0d24620..58da724 100644 --- a/lib/jitterbug/Builder.pm +++ b/lib/jitterbug/Builder.pm @@ -136,15 +136,15 @@ sub run_task { if ( !$result || ($result && $result !~ /PASS/ )) { # mail author of the commit $result = "FAIL"; - my $message = $desc->{'message'}; - my $commiter = $desc->{'author'}{'email'}; - my $output = "Build failed"; - my $sha = $desc->{'id'}; - my $on_failure = - $conf->{'jitterbug'}{'build_process'}{'on_failure'}; - my $on_failure_email = - $conf->{'jitterbug'}{'build_process'}{'on_failure_email'}; - my $failure_cmd = "$on_failure $commiter $message $output $sha $on_failure_email"; + my $message = $desc->{'message'}; + my $commiter = $desc->{'author'}{'email'}; + my $output = "Build failed"; + my $sha = $desc->{'id'}; + my $on_failure = $conf->{'jitterbug'}{'build_process'}{'on_failure'}; + my $on_failure_email = $conf->{'jitterbug'}{'build_process'}{'on_failure_email'}; + + $message =~ s/'/\\'/g; $commiter =~ s/'/\\'/g; $output =~ s/'/\\'/g; + my $failure_cmd = qq{$on_failure '$commiter' '$message' '$output' $sha $on_failure_email}; debug("Running failure command: $failure_cmd"); `$failure_cmd`; } diff --git a/scripts/build-failed.sh b/scripts/build-failed.sh index 644e35f..1be5cd2 100755 --- a/scripts/build-failed.sh +++ b/scripts/build-failed.sh @@ -4,9 +4,4 @@ OUTPUT=$3 SHA=$4 CC_EMAIL=$5 -echo " -Message: -$MESSAGE - -$OUTPUT -" | mail -c "$CC_EMAIL" -s "[jitterbug] BUILD FAILED $SHA" $COMMITER +echo "Message:\n$MESSAGE\nTest Output:\n$OUTPUT\n" | mail -c "$CC_EMAIL" -s "[jitterbug] BUILD FAILED $SHA" $COMMITER -- cgit v1.2.3 From 490c240d5f70ca5c7fabd747ec6bfb7e218eeef7 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Tue, 11 Jan 2011 15:38:50 -0500 Subject: Make build failure email more useful by including TAP output --- lib/jitterbug/Builder.pm | 4 ++-- scripts/build-failed.sh | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/jitterbug/Builder.pm b/lib/jitterbug/Builder.pm index 58da724..376b98c 100644 --- a/lib/jitterbug/Builder.pm +++ b/lib/jitterbug/Builder.pm @@ -138,13 +138,13 @@ sub run_task { $result = "FAIL"; my $message = $desc->{'message'}; my $commiter = $desc->{'author'}{'email'}; - my $output = "Build failed"; + my $output = $lines; my $sha = $desc->{'id'}; my $on_failure = $conf->{'jitterbug'}{'build_process'}{'on_failure'}; my $on_failure_email = $conf->{'jitterbug'}{'build_process'}{'on_failure_email'}; $message =~ s/'/\\'/g; $commiter =~ s/'/\\'/g; $output =~ s/'/\\'/g; - my $failure_cmd = qq{$on_failure '$commiter' '$message' '$output' $sha $on_failure_email}; + my $failure_cmd = sprintf("%s '%s' %s '%s' '%s' %s %s", $on_failure, $commiter, $task->project->name, $message, $output, $sha, $on_failure_email); debug("Running failure command: $failure_cmd"); `$failure_cmd`; } diff --git a/scripts/build-failed.sh b/scripts/build-failed.sh index 1be5cd2..ebd098a 100755 --- a/scripts/build-failed.sh +++ b/scripts/build-failed.sh @@ -1,7 +1,14 @@ COMMITER=$1 -MESSAGE=$2 -OUTPUT=$3 -SHA=$4 -CC_EMAIL=$5 +PROJECT=$2 +MESSAGE=$3 +OUTPUT=$4 +SHA=$5 +CC_EMAIL=$6 -echo "Message:\n$MESSAGE\nTest Output:\n$OUTPUT\n" | mail -c "$CC_EMAIL" -s "[jitterbug] BUILD FAILED $SHA" $COMMITER +echo " +Message: +$MESSAGE + +Test Output: +$OUTPUT +" | mail -c "$CC_EMAIL" -s "[jitterbug] FAIL $PROJECT @ $SHA" $COMMITER -- cgit v1.2.3 From b3a31c9d5ac670a7e04602bb8e7e4e3018535e35 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Tue, 11 Jan 2011 16:39:51 -0500 Subject: Make failure email more customizable, start new jitterbug::Emailer in perl --- Build.PL | 1 + config.yml | 4 +++- lib/jitterbug/Builder.pm | 4 ++-- lib/jitterbug/Emailer.pm | 43 +++++++++++++++++++++++++++++++++++++++++++ t/005_builder.t | 42 +++++++++++++++++++++++++++++++++++++----- 5 files changed, 86 insertions(+), 8 deletions(-) create mode 100644 lib/jitterbug/Emailer.pm diff --git a/Build.PL b/Build.PL index 7218a16..62f0cb4 100644 --- a/Build.PL +++ b/Build.PL @@ -27,6 +27,7 @@ my $builder = Module::Build->new( 'Digest::MD5' => 0, 'App::perlbrew' => 0, 'Dist::Zilla' => 0, + 'Email::Stuff' => 0, }, add_to_cleanup => [ 'jitterbug-' ], create_makefile_pl => 'traditional', diff --git a/config.yml b/config.yml index 6230cf7..4b88a9c 100644 --- a/config.yml +++ b/config.yml @@ -18,7 +18,9 @@ jitterbug: build_process: builder: ./scripts/capsule.sh on_failure: ./scripts/build-failed.sh - on_failure_email: alice@example.com + on_failure_cc_email: alice@example.com + on_failure_from_email: donotreply@example.com + on_failure_subject_prefix: "[jitterbug] FAIL " options: perlbrew: 1 diff --git a/lib/jitterbug/Builder.pm b/lib/jitterbug/Builder.pm index 376b98c..4a8451f 100644 --- a/lib/jitterbug/Builder.pm +++ b/lib/jitterbug/Builder.pm @@ -141,10 +141,10 @@ sub run_task { my $output = $lines; my $sha = $desc->{'id'}; my $on_failure = $conf->{'jitterbug'}{'build_process'}{'on_failure'}; - my $on_failure_email = $conf->{'jitterbug'}{'build_process'}{'on_failure_email'}; + my $on_failure_cc_email = $conf->{'jitterbug'}{'build_process'}{'on_failure_email'}; $message =~ s/'/\\'/g; $commiter =~ s/'/\\'/g; $output =~ s/'/\\'/g; - my $failure_cmd = sprintf("%s '%s' %s '%s' '%s' %s %s", $on_failure, $commiter, $task->project->name, $message, $output, $sha, $on_failure_email); + my $failure_cmd = sprintf("%s '%s' %s '%s' '%s' %s %s", $on_failure, $commiter, $task->project->name, $message, $output, $sha, $on_failure_cc_email); debug("Running failure command: $failure_cmd"); `$failure_cmd`; } diff --git a/lib/jitterbug/Emailer.pm b/lib/jitterbug/Emailer.pm new file mode 100644 index 0000000..97ec640 --- /dev/null +++ b/lib/jitterbug/Emailer.pm @@ -0,0 +1,43 @@ +package jitterbug::Emailer; + +use strict; +use warnings; +use Email::Stuff; + +sub new { + my $self = bless {} => shift; + my ($conf,$task,$tap_output) = @_; + # smelly + $self->{'conf'} = $conf; + $self->{'task'} = $task; + $self->{'tap_output'} = $tap_output; + + return $self; +} + +sub run { + my $self = shift; + my $buildconf = $conf->{'jitterbug'}{'build_process'}; + my $project = $task->project->name; + + my $sha1 = $task->commit->sha256; + my $body = <from($buildconf->{'on_failure_from_email') + ->to($buildconf->{'on_failure_to_email'}) + ->cc($buildconf->{'on_failure_cc_email'}) + ->text_body($body) + ->subject( + $buildconf->{'on_failure_subject_prefix'} . "$project @ $sha1" + ) + # Should we attach a build log for convenience? + # ->attach(io('dead_bunbun_faked.gif')->all, + # filename => 'dead_bunbun_proof.gif') + ->send; + + return $self; +} + +1; diff --git a/t/005_builder.t b/t/005_builder.t index 15795d6..84e13ef 100644 --- a/t/005_builder.t +++ b/t/005_builder.t @@ -1,7 +1,7 @@ use strict; use warnings; -use Test::Most tests => 7; +use Test::Most tests => 9; use Data::Dumper; use jitterbug::Builder; @@ -30,13 +30,45 @@ use jitterbug::Builder; my $b = jitterbug::Builder->new(); isa_ok($b, 'jitterbug::Builder'); is($b->{'configfile'}, 't/data/test.yml'); - #warn Dumper [ $b ]; is($b->run, 0, '->run returns 0 in cron mode'); cmp_deeply($b->{'conf'}, { - 'configfile' => 't/data/test.yml', - 'cron' => 1, - 'sleep' => undef + 'engines' => { + 'xslate' => { + 'type' => 'text', + 'path' => '/', + 'cache' => '0' + } + }, + 'plugins' => { + 'DBIC' => { + 'schema' => { + 'connect_info' => [ + 'dbi:SQLite:dbname=jitterbug.db' + ], + 'pckg' => 'jitterbug::Schema', + 'skip_automake' => '1' + } + } + }, + 'jitterbug' => { + 'build_process' => { + 'on_failure' => './scripts/build-failed.sh', + 'builder' => './scripts/capsule.sh' + }, + 'builder' => {}, + 'reports' => { + 'dir' => '/tmp/jitterbug' + }, + 'build' => { + 'dir' => '/tmp/build' + } + }, + 'template' => 'xslate', + 'appname' => 'jitterbug', + 'layout' => 'main', + 'logger' => 'file', + 'builds_per_feed' => '5' }); -- cgit v1.2.3 From 4bb424bf9937a0dc7b29cda40657631607ffdeaa Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Wed, 12 Jan 2011 11:46:49 -0500 Subject: Add some tests for jitterbug::Emailer --- lib/jitterbug/Emailer.pm | 6 ++++-- t/006_emailer.t | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 t/006_emailer.t diff --git a/lib/jitterbug/Emailer.pm b/lib/jitterbug/Emailer.pm index 97ec640..95bda0d 100644 --- a/lib/jitterbug/Emailer.pm +++ b/lib/jitterbug/Emailer.pm @@ -17,15 +17,17 @@ sub new { sub run { my $self = shift; - my $buildconf = $conf->{'jitterbug'}{'build_process'}; + my $task = $self->{'task'}; + my $buildconf = $self->{'conf'}->{'jitterbug'}{'build_process'}; my $project = $task->project->name; + my $tap_output = $self->{'tap_output'}; my $sha1 = $task->commit->sha256; my $body = <from($buildconf->{'on_failure_from_email') + Email::Stuff->from($buildconf->{'on_failure_from_email'}) ->to($buildconf->{'on_failure_to_email'}) ->cc($buildconf->{'on_failure_cc_email'}) ->text_body($body) diff --git a/t/006_emailer.t b/t/006_emailer.t new file mode 100644 index 0000000..cc343d1 --- /dev/null +++ b/t/006_emailer.t @@ -0,0 +1,17 @@ +use strict; +use warnings; +use Test::Most tests => 3; +use Data::Dumper; + +use_ok "jitterbug::Emailer"; + +{ + my $conf = { foo => 'bar' }; + my $task = {}; + my $tap = "1..1\nok 1\n"; + my $e = jitterbug::Emailer->new($conf, $task, $tap); + + isa_ok($e,'jitterbug::Emailer'); + can_ok($e,qw/new run/); + +} -- cgit v1.2.3 From c16d34fa7b67ad1e5db7a098e74c5f711e222403 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Wed, 12 Jan 2011 13:31:51 -0500 Subject: Fix some bugs in jitterbug::Emailer and add mocked test data --- lib/jitterbug/Emailer.pm | 6 ++++-- t/006_emailer.t | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/lib/jitterbug/Emailer.pm b/lib/jitterbug/Emailer.pm index 95bda0d..648c72f 100644 --- a/lib/jitterbug/Emailer.pm +++ b/lib/jitterbug/Emailer.pm @@ -21,14 +21,16 @@ sub run { my $buildconf = $self->{'conf'}->{'jitterbug'}{'build_process'}; my $project = $task->project->name; my $tap_output = $self->{'tap_output'}; - my $sha1 = $task->commit->sha256; + my $desc = JSON::decode_json( $task->commit->content ); + my $email = $desc->{'author'}{'email'}; + my $body = <from($buildconf->{'on_failure_from_email'}) - ->to($buildconf->{'on_failure_to_email'}) + ->to($email) ->cc($buildconf->{'on_failure_cc_email'}) ->text_body($body) ->subject( diff --git a/t/006_emailer.t b/t/006_emailer.t index cc343d1..2df25f1 100644 --- a/t/006_emailer.t +++ b/t/006_emailer.t @@ -2,12 +2,24 @@ use strict; use warnings; use Test::Most tests => 3; use Data::Dumper; +use Test::MockObject; use_ok "jitterbug::Emailer"; { - my $conf = { foo => 'bar' }; - my $task = {}; + my $conf = { jitterbug => { build_process => 'bar'} }; + my $commit = Test::MockObject->new; + my $project = Test::MockObject->new; + my $task = Test::MockObject->new; + + $project->mock('name', sub { 'ponie' }); + + $commit->mock('sha256', sub { 'c0decafe' }); + $commit->mock('content', sub { 'this should be JSON' } ); + + $task->mock('commit', sub { $commit }); + $task->mock('project', sub { $project }); + my $tap = "1..1\nok 1\n"; my $e = jitterbug::Emailer->new($conf, $task, $tap); -- cgit v1.2.3 From 83d87bb186b79f45beaf6380c78ba7b40e8acf57 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Wed, 12 Jan 2011 13:32:36 -0500 Subject: Add Test::MockObject as a dep --- Build.PL | 1 + 1 file changed, 1 insertion(+) diff --git a/Build.PL b/Build.PL index 62f0cb4..063b3de 100644 --- a/Build.PL +++ b/Build.PL @@ -11,6 +11,7 @@ my $builder = Module::Build->new( include_dirs => '', build_requires => { 'Test::Most' => 0, + 'Test::MockObject'=> 0, }, requires => { 'YAML' => 0, -- cgit v1.2.3 From b2fe2456e476962c19cceb74b1d17fb0f22c3c3e Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Wed, 12 Jan 2011 10:56:48 -0800 Subject: More tests for jitterbug::Emailer --- lib/jitterbug/Emailer.pm | 26 +++++++++++++++----------- t/006_emailer.t | 25 +++++++++++++++++++------ 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/lib/jitterbug/Emailer.pm b/lib/jitterbug/Emailer.pm index 648c72f..4bf2e51 100644 --- a/lib/jitterbug/Emailer.pm +++ b/lib/jitterbug/Emailer.pm @@ -3,6 +3,7 @@ package jitterbug::Emailer; use strict; use warnings; use Email::Stuff; +use JSON; sub new { my $self = bless {} => shift; @@ -16,30 +17,33 @@ sub new { } sub run { - my $self = shift; - my $task = $self->{'task'}; - my $buildconf = $self->{'conf'}->{'jitterbug'}{'build_process'}; - my $project = $task->project->name; + my $self = shift; + my $task = $self->{'task'}; + my $buildconf = $self->{'conf'}->{'jitterbug'}{'build_process'}; + my $project = $task->project->name; my $tap_output = $self->{'tap_output'}; - my $sha1 = $task->commit->sha256; - my $desc = JSON::decode_json( $task->commit->content ); - my $email = $desc->{'author'}{'email'}; + my $sha1 = $task->commit->sha256; + my $desc = JSON::decode_json( $task->commit->content ); + my $email = $desc->{'author'}{'email'}; my $body = <from($buildconf->{'on_failure_from_email'}) - ->to($email) + my $stuff = Email::Stuff->from($buildconf->{'on_failure_from_email'}) + # bug in Email::Stuff brakes chaining if $email is empty + ->to($email || " ") ->cc($buildconf->{'on_failure_cc_email'}) ->text_body($body) ->subject( $buildconf->{'on_failure_subject_prefix'} . "$project @ $sha1" - ) + ); # Should we attach a build log for convenience? # ->attach(io('dead_bunbun_faked.gif')->all, # filename => 'dead_bunbun_proof.gif') - ->send; + $self->{'last_email_sent'} = $stuff; + + $stuff->send; return $self; } diff --git a/t/006_emailer.t b/t/006_emailer.t index 2df25f1..0dce025 100644 --- a/t/006_emailer.t +++ b/t/006_emailer.t @@ -1,29 +1,42 @@ use strict; use warnings; -use Test::Most tests => 3; +use Test::Most tests => 5; use Data::Dumper; use Test::MockObject; use_ok "jitterbug::Emailer"; { - my $conf = { jitterbug => { build_process => 'bar'} }; - my $commit = Test::MockObject->new; + my $buildconf = { + on_failure_from_email => 'bob@example.com', + on_failure_cc_email => 'steve@apple.com', + on_failure_subject_prefix => 'BLARG', + }; + + my $conf = { jitterbug => { build_process => $buildconf } }; + my $commit = Test::MockObject->new; my $project = Test::MockObject->new; - my $task = Test::MockObject->new; + my $task = Test::MockObject->new; $project->mock('name', sub { 'ponie' }); $commit->mock('sha256', sub { 'c0decafe' }); - $commit->mock('content', sub { 'this should be JSON' } ); + $commit->mock('content', sub { '{ }' } ); $task->mock('commit', sub { $commit }); $task->mock('project', sub { $project }); - my $tap = "1..1\nok 1\n"; + my $tap = "THIS IS TAP"; my $e = jitterbug::Emailer->new($conf, $task, $tap); isa_ok($e,'jitterbug::Emailer'); can_ok($e,qw/new run/); + $e->run; + my $email = $e->{'last_email_sent'}{'email'}; + like($email->body, qr/THIS IS TAP/, 'email body looks right'); + + my $header = $email->{'header'}; + isa_ok($header, 'Email::MIME::Header'); + } -- cgit v1.2.3 From ebc5a1d5adff8d041295b78a429a29ffb6b42d58 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Wed, 12 Jan 2011 11:40:22 -0800 Subject: More jitterbug::Emailer tests --- t/006_emailer.t | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/t/006_emailer.t b/t/006_emailer.t index 0dce025..feffd38 100644 --- a/t/006_emailer.t +++ b/t/006_emailer.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::Most tests => 5; +use Test::Most tests => 8; use Data::Dumper; use Test::MockObject; @@ -10,7 +10,7 @@ use_ok "jitterbug::Emailer"; my $buildconf = { on_failure_from_email => 'bob@example.com', on_failure_cc_email => 'steve@apple.com', - on_failure_subject_prefix => 'BLARG', + on_failure_subject_prefix => 'BLARG ', }; my $conf = { jitterbug => { build_process => $buildconf } }; @@ -39,4 +39,8 @@ use_ok "jitterbug::Emailer"; my $header = $email->{'header'}; isa_ok($header, 'Email::MIME::Header'); + is($header->header_raw('cc'), 'steve@apple.com', 'cc header'); + is($header->header_raw('subject'), 'BLARG ponie @ c0decafe', 'subject header'); + is($header->header_raw('from'), 'bob@example.com', 'from header'); + } -- cgit v1.2.3 From 94b70f3c91af81008a450d15b382c93705da2ce5 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Wed, 12 Jan 2011 15:56:31 -0800 Subject: Allow specification of a perl module to handle build failure emails --- lib/jitterbug/Builder.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/jitterbug/Builder.pm b/lib/jitterbug/Builder.pm index 4a8451f..297861f 100644 --- a/lib/jitterbug/Builder.pm +++ b/lib/jitterbug/Builder.pm @@ -146,7 +146,14 @@ sub run_task { $message =~ s/'/\\'/g; $commiter =~ s/'/\\'/g; $output =~ s/'/\\'/g; my $failure_cmd = sprintf("%s '%s' %s '%s' '%s' %s %s", $on_failure, $commiter, $task->project->name, $message, $output, $sha, $on_failure_cc_email); debug("Running failure command: $failure_cmd"); - `$failure_cmd`; + + # does it look like a module name? + if ($on_failure =~ /::/) { + # we should do some error checking here + $on_failure->new($conf,$task,$output)->run; + } else { + system($failure_cmd); + } } $desc->{'build'}{'version'}{$name} = $result; close $fh; -- cgit v1.2.3 From af6972d660d074f2971636c3b7384b7a75928fe7 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Wed, 12 Jan 2011 16:02:00 -0800 Subject: Allow a header and footer for failure emails to be specified --- config.yml | 2 ++ lib/jitterbug/Emailer.pm | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/config.yml b/config.yml index 4b88a9c..bf9bd23 100644 --- a/config.yml +++ b/config.yml @@ -21,6 +21,8 @@ jitterbug: on_failure_cc_email: alice@example.com on_failure_from_email: donotreply@example.com on_failure_subject_prefix: "[jitterbug] FAIL " + on_failure_header: + on_failure_footer: options: perlbrew: 1 diff --git a/lib/jitterbug/Emailer.pm b/lib/jitterbug/Emailer.pm index 4bf2e51..2af7590 100644 --- a/lib/jitterbug/Emailer.pm +++ b/lib/jitterbug/Emailer.pm @@ -25,9 +25,15 @@ sub run { my $sha1 = $task->commit->sha256; my $desc = JSON::decode_json( $task->commit->content ); my $email = $desc->{'author'}{'email'}; + my $header = $buildconf->{'on_failure_header'}; + my $footer = $buildconf->{'on_failure_footer'}; my $body = <from($buildconf->{'on_failure_from_email'}) -- cgit v1.2.3 From a7d36c2ecb88a9a25488e53f7e30385b626ff569 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Thu, 13 Jan 2011 18:00:12 -0500 Subject: Load the on_failure class at runtime before instantiating it --- lib/jitterbug/Builder.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/jitterbug/Builder.pm b/lib/jitterbug/Builder.pm index 297861f..a836f70 100644 --- a/lib/jitterbug/Builder.pm +++ b/lib/jitterbug/Builder.pm @@ -150,6 +150,7 @@ sub run_task { # does it look like a module name? if ($on_failure =~ /::/) { # we should do some error checking here + eval "require $on_failure"; $on_failure->new($conf,$task,$output)->run; } else { system($failure_cmd); -- cgit v1.2.3 From 26df149efd3b962dafa3ccd9e6c1f1f54734477c Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Thu, 13 Jan 2011 18:10:12 -0500 Subject: Put commit message in subject of failure emails and improve body format --- lib/jitterbug/Emailer.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/jitterbug/Emailer.pm b/lib/jitterbug/Emailer.pm index 2af7590..3c40bfd 100644 --- a/lib/jitterbug/Emailer.pm +++ b/lib/jitterbug/Emailer.pm @@ -23,14 +23,20 @@ sub run { my $project = $task->project->name; my $tap_output = $self->{'tap_output'}; my $sha1 = $task->commit->sha256; + my $shortsha1 = substr($sha1, 0, 8); my $desc = JSON::decode_json( $task->commit->content ); my $email = $desc->{'author'}{'email'}; + my $message = $desc->{'message'}; my $header = $buildconf->{'on_failure_header'}; my $footer = $buildconf->{'on_failure_footer'}; my $body = <cc($buildconf->{'on_failure_cc_email'}) ->text_body($body) ->subject( - $buildconf->{'on_failure_subject_prefix'} . "$project @ $sha1" + $buildconf->{'on_failure_subject_prefix'} . "$project @ $shortsha1 $message" ); # Should we attach a build log for convenience? # ->attach(io('dead_bunbun_faked.gif')->all, -- cgit v1.2.3 From 99ed391c7d50437b103ef018168a97e577698458 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Thu, 13 Jan 2011 18:55:48 -0500 Subject: Allow placeholders for project name and SHA1 in build failure emails --- lib/jitterbug/Emailer.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/jitterbug/Emailer.pm b/lib/jitterbug/Emailer.pm index 3c40bfd..ab9bedb 100644 --- a/lib/jitterbug/Emailer.pm +++ b/lib/jitterbug/Emailer.pm @@ -41,6 +41,9 @@ $tap_output $footer BODY + # Expand placeholders in our on_failure header and footer + $body =~ s/%%PROJECT%%/$project/g; + $body =~ s/%%SHA1%%/$sha1/g; my $stuff = Email::Stuff->from($buildconf->{'on_failure_from_email'}) # bug in Email::Stuff brakes chaining if $email is empty -- cgit v1.2.3 From dddeaba05015d4040ab1aeb502a81e291e9c56a4 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Tue, 18 Jan 2011 15:30:02 -0500 Subject: Refactor jitterbug::Emailer to get rid of some warnings and improve tests --- lib/jitterbug/Emailer.pm | 31 ++++++++++++++++++------------ t/006_emailer.t | 50 +++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 66 insertions(+), 15 deletions(-) diff --git a/lib/jitterbug/Emailer.pm b/lib/jitterbug/Emailer.pm index ab9bedb..60837d6 100644 --- a/lib/jitterbug/Emailer.pm +++ b/lib/jitterbug/Emailer.pm @@ -16,12 +16,29 @@ sub new { return $self; } +sub _make_body { + my ($header, $message, $tap, $footer) = @_; + + no warnings 'uninitialized'; + return <{'task'}; my $buildconf = $self->{'conf'}->{'jitterbug'}{'build_process'}; my $project = $task->project->name; - my $tap_output = $self->{'tap_output'}; + my $tap = $self->{'tap_output'}; my $sha1 = $task->commit->sha256; my $shortsha1 = substr($sha1, 0, 8); my $desc = JSON::decode_json( $task->commit->content ); @@ -29,18 +46,8 @@ sub run { my $message = $desc->{'message'}; my $header = $buildconf->{'on_failure_header'}; my $footer = $buildconf->{'on_failure_footer'}; + my $body = _make_body($header,$message, $tap, $footer); - my $body = < 'bob@example.com', on_failure_cc_email => 'steve@apple.com', @@ -21,11 +21,15 @@ use_ok "jitterbug::Emailer"; $project->mock('name', sub { 'ponie' }); $commit->mock('sha256', sub { 'c0decafe' }); - $commit->mock('content', sub { '{ }' } ); + $commit->mock('content', sub { '{ "message" : "blargly blarg" }' } ); $task->mock('commit', sub { $commit }); $task->mock('project', sub { $project }); + return ($conf, $commit, $project, $task); +} +{ + my ($conf, $commit, $project, $task) = setup(); my $tap = "THIS IS TAP"; my $e = jitterbug::Emailer->new($conf, $task, $tap); @@ -40,7 +44,47 @@ use_ok "jitterbug::Emailer"; isa_ok($header, 'Email::MIME::Header'); is($header->header_raw('cc'), 'steve@apple.com', 'cc header'); - is($header->header_raw('subject'), 'BLARG ponie @ c0decafe', 'subject header'); + like($header->header_raw('subject'), qr/BLARG ponie @ c0decafe blargly blarg/, 'subject header'); is($header->header_raw('from'), 'bob@example.com', 'from header'); +} + +{ + my $tap = < blib/lib/Math/Primality/AKS.pm +Copying lib/Math/Primality/BigPolynomial.pm -> blib/lib/Math/Primality/BigPolynomial.pm +Copying lib/Math/Primality.pm -> blib/lib/Math/Primality.pm +Copying bin/primes.pl -> blib/script/primes.pl +Copying bin/strong_psuedoprimes.pl -> blib/script/strong_psuedoprimes.pl +# Testing Math::Primality 0.0401, Perl 5.010001, /usr/bin/perl +t/00-load.t ...................... +1..1 +ok 1 - use Math::Primality; +ok +# Failed test '-1 is not prime' +# at t/is_prime.t line 16. +# Looks like you failed 1 test of 573. +t/is_prime.t ..................... +1..6 +ok 1 - is_prime should handle Math::GMPz objects, three is prime +ok 2 - 2 is prime +ok 3 - 1 is not prime +ok 4 - 0 is not prime +not ok 5 - -1 is not prime +ok 6 - blarg +t/boilerplate.t .................. +1..3 +ok 1 - README contains no boilerplate text +ok 2 - Changes contains no boilerplate text +ok 3 - lib/Math/Primality.pm contains no boilerplate text +ok +Test Summary Report +------------------- +t/is_prime.t (Wstat: 256 Tests: 573 Failed: 1) +Failed test: 5 +Non-zero exit status: 1 +Failed 1/11 test programs. 1/2498 subtests failed. +Files=11, Tests=2498, 3 wallclock secs ( 0.20 usr 0.04 sys + 2.99 cusr 0.18 csys = 3.41 CPU) +Result: FAIL +TAP } -- cgit v1.2.3 From ec1d053822687ebd35f319c9d47dd15e201e09dd Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Tue, 18 Jan 2011 17:34:41 -0500 Subject: Add ability to use test failure summary in failure email template --- lib/jitterbug/Emailer.pm | 11 +++++--- t/006_emailer.t | 65 +++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 72 insertions(+), 4 deletions(-) diff --git a/lib/jitterbug/Emailer.pm b/lib/jitterbug/Emailer.pm index 60837d6..7a8ed9e 100644 --- a/lib/jitterbug/Emailer.pm +++ b/lib/jitterbug/Emailer.pm @@ -22,13 +22,11 @@ sub _make_body { no warnings 'uninitialized'; return <{'on_failure_header'}; my $footer = $buildconf->{'on_failure_footer'}; my $body = _make_body($header,$message, $tap, $footer); + my $summary; - # Expand placeholders in our on_failure header and footer + if ( $tap =~ m/^(Test Summary Report.*)/ms ) { + $summary = $1; + } + + # Expand placeholders in our failure email $body =~ s/%%PROJECT%%/$project/g; $body =~ s/%%SHA1%%/$sha1/g; + $body =~ s/%%SUMMARY%%/$summary/g; + my $stuff = Email::Stuff->from($buildconf->{'on_failure_from_email'}) # bug in Email::Stuff brakes chaining if $email is empty diff --git a/t/006_emailer.t b/t/006_emailer.t index 9cdd14a..4c6a972 100644 --- a/t/006_emailer.t +++ b/t/006_emailer.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::Most tests => 8; +use Test::Most tests => 9; use Data::Dumper; use Test::MockObject; @@ -11,6 +11,8 @@ sub setup { on_failure_from_email => 'bob@example.com', on_failure_cc_email => 'steve@apple.com', on_failure_subject_prefix => 'BLARG ', + on_failure_header => "Summary:\n%%SUMMARY%%", + on_failure_footer => "FOOT", }; my $conf = { jitterbug => { build_process => $buildconf } }; @@ -49,6 +51,7 @@ sub setup { } { + my ($conf, $commit, $project, $task) = setup(); my $tap = < blib/lib/Math/Primality/AKS.pm Copying lib/Math/Primality/BigPolynomial.pm -> blib/lib/Math/Primality/BigPolynomial.pm @@ -86,5 +89,65 @@ Failed 1/11 test programs. 1/2498 subtests failed. Files=11, Tests=2498, 3 wallclock secs ( 0.20 usr 0.04 sys + 2.99 cusr 0.18 csys = 3.41 CPU) Result: FAIL TAP + my $e = jitterbug::Emailer->new($conf, $task, $tap); + $e->run; + my $email = $e->{'last_email_sent'}{'email'}; + my $body = < blib/lib/Math/Primality/AKS.pm +Copying lib/Math/Primality/BigPolynomial.pm -> blib/lib/Math/Primality/BigPolynomial.pm +Copying lib/Math/Primality.pm -> blib/lib/Math/Primality.pm +Copying bin/primes.pl -> blib/script/primes.pl +Copying bin/strong_psuedoprimes.pl -> blib/script/strong_psuedoprimes.pl +# Testing Math::Primality 0.0401, Perl 5.010001, /usr/bin/perl +t/00-load.t ...................... +1..1 +ok 1 - use Math::Primality; +ok +# Failed test '-1 is not prime' +# at t/is_prime.t line 16. +# Looks like you failed 1 test of 573. +t/is_prime.t ..................... +1..6 +ok 1 - is_prime should handle Math::GMPz objects, three is prime +ok 2 - 2 is prime +ok 3 - 1 is not prime +ok 4 - 0 is not prime +not ok 5 - -1 is not prime +ok 6 - blarg +t/boilerplate.t .................. +1..3 +ok 1 - README contains no boilerplate text +ok 2 - Changes contains no boilerplate text +ok 3 - lib/Math/Primality.pm contains no boilerplate text +ok +Test Summary Report +------------------- +t/is_prime.t (Wstat: 256 Tests: 573 Failed: 1) +Failed test: 5 +Non-zero exit status: 1 +Failed 1/11 test programs. 1/2498 subtests failed. +Files=11, Tests=2498, 3 wallclock secs ( 0.20 usr 0.04 sys + 2.99 cusr 0.18 csys = 3.41 CPU) +Result: FAIL + +FOOT +EMAIL + + my $ebody = $email->body; + $ebody =~ s/\r\n/\n/g; + eq_or_diff($ebody, $body, 'email body has failure summary'); } -- cgit v1.2.3 From bf58f6037d4d50dbe602926d8be0ade10bdd522a Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Tue, 18 Jan 2011 17:50:16 -0500 Subject: Get rid of uninitialized warning in the test suite --- lib/jitterbug/Emailer.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jitterbug/Emailer.pm b/lib/jitterbug/Emailer.pm index 7a8ed9e..d21028f 100644 --- a/lib/jitterbug/Emailer.pm +++ b/lib/jitterbug/Emailer.pm @@ -45,7 +45,7 @@ sub run { my $header = $buildconf->{'on_failure_header'}; my $footer = $buildconf->{'on_failure_footer'}; my $body = _make_body($header,$message, $tap, $footer); - my $summary; + my $summary = ''; if ( $tap =~ m/^(Test Summary Report.*)/ms ) { $summary = $1; -- cgit v1.2.3 From 8d17111416abf16574189ee345c72b0cfe439f97 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Tue, 18 Jan 2011 18:44:39 -0800 Subject: Add support for testing some Parrot and Perl 6 projects --- scripts/capsule.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/capsule.sh b/scripts/capsule.sh index c91d50a..419f3b2 100755 --- a/scripts/capsule.sh +++ b/scripts/capsule.sh @@ -15,6 +15,12 @@ function jitterbug_build () { # ./Build installdeps is not available in older Module::Build's cpanm --installdeps . HARNESS_VERBOSE=1 ./Build test --verbose >> $logfile 2>&1 + elif [ -f 'setup.pir' ]; then + echo "Found setup.pir" + HARNESS_VERBOSE=1 parrot setup.pir test >> $logfile 2>&1 + elif [ -f 'setup.nqp' ]; then + echo "Found setup.nqp" + HARNESS_VERBOSE=1 parrot-nqp setup.nqp test >> $logfile 2>&1 else echo "Hoping to find Makefile.PL" perl Makefile.PL -- cgit v1.2.3 From e398651ae5caa8b80c3e65bc1c40b8ac6a69f5c6 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Tue, 18 Jan 2011 18:54:06 -0800 Subject: Add support for building+testing Parrot VM and Rakudo Perl 6 --- scripts/capsule.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/capsule.sh b/scripts/capsule.sh index 419f3b2..abc632d 100755 --- a/scripts/capsule.sh +++ b/scripts/capsule.sh @@ -15,17 +15,21 @@ function jitterbug_build () { # ./Build installdeps is not available in older Module::Build's cpanm --installdeps . HARNESS_VERBOSE=1 ./Build test --verbose >> $logfile 2>&1 + elif [ -f 'Makefile.PL' ]; then + echo "Found Makefile.PL" + perl Makefile.PL + cpanm --installdeps . + HARNESS_VERBOSE=1 make test >> $logfile 2>&1 elif [ -f 'setup.pir' ]; then echo "Found setup.pir" HARNESS_VERBOSE=1 parrot setup.pir test >> $logfile 2>&1 elif [ -f 'setup.nqp' ]; then echo "Found setup.nqp" HARNESS_VERBOSE=1 parrot-nqp setup.nqp test >> $logfile 2>&1 - else - echo "Hoping to find Makefile.PL" - perl Makefile.PL + elif [ -f 'Configure.pl' ]; then + echo "Found Configure.pl" + perl Configure.pl cpanm --installdeps . - make HARNESS_VERBOSE=1 make test >> $logfile 2>&1 fi } -- cgit v1.2.3 From 266d5cca294a0a689e0c48753cea24b5ae001175 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Wed, 19 Jan 2011 09:27:49 -0800 Subject: Try not to ire the SpamCop Elder Gods --- t/006_emailer.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/006_emailer.t b/t/006_emailer.t index 4c6a972..c5e090e 100644 --- a/t/006_emailer.t +++ b/t/006_emailer.t @@ -9,7 +9,7 @@ use_ok "jitterbug::Emailer"; sub setup { my $buildconf = { on_failure_from_email => 'bob@example.com', - on_failure_cc_email => 'steve@apple.com', + on_failure_cc_email => 'steve@example.com', on_failure_subject_prefix => 'BLARG ', on_failure_header => "Summary:\n%%SUMMARY%%", on_failure_footer => "FOOT", -- cgit v1.2.3 From 952325b718086602b836a165dfa4f5e72e5bed9e Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Wed, 19 Jan 2011 09:28:26 -0800 Subject: Fix a jitterbug::Emailer test --- t/006_emailer.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/006_emailer.t b/t/006_emailer.t index c5e090e..44dd328 100644 --- a/t/006_emailer.t +++ b/t/006_emailer.t @@ -45,7 +45,7 @@ sub setup { my $header = $email->{'header'}; isa_ok($header, 'Email::MIME::Header'); - is($header->header_raw('cc'), 'steve@apple.com', 'cc header'); + is($header->header_raw('cc'), 'steve@example.com', 'cc header'); like($header->header_raw('subject'), qr/BLARG ponie @ c0decafe blargly blarg/, 'subject header'); is($header->header_raw('from'), 'bob@example.com', 'from header'); } -- cgit v1.2.3