Skip to content

Commit

Permalink
Squash this commit with the previous commit if it pass code review
Browse files Browse the repository at this point in the history
The ability to have custom result directory for the certain options combination
was added to MTR. To use it just add option "mtr-result-dir" in the certain
options group in 'combinations' file.

The ability to add only the certain list of tests for the certain option
combination is added to MTR. For this purpose the new "mtr-tests-list" option
is introduced. This option contains comma-separated list of tests in the
current suite, which will be executed for the current options combination.

As an example of the new options see changed and newly created "combination"
files of this commit.

The above features are used to test TokuDB and RocksDB native and non-native
partitioning, that is why the corresponding test suits have two directories
for result files for one directory of tests.
  • Loading branch information
vlad-lesin committed Sep 11, 2018
1 parent ac40861 commit 764df7f
Show file tree
Hide file tree
Showing 196 changed files with 429,178 additions and 14 deletions.
24 changes: 23 additions & 1 deletion mysql-test/lib/mtr_cases.pm
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,17 @@ sub collect_one_suite($)
my $comb= {};
$comb->{name}= $group->name();
foreach my $option ( $group->options() ) {
push(@{$comb->{comb_opt}}, $option->option());
my $option_string = $option->option();
if ($option_string =~ m/--mtr[-_]result[-_]dir\s*=\s*(.+)/) {
mtr_verbose("The result dir was changed to $1");
$comb->{result_dir} = $1;
} elsif ($option_string =~ m/--mtr[-_]tests[-_]list\s*=\s*(.+)/) {
my @comb_tests_array = split (/,/, $1);
my %comb_tests_set = map { $_ => 1 } @comb_tests_array;
$comb->{tests_set} = \%comb_tests_set;
} else {
push(@{$comb->{comb_opt}}, $option->option());
}
}
push(@combinations, $comb);
}
Expand All @@ -564,6 +574,8 @@ sub collect_one_suite($)

next if ( $test->{'skip'} );

next if ($comb->{tests_set} and not
$comb->{tests_set}->{$test->{shortname}});
# Skip this combination if the values it provides
# already are set in master_opt or slave_opt
if (My::Options::is_set($test->{master_opt}, $comb->{comb_opt}) &&
Expand All @@ -585,6 +597,16 @@ sub collect_one_suite($)
push(@{$new_test->{master_opt}}, @{$comb->{comb_opt}});
push(@{$new_test->{slave_opt}}, @{$comb->{comb_opt}});

if ($comb->{result_dir}) {
my $result_file = "$suitedir/$comb->{result_dir}/".
"$new_test->{shortname}.result";
if (-f $result_file) {
$new_test->{result_file} = $result_file;
} else {
$new_test->{record_file} = $result_file;
}
}

# Add combination name short name
$new_test->{combination}= $comb->{name};

Expand Down
27 changes: 27 additions & 0 deletions mysql-test/suite/parts/inc/disable_native_partitioning.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--let $MYSQLD_DATADIR=`select @@datadir`

--let $restart_parameters = "restart: --loose-$disable_native_partition_opt=0"
--source include/restart_mysqld.inc

eval CREATE TABLE t1 (a INT UNSIGNED NOT NULL, PRIMARY KEY(a)) ENGINE = $engine
PARTITION BY RANGE (a) (
PARTITION p0 VALUES LESS THAN (100),
PARTITION p1 VALUES LESS THAN (200)
);

--list_files $MYSQLD_DATADIR/test *.par

DROP TABLE t1;

--let $restart_parameters = "restart: "
--source include/restart_mysqld.inc

eval CREATE TABLE t1 (a INT UNSIGNED NOT NULL, PRIMARY KEY(a)) ENGINE = $engine
PARTITION BY RANGE (a) (
PARTITION p0 VALUES LESS THAN (100),
PARTITION p1 VALUES LESS THAN (200)
);

--list_files $MYSQLD_DATADIR/test *.par

DROP TABLE t1;
22 changes: 22 additions & 0 deletions mysql-test/suite/rocksdb.rpl/combinations
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,25 @@ binlog-format=statement

[mix]
binlog-format=mixed

[row-write-committed-native-partitioning]
mtr-result-dir = r-native-partitioning
mtr-tests-list = rpl_rocksdb_extra_col_slave
binlog-format=row
loose-rocksdb_write_policy=write_committed
loose-rocksdb-enable-native-partition=on

[row-write-prepared-native-partitioning]
mtr-result-dir = r-native-partitioning
mtr-tests-list = rpl_rocksdb_extra_col_slave
binlog-format=row
loose-rocksdb_write_policy=write_prepared
loose-rocksdb_commit_time_batch_for_recovery=on
loose-rocksdb-enable-native-partition=on

[stmt-native-partitioning]
mtr-result-dir = r-native-partitioning
mtr-tests-list = rpl_skip_trx_api_binlog_format
binlog-format=statement
loose-rocksdb-enable-native-partition=on

Loading

0 comments on commit 764df7f

Please sign in to comment.