Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tasks/dev.rake')
-rw-r--r--lib/tasks/dev.rake15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/tasks/dev.rake b/lib/tasks/dev.rake
index 42b12cd0ae3..08a11100431 100644
--- a/lib/tasks/dev.rake
+++ b/lib/tasks/dev.rake
@@ -58,9 +58,13 @@ namespace :dev do
namespace :copy_db do
ALLOWED_DATABASES = %w[ci].freeze
+ defined_copy_db_tasks = []
+
ActiveRecord::Tasks::DatabaseTasks.for_each(databases) do |name|
next unless ALLOWED_DATABASES.include?(name)
+ defined_copy_db_tasks << name
+
desc "Copies the #{name} database from the main database"
task name => :environment do
Rake::Task["dev:terminate_all_connections"].invoke
@@ -72,5 +76,16 @@ namespace :dev do
warn "Database '#{db_config.database}' already exists"
end
end
+
+ ALLOWED_DATABASES.each do |name|
+ next if defined_copy_db_tasks.include?(name)
+
+ # :nocov: we cannot mock ActiveRecord::Tasks::DatabaseTasks in time
+ # Workaround for GDK issue, see
+ # https://gitlab.com/gitlab-org/gitlab-development-kit/-/issues/1464
+ desc "No-op task"
+ task name
+ # :nocov:
+ end
end
end