From 3c94a36c7c6a6b5e610f59fcf8481b24fcef6785 Mon Sep 17 00:00:00 2001 From: Rosa Gutierrez Date: Mon, 9 Sep 2024 15:30:18 +0200 Subject: [PATCH] Add `rake test` task to run tests over the 3 DBs we support --- Rakefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Rakefile b/Rakefile index e7793b5c..951e3527 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "bundler/setup" APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__) @@ -6,3 +8,14 @@ load "rails/tasks/engine.rake" load "rails/tasks/statistics.rake" require "bundler/gem_tasks" + +def databases + %w[ mysql postgres sqlite ] +end + +task :test do + databases.each do |database| + sh("TARGET_DB=#{database} bin/setup") + sh("TARGET_DB=#{database} bin/rails test") + end +end