Permalink
Browse files

Refactor _parse_results and enable debugging in the git tests

  • Loading branch information...
1 parent 526465a commit 2e70da0107303e88428d7ac58773cb0a06b5d5c3 @leto leto committed May 24, 2011
Showing with 6 additions and 6 deletions.
  1. +5 −5 lib/jitterbug/Builder.pm
  2. +1 −1 t/008_git_clone.t
View
@@ -234,15 +234,15 @@ sub _parse_results {
my $on_failure_cc_email = $conf->{'jitterbug'}{'build_process'}{'on_failure_cc_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_cc_email);
- debug("Running failure command: $failure_cmd");
-
# 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,'failure')->run;
} else {
+ 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");
+
system($failure_cmd);
}
} elsif ($email_on_pass) {
@@ -256,15 +256,15 @@ sub _parse_results {
my $on_pass_cc_email = $conf->{'jitterbug'}{'build_process'}{'on_pass_cc_email'};
$message =~ s/'/\\'/g; $commiter =~ s/'/\\'/g; $output =~ s/'/\\'/g;
- my $pass_cmd = sprintf("%s '%s' %s '%s' '%s' %s %s", $on_pass, $commiter, $task->project->name, $message, $output, $sha, $on_pass_cc_email);
- debug("Running pass command: $pass_cmd");
# does it look like a module name?
if ($on_pass =~ /::/) {
# we should do some error checking here
eval "require $on_pass";
$on_pass->new($conf,$task,$output, 'pass')->run;
} else {
+ my $pass_cmd = sprintf("%s '%s' %s '%s' '%s' %s %s", $on_pass, $commiter, $task->project->name, $message, $output, $sha, $on_pass_cc_email);
+ debug("Running pass command: $pass_cmd");
system($pass_cmd);
}
}
View
@@ -52,7 +52,7 @@ if (can_run('git')){
lives_ok sub { system("$^X -Ilib scripts/post_to_hook.pl") }, 'post_to_hook.pl lives';
- lives_ok sub { # $ENV{DEBUG} = 1;
+ lives_ok sub { $ENV{DEBUG} = 1;
system("$^X -Ilib scripts/builder.pl -c t/data/test.yml -C")
}, 'builder.pl lives';

0 comments on commit 2e70da0

Please sign in to comment.