From c91a8135c77619711b245e4bcbff72f34edfc3a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 5 Aug 2021 14:27:30 -0400 Subject: [PATCH] Allow using a different socket to test mysql --- activerecord/Rakefile | 2 +- activerecord/test/config.example.yml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/activerecord/Rakefile b/activerecord/Rakefile index ed101bee35..8b502a9b1a 100644 --- a/activerecord/Rakefile +++ b/activerecord/Rakefile @@ -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" diff --git a/activerecord/test/config.example.yml b/activerecord/test/config.example.yml index 5a07cb2672..5d9882e2d1 100644 --- a/activerecord/test/config.example.yml +++ b/activerecord/test/config.example.yml @@ -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: