Skip to content

Commit 3f91b75

Browse files
committed
Bug #36480926 Backport --accept-test-fail mtr option to 8.0
Adding option --accept-test-fail. This will also enable --force. No special handling of the corner case where this is combined with running a single test and that test fails. This will not be treated as an error, but I think that's acceptable behavior. Change-Id: Ie73ab1980ded7ce97cee7ab13e514751ec6ce3b3
1 parent 5a30427 commit 3f91b75

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

mysql-test/mysql-test-run.dox

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3974,6 +3974,13 @@
39743974
Display a help message and exit.
39753975
</li>
39763976

3977+
<li>
3978+
<tt>`--accept-test-fail`</tt>
3979+
3980+
Do not print an error and do not give exit 1 if some tests failed,
3981+
but test run was completed. This also enables --force.
3982+
</li>
3983+
39773984
<li>
39783985
<tt>`--big-test`</tt>
39793986

mysql-test/mysql-test-run.pl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@
158158
my $opt_valgrind_clients = 0;
159159
my $opt_valgrind_mysqld = 0;
160160
my $opt_valgrind_mysqltest = 0;
161+
my $opt_accept_fail = 0;
161162

162163
# Options used when connecting to an already running server
163164
my %opts_extern;
@@ -477,6 +478,11 @@ sub main {
477478
lock_order_prepare($bindir);
478479
}
479480

481+
if ($opt_accept_fail and not $opt_force) {
482+
$opt_force = 1;
483+
mtr_report("accept-test-fail turned on: enabling --force");
484+
}
485+
480486
# Collect test cases from a file and put them into '@opt_cases'.
481487
if ($opt_do_test_list) {
482488
collect_test_cases_from_list(\@opt_cases, $opt_do_test_list, \$opt_ctest);
@@ -921,7 +927,7 @@ sub main {
921927

922928
print_total_times($opt_parallel) if $opt_report_times;
923929

924-
mtr_report_stats("Completed", $completed);
930+
mtr_report_stats("Completed", $completed, $opt_accept_fail);
925931

926932
remove_vardir_subs() if $opt_clean_vardir;
927933

@@ -1755,6 +1761,7 @@ sub command_line_setup {
17551761
'vardir=s' => \$opt_vardir,
17561762

17571763
# Misc
1764+
'accept-test-fail' => \$opt_accept_fail,
17581765
'charset-for-testdb=s' => \$opt_charset_for_testdb,
17591766
'colored-diff' => \$opt_colored_diff,
17601767
'comment=s' => \$opt_comment,
@@ -8032,6 +8039,9 @@ ($)
80328039
80338040
Misc options
80348041
8042+
accept-test-fail Do not print an error and do not give exit 1 if
8043+
some tests failed, but test run was completed.
8044+
This option also turns on --force.
80358045
charset-for-testdb CREATE DATABASE test CHARACTER SET <option value>.
80368046
colored-diff Colorize the diff part of the output.
80378047
comment=STR Write STR to the output.

0 commit comments

Comments
 (0)