You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-cvs@httpd.apache.org by st...@apache.org on 2004/09/14 21:42:20 UTC

cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestSmoke.pm

stas        2004/09/14 12:42:20

  Modified:    perl-framework/Apache-Test Changes
               perl-framework/Apache-Test/lib/Apache TestSmoke.pm
  Log:
  Apache::TestSmoke imrovements:
   o the command line option -iterations=N should always be respected
     (previously it was internally overriden for order!='random').
   o since IPC::Run3 broke the Ctrl-C handler, we started to loose any
     intermediate results, should the run be aborted. So for now, try to
     always store those results in the temp
     smoke-report...$iter.temp
  
  Revision  Changes    Path
  1.164     +8 -0      httpd-test/perl-framework/Apache-Test/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/Changes,v
  retrieving revision 1.163
  retrieving revision 1.164
  diff -u -u -r1.163 -r1.164
  --- Changes	5 Sep 2004 16:30:29 -0000	1.163
  +++ Changes	14 Sep 2004 19:42:20 -0000	1.164
  @@ -8,6 +8,14 @@
   
   =item 1.14-dev
   
  +Apache::TestSmoke imrovements: [Stas]
  + o the command line option -iterations=N should always be respected
  +   (previously it was internally overriden for order!='random').
  + o since IPC::Run3 broke the Ctrl-C handler, we started to loose any
  +   intermediate results, should the run be aborted. So for now, try to
  +   always store those results in the temp file:
  +   smoke-report...$iter.temp
  +
   fix 'require blib' in scripts to also call 'blib->import', required to
   have an effect under perl 5.6.x. [Stas]
   
  
  
  
  1.32      +24 -7     httpd-test/perl-framework/Apache-Test/lib/Apache/TestSmoke.pm
  
  Index: TestSmoke.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestSmoke.pm,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -u -r1.31 -r1.32
  --- TestSmoke.pm	5 Sep 2004 00:11:30 -0000	1.31
  +++ TestSmoke.pm	14 Sep 2004 19:42:20 -0000	1.32
  @@ -88,11 +88,10 @@
       $self->{order}   = $opts->{order}   || 'random';
       $self->{verbose} = $opts->{verbose} || 0;
   
  -    # it doesn't make sense to run a known sequence more than once
  -    if ($self->{order} eq 'random') {
  -        $self->{run_iter} = $opts->{iterations} || DEFAULT_ITERATIONS;
  -    }
  -    else {
  +    # unless specifically asked to, it doesn't make sense to run a
  +    # known sequence more than once
  +    $self->{run_iter} = $opts->{iterations} || DEFAULT_ITERATIONS;
  +    if ($self->{order} ne 'random' and !$opts->{iterations}) {
           error "forcing only one iteration for non-random order";
           $self->{run_iter} = 1;
       }
  @@ -311,8 +310,9 @@
       my $reduce_iter = 0;
       my @good = ();
       warning "\n" . sep("-");
  -    warning sprintf "[%03d-%02d-%02d] trying all tests $self->{times} times",
  -        $iter, $reduce_iter, 0;
  +    warning sprintf "[%03d-%02d-%02d] trying all tests %d time%s",
  +        $iter, $reduce_iter, 0, $self->{times},
  +        ($self->{times} > 1 ? "s" : "");
   
       # first time run all tests, or all specified tests
       my @tests = @{ $self->{tests} }; # copy 
  @@ -377,6 +377,7 @@
                   my $num = @ok;
                   error "*** reduction $reduce_iter succeeded ($num tests) ***";
                   $self->{total_reduction_successes}++;
  +                $self->log_successful_reduction($iter, \@ok);
                   last;
               }
           }
  @@ -613,6 +614,7 @@
       $time =~ s/:/-/g; # winFU
       my $file = $self->{opts}->{report} ||
           catfile Apache::Test::vars('top_dir'), "smoke-report-$time.txt";
  +    $self->{runtime}->{report} = $file;
       info "Report file: $file";
   
       open my $fh, ">$file" or die "cannot open $file for writing: $!";
  @@ -708,6 +710,21 @@
   EOM
           close $fh;
       }
  +}
  +
  +# in case the smoke gets killed before it had a chance to finish and
  +# write the report, at least we won't lose the last successful reduction
  +# XXX: this wasn't needed before we switched to IPC::Run3, since
  +# Ctrl-C would log the collected data, but it doesn't work with
  +# IPC::Run3. So if that gets fixed, we can remove that function
  +sub log_successful_reduction {
  +    my($self, $iter, $tests) = @_;
  +
  +    my $file = $self->{runtime}->{report} . ".$iter.temp";
  +    debug "saving in $file";
  +    open my $fh, ">$file" or die "cannot open $file for writing: $!";
  +    print $fh join " ", @$tests;
  +    close $fh;
   }
   
   sub build_config_as_string {