diff --git a/app/models/foreman_wreckingball/cpu_hot_add_status.rb b/app/models/foreman_wreckingball/cpu_hot_add_status.rb index 152d1e7..781960c 100644 --- a/app/models/foreman_wreckingball/cpu_hot_add_status.rb +++ b/app/models/foreman_wreckingball/cpu_hot_add_status.rb @@ -14,7 +14,7 @@ def self.host_association end def self.description - N_('Enabling CPU hot-add disables vNUMA, the virtual machine will instead use UMA. This might cause a performance degration.') # rubocop:disable Metrics/LineLength + N_('Enabling CPU hot-add disables vNUMA, the virtual machine will instead use UMA. This might cause a performance degration.') # rubocop:disable Layout/LineLength end def self.supports_remediate? diff --git a/app/services/foreman_wreckingball/vmware_cluster_importer.rb b/app/services/foreman_wreckingball/vmware_cluster_importer.rb index 4475ba9..1042360 100644 --- a/app/services/foreman_wreckingball/vmware_cluster_importer.rb +++ b/app/services/foreman_wreckingball/vmware_cluster_importer.rb @@ -14,7 +14,7 @@ def import! delete_removed_clusters create_new_clusters end - logger.info("Import clusters for '#{compute_resource}' completed. Added: #{counters[:added] || 0}, Updated: #{counters[:updated] || 0}, Deleted: #{counters[:deleted] || 0} clusters") # rubocop:disable Metrics/LineLength + logger.info("Import clusters for '#{compute_resource}' completed. Added: #{counters[:added] || 0}, Updated: #{counters[:updated] || 0}, Deleted: #{counters[:deleted] || 0} clusters") # rubocop:disable Layout/LineLength end def delete_removed_clusters diff --git a/app/services/foreman_wreckingball/vmware_hypervisor_importer.rb b/app/services/foreman_wreckingball/vmware_hypervisor_importer.rb index e14808f..8dccabc 100644 --- a/app/services/foreman_wreckingball/vmware_hypervisor_importer.rb +++ b/app/services/foreman_wreckingball/vmware_hypervisor_importer.rb @@ -16,7 +16,7 @@ def import! import_hypervisors(cluster) delete_removed_hypervisors(cluster) end - logger.info("Import hypervisors for '#{compute_resource}' completed. Added: #{counters[:added] || 0}, Updated: #{counters[:updated] || 0}, Deleted: #{counters[:deleted] || 0} hypervisors") # rubocop:disable Metrics/LineLength + logger.info("Import hypervisors for '#{compute_resource}' completed. Added: #{counters[:added] || 0}, Updated: #{counters[:updated] || 0}, Deleted: #{counters[:deleted] || 0} hypervisors") # rubocop:disable Layout/LineLength end def import_hypervisors(cluster) diff --git a/lib/tasks/foreman_vmware_checks_tasks.rake b/lib/tasks/foreman_vmware_checks_tasks.rake index fc347f0..ca2d4a6 100644 --- a/lib/tasks/foreman_vmware_checks_tasks.rake +++ b/lib/tasks/foreman_vmware_checks_tasks.rake @@ -26,17 +26,4 @@ namespace :test do end end -namespace :foreman_wreckingball do - require 'rubocop/rake_task' - RuboCop::RakeTask.new(:rubocop) do |task| - task.patterns = ["#{ForemanWreckingball::Engine.root}/app/**/*.rb", - "#{ForemanWreckingball::Engine.root}/lib/**/*.rb", - "#{ForemanWreckingball::Engine.root}/test/**/*.rb"] - end -rescue LoadError => e - raise e unless Rails.env.production? -end - Rake::Task[:test].enhance ['test:foreman_wreckingball'] - -require 'rubocop/rake_task' diff --git a/test/unit/foreman_wreckingball/access_permissions_test.rb b/test/unit/foreman_wreckingball/access_permissions_test.rb new file mode 100644 index 0000000..ef96c49 --- /dev/null +++ b/test/unit/foreman_wreckingball/access_permissions_test.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'test_plugin_helper' +require 'unit/shared/access_permissions_test_base' + +# Permissions are added in AccessPermissions with lists of controllers and +# actions that they enable access to. For non-admin users, we need to test +# that there are permissions available that cover every controller action, else +# it can't be delegated and this will lead to parts of the application that +# aren't functional for non-admin users. +# +# In particular, it's important that actions for AJAX requests are added to +# an appropriate permission so views using those requests function. +class AccessPermissionsTest < ActiveSupport::TestCase + include AccessPermissionsTestBase + + check_routes(ForemanWreckingball::Engine.routes, []) +end