Allow using a different socket to test mysql

This commit is contained in:
Rafael Mendonça França 2021-08-05 14:27:30 -04:00
parent d4d14a34a1
commit c91a8135c7
No known key found for this signature in database
GPG Key ID: FC23B6D0F1EEE948
2 changed files with 7 additions and 1 deletions

View File

@ -197,7 +197,7 @@ namespace :db do
namespace :mysql do
connection_arguments = lambda do |connection_name|
config = ARTest.config["connections"]["mysql2"][connection_name]
["--user=#{config["username"]}", "--password=#{config["password"]}", ("--host=#{config["host"]}" if config["host"])].join(" ")
["--user=#{config["username"]}", "--password=#{config["password"]}", ("--host=#{config["host"]}" if config["host"]), ("--socket=#{config["socket"]}" if config["socket"])].join(" ")
end
desc "Build the MySQL test databases"

View File

@ -45,6 +45,9 @@ connections:
<% end %>
<% if ENV['MYSQL_HOST'] %>
host: <%= ENV['MYSQL_HOST'] %>
<% end %>
<% if ENV['MYSQL_SOCK'] %>
socket: "<%= ENV['MYSQL_SOCK'] %>"
<% end %>
arunit2:
username: rails
@ -56,6 +59,9 @@ connections:
<% if ENV['MYSQL_HOST'] %>
host: <%= ENV['MYSQL_HOST'] %>
<% end %>
<% if ENV['MYSQL_SOCK'] %>
socket: "<%= ENV['MYSQL_SOCK'] %>"
<% end %>
oracle:
arunit: