From ae3392b0a19afe542e5f57dc48d02d3daee213c3 Mon Sep 17 00:00:00 2001 From: Stejskal Leos Date: Thu, 25 Jan 2024 10:18:36 +0000 Subject: [PATCH] Rename rake task discovery -> foreman_discovery --- .rubocop_todo.yml | 4 ++-- README.md | 4 ++-- lib/{discovery.rake => foreman_discovery.rake} | 6 +++--- lib/foreman_discovery/engine.rb | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) rename lib/{discovery.rake => foreman_discovery.rake} (80%) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 0be024707..5cc23bcdc 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -255,7 +255,7 @@ Layout/SpaceAfterComma: Exclude: - 'app/helpers/discovered_hosts_helper.rb' - 'app/models/host/discovered.rb' - - 'lib/discovery.rake' + - 'lib/foreman_discovery.rake' - 'test/unit/host_discovered_test.rb' # Offense count: 1 @@ -820,7 +820,7 @@ Style/ConditionalAssignment: Exclude: - 'app/helpers/discovery_rules_helper.rb' - 'app/models/host/discovered.rb' - - 'lib/discovery.rake' + - 'lib/foreman_discovery.rake' - 'test/functional/discovered_hosts_controller_test.rb' - 'test/unit/discovered_extensions_test.rb' diff --git a/README.md b/README.md index 1e00c61ed..6185b6476 100644 --- a/README.md +++ b/README.md @@ -26,11 +26,11 @@ instead of github.com issues. Please report issues there. There are unit and integration tests in the repository, to run them execute the following in the *Foreman core* directory: - bundle exec rake test:discovery + bundle exec rake test:foreman_discovery It is possible to execute a single test, however the path must be *absolute* (e.g. use `$HOME` variable): - bundle exec rake test:discovery TEST=~/work/foreman_discovery/test/unit/host_discovered_test.rb + bundle exec rake test:foreman_discovery TEST=~/work/foreman_discovery/test/unit/host_discovered_test.rb # Copyright diff --git a/lib/discovery.rake b/lib/foreman_discovery.rake similarity index 80% rename from lib/discovery.rake rename to lib/foreman_discovery.rake index 8ff8ac0f4..06bc9ebfd 100644 --- a/lib/discovery.rake +++ b/lib/foreman_discovery.rake @@ -1,7 +1,7 @@ # Setup Tests namespace :test do desc "Test Discovery plugin" - Rake::TestTask.new(:discovery) do |t| + Rake::TestTask.new(:foreman_discovery) do |t| test_dir = File.join(File.dirname(__FILE__), '..', 'test') t.libs << ["test",test_dir] if ENV['FILE'] || ENV['TEST'] @@ -14,13 +14,13 @@ namespace :test do end end Rake::Task[:test].enhance do - Rake::Task['test:discovery'].invoke + Rake::Task['test:foreman_discovery'].invoke end load 'tasks/jenkins.rake' if Rake::Task.task_defined?(:'jenkins:unit') # The "unit" tests also include system tests Rake::Task["jenkins:unit"].enhance(['webpack:compile']) do - Rake::Task['test:discovery'].invoke + Rake::Task['test:foreman_discovery'].invoke end end diff --git a/lib/foreman_discovery/engine.rb b/lib/foreman_discovery/engine.rb index 45607ddf2..0326130fb 100644 --- a/lib/foreman_discovery/engine.rb +++ b/lib/foreman_discovery/engine.rb @@ -367,7 +367,7 @@ class Engine < ::Rails::Engine end rake_tasks do - load "discovery.rake" + load "foreman_discovery.rake" Rake::Task['db:seed'].enhance do ForemanDiscovery::Engine.load_seed end