Permalink
Browse files

[FEAT] notify option

  • Loading branch information...
1 parent a04953c commit a6b67f6a07745af5437e45af578ba82a250cc4cb @Caldrin Caldrin committed Dec 5, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/Tapper/CLI/Testrun/Command/new.pm
View
8 lib/Tapper/CLI/Testrun/Command/new.pm
@@ -46,9 +46,10 @@ my $options = { "verbose" => { text => "some more informational output
"multiple requested features are AND evaluated, i.e. each must fit; ".
"not evaluated if a matching requested host is found already", type => 'manystring' },
"priority" => { text => "Boolean; This is a very important testrun that should bypass scheduling and not wait for others", type => 'withno' },
-
+ "notify" => { text => "STRING, create a notification for when the testrun is finished, possibly with filter for 'fail' or 'success'", type => 'optstring' },
};
+
sub opt_spec {
my @opt_spec;
foreach my $key (keys %$options) {
@@ -57,6 +58,7 @@ sub opt_spec {
given($options->{$key}->{type}){
when ("string") {$pushkey .="=s";}
+ when ("optstring") {$pushkey .=":s";}
when ("withno") {$pushkey .="!";}
when ("manystring") {$pushkey .="=s@";}
when ("optmanystring") {$pushkey .=":s@";}
@@ -254,8 +256,9 @@ sub new_runtest
shortname => $opt->{shortname} || '',
topic => $opt->{topic} || 'Misc',
};
- my @ids;
+ $testrun->{notify} = ($opt->{notify} || 'all') if exists $opt->{notify};
+ my @ids;
@ids = $self->create_macro_preconditions($opt, $args) if $opt->{macroprecond};
push @ids, @{$opt->{precondition}} if $opt->{precondition};
@@ -286,6 +289,7 @@ sub new_runtest
push @ids, $self->add_feature($testrun_id, $feature);
}
}
+
$testrun_search->testrun_scheduling->status('schedule');
$testrun_search->testrun_scheduling->update;

0 comments on commit a6b67f6

Please sign in to comment.