Skip to content

Commit ccf646d

Browse files
committed
Merge branch '50-stable' into 51-stable
* 50-stable: [test] on MariaDB 10.2+ we're allowed to change default [test] skip tests when jdbc/mysql n/a
2 parents a85c6aa + 72e7f03 commit ccf646d

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

test/db/mysql/change_column_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ class MySQLChangeColumnTest < Test::Unit::TestCase
1313
ActiveRecord::Migration.add_column :people, :about, :string, :default => 'x'
1414
# NOTE: even in non strict mode MySQL does not allow us add or change
1515
# text/binary with a default ...
16-
if ar_version('4.2')
16+
if mariadb_server? && ActiveRecord::Base.connection.database_version >= '10.2'
17+
ActiveRecord::Migration.change_column :people, :about, :text
18+
else
1719
assert_raises ActiveRecord::StatementInvalid do
1820
ActiveRecord::Migration.change_column :people, :about, :text
1921
end
20-
else
21-
ActiveRecord::Migration.change_column :people, :about, :text
2222
end
2323
ActiveRecord::Migration.add_column :people, :photo, :binary
2424
end

test/db/mysql/unit_test.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def initialize; end
110110
end
111111

112112
test 'configuration attempts to load MySQL driver by default' do
113-
load_jdbc_mysql
113+
skip 'jdbc/mysql not available' if load_jdbc_mysql.nil?
114114

115115
connection_handler = connection_handler_stub
116116

@@ -121,7 +121,7 @@ def initialize; end
121121
end
122122

123123
test 'configuration uses driver_name from Jdbc::MySQL' do
124-
load_jdbc_mysql
124+
skip 'jdbc/mysql not available' if load_jdbc_mysql.nil?
125125

126126
connection_handler = connection_handler_stub
127127

@@ -133,7 +133,7 @@ def initialize; end
133133
end
134134

135135
test 'configuration sets up properties according to connector/j driver (>= 8.0)' do
136-
load_jdbc_mysql
136+
skip 'jdbc/mysql not available' if load_jdbc_mysql.nil?
137137

138138
connection_handler = connection_handler_stub
139139

@@ -150,6 +150,8 @@ def initialize; end
150150

151151
def load_jdbc_mysql
152152
require 'jdbc/mysql'
153+
rescue LoadError
154+
return nil
153155
end
154156

155157
end

0 commit comments

Comments
 (0)