Skip to content

Commit

Permalink
mtr: fix testname,combination syntax to work in many-combination case
Browse files Browse the repository at this point in the history
in particular, "innodb.innodb-page_encryption,xtradb" should
select these three tests:

innodb.innodb-page_encryption 'cbc,xtradb' [ pass ]  35563
innodb.innodb-page_encryption 'ctr,xtradb' [ pass ]  36858
innodb.innodb-page_encryption 'ecb,xtradb' [ pass ]  36741

and deselect all innodb_plugin tests. This was not the case, because
the %test_combs hash was destructively modified in the loop
  • Loading branch information
vuvova committed Apr 8, 2015
1 parent 5fcba6e commit 32e5304
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions mysql-test/lib/mtr_cases.pm
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ sub make_combinations($$@)
if (My::Options::is_set($test->{master_opt}, $comb->{comb_opt}) &&
My::Options::is_set($test->{slave_opt}, $comb->{comb_opt}) ){

delete $test_combs->{$comb->{name}};
$test_combs->{$comb->{name}} = 2;

# Add combination name short name
push @{$test->{combinations}}, $comb->{name};
Expand All @@ -627,8 +627,9 @@ sub make_combinations($$@)
}

# Skip all other combinations, if this combination is forced
if (delete $test_combs->{$comb->{name}}) {
if ($test_combs->{$comb->{name}}) {
@combinations = ($comb); # run the loop below only for this combination
$test_combs->{$comb->{name}} = 2;
last;
}
}
Expand Down Expand Up @@ -858,9 +859,10 @@ sub collect_one_test_case {
{
@cases = map make_combinations($_, \%test_combs, @{$comb}), @cases;
}
if (keys %test_combs) {
my @no_combs = grep { $test_combs{$_} == 1 } keys %test_combs;
if (@no_combs) {
mtr_error("Could not run $name with '".(
join(',', sort keys %test_combs))."' combination(s)");
join(',', sort @no_combs))."' combination(s)");
}

for $tinfo (@cases) {
Expand Down

0 comments on commit 32e5304

Please sign in to comment.