Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MTR flag to mark tests as incompatible with macOS #3113

Open
wants to merge 1 commit into
base: 11.4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
MTR flag to mark tests as incompatible with macOS
Introduces a new MTR include, not_mac.inc, which when included
at the top of a test, prevents that test from running on macOS.
  • Loading branch information
DaveGosselin-MariaDB committed May 15, 2024
commit f97383b55fec98fbbe50a3df2812cc8841e4f9d3
4 changes: 4 additions & 0 deletions mysql-test/include/not_mac.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#
# suite.pm will make sure that all tests including this file
# will be skipped if run under macOS
#
10 changes: 9 additions & 1 deletion mysql-test/lib/My/Platform.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use File::Path;
use Carp;

use base qw(Exporter);
our @EXPORT= qw(IS_CYGWIN IS_MSYS IS_WINDOWS IS_WIN32PERL IS_AIX
our @EXPORT= qw(IS_CYGWIN IS_MSYS IS_WINDOWS IS_WIN32PERL IS_AIX IS_MAC
native_path posix_path mixed_path
check_socket_path_length process_alive open_for_append);

Expand Down Expand Up @@ -70,6 +70,14 @@ BEGIN {
}
}

BEGIN {
DaveGosselin-MariaDB marked this conversation as resolved.
Show resolved Hide resolved
if ($^O eq "darwin") {
eval 'sub IS_MAC { 1 }';
}
else {
eval 'sub IS_MAC { 0 }';
}
}

#
# native_path
Expand Down
3 changes: 3 additions & 0 deletions mysql-test/main/json_normalize.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Test doesn't work on macOS.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor suggestion:
This is redundant as including not_mac.inc in the line below already implies this.
Perhaps a brief explanation of why this test doesn't work on macOS as a comment or in the commit description would be better.

Apart from that, looks good.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Tony, thank you for the suggestion. I haven't (yet) investigated why this test doesn't work on macOS, but I will. Just not for this commit; its purpose is to demonstrate how to use not_mac.inc.

--source include/not_mac.inc

set names utf8;

create table t1 (json json);
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite.pm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ sub skip_combinations {

$skip{'include/not_windows.inc'} = 'Requires not Windows' if IS_WINDOWS;
$skip{'include/not_aix.inc'} = 'Requires not AIX' if IS_AIX;

$skip{'include/not_mac.inc'} = 'Requires not macOS' if IS_MAC;
$skip{'main/plugin_loaderr.test'} = 'needs compiled-in innodb'
unless $::mysqld_variables{'innodb'} eq "ON";

Expand Down