MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Bjorn Munch Date:August 18 2009 7:39am
Subject:bzr commit into mysql-5.1-mtr branch (Bjorn.Munch:2817) Bug#44222
View as plain text  
#At file:///home/bm136801/my/start-51/ based on revid:bjorn.munch@stripped

 2817 Bjorn Munch	2009-08-18
      Bug #44222 mysql-test-run --start analyses which tests it would skip. This is redundant.
      Quicker test collection and better output with --start[-dirty]

    modified:
      mysql-test/lib/mtr_cases.pm
      mysql-test/mysql-test-run.pl
=== modified file 'mysql-test/lib/mtr_cases.pm'
--- a/mysql-test/lib/mtr_cases.pm	2009-05-25 20:58:31 +0000
+++ b/mysql-test/lib/mtr_cases.pm	2009-08-18 07:38:18 +0000
@@ -41,6 +41,7 @@ our $opt_with_ndbcluster_only;
 our $defaults_file;
 our $defaults_extra_file;
 our $reorder= 1;
+our $quick_collect;
 
 sub collect_option {
   my ($opt, $value)= @_;
@@ -68,6 +69,9 @@ require "mtr_misc.pl";
 my $do_test_reg;
 my $skip_test_reg;
 
+# If "Quick collect", set to 1 once a test to run has been found.
+my $some_test_found;
+
 sub init_pattern {
   my ($from, $what)= @_;
   return undef unless defined $from;
@@ -102,6 +106,7 @@ sub collect_test_cases ($$) {
   foreach my $suite (split(",", $suites))
   {
     push(@$cases, collect_one_suite($suite, $opt_cases));
+    last if $some_test_found;
   }
 
   if ( @$opt_cases )
@@ -139,7 +144,7 @@ sub collect_test_cases ($$) {
     }
   }
 
-  if ( $reorder )
+  if ( $reorder && !$quick_collect)
   {
     # Reorder the test cases in an order that will make them faster to run
     my %sort_criteria;
@@ -386,7 +391,7 @@ sub collect_one_suite($)
   # Read combinations for this suite and build testcases x combinations
   # if any combinations exists
   # ----------------------------------------------------------------------
-  if ( ! $skip_combinations )
+  if ( ! $skip_combinations && ! $quick_collect )
   {
     my @combinations;
     my $combination_file= "$suitedir/combinations";
@@ -583,6 +588,12 @@ sub optimize_cases {
 	  if ( $default_engine =~ /^innodb/i );
       }
     }
+
+    if ($quick_collect && ! $tinfo->{'skip'})
+    {
+      $some_test_found= 1;
+      return;
+    }
   }
 }
 

=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2009-08-13 13:29:19 +0000
+++ b/mysql-test/mysql-test-run.pl	2009-08-18 07:38:18 +0000
@@ -209,6 +209,7 @@ sub check_timeout { return $opt_testcase
 
 my $opt_start;
 my $opt_start_dirty;
+my $start_only;
 my $opt_wait_all;
 my $opt_repeat= 1;
 my $opt_retry= 3;
@@ -1263,10 +1264,18 @@ sub command_line_setup {
   }
 
   # --------------------------------------------------------------------------
+  # Modified behavior with --start options
+  # --------------------------------------------------------------------------
+  if ($opt_start or $opt_start_dirty) {
+    collect_option ('quick-collect', 1);
+    $start_only= 1;
+  }
+
+  # --------------------------------------------------------------------------
   # Check use of wait-all
   # --------------------------------------------------------------------------
 
-  if ($opt_wait_all && ! ($opt_start_dirty || $opt_start))
+  if ($opt_wait_all && ! $start_only)
   {
     mtr_error("--wait-all can only be used with --start or --start-dirty");
   }
@@ -2824,7 +2833,7 @@ sub run_testcase_check_skip_test($)
 
   if ( $tinfo->{'skip'} )
   {
-    mtr_report_test_skipped($tinfo);
+    mtr_report_test_skipped($tinfo) unless $start_only;
     return 1;
   }
 
@@ -3311,9 +3320,16 @@ sub run_testcase ($) {
   # server exits
   # ----------------------------------------------------------------------
 
-  if ( $opt_start or $opt_start_dirty )
+  if ( $start_only )
   {
     mtr_print("\nStarted", started(all_servers()));
+    mtr_print("Using config for test", $tinfo->{name});
+    mtr_print("Port and socket path for server(s):");
+    foreach my $mysqld ( mysqlds() )
+    {
+      mtr_print ($mysqld->name() . "  " . $mysqld->value('port') .
+	      "  " . $mysqld->value('socket'));
+    }
     mtr_print("Waiting for server(s) to exit...");
     if ( $opt_wait_all ) {
       My::SafeProcess->wait_all();


Attachment: [text/bzr-bundle] bzr/bjorn.munch@sun.com-20090818073818-y3xgltffcxpwzznq.bundle
Thread
bzr commit into mysql-5.1-mtr branch (Bjorn.Munch:2817) Bug#44222Bjorn Munch18 Aug