From 93805487c3386008de5f219dc718a4c7c92907fb Mon Sep 17 00:00:00 2001 From: Marcel Hild Date: Wed, 19 Jul 2017 11:43:09 +0200 Subject: [PATCH] run provider generator to sync changes from core --- .rspec | 1 + .rspec_ci | 1 + README.md | 2 ++ Rakefile | 10 +++------- bin/setup | 2 +- bin/update | 2 +- config/settings.yml | 12 ++++++++++++ lib/manageiq-providers-lenovo.rb | 2 ++ lib/tasks/README.md | 6 ++++++ lib/tasks/lenovo.rake | 10 ++++++++++ lib/tasks_private/spec.rake | 10 ++++++++++ spec/spec_helper.rb | 1 + 12 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 config/settings.yml create mode 100644 lib/manageiq-providers-lenovo.rb create mode 100644 lib/tasks/README.md create mode 100644 lib/tasks/lenovo.rake create mode 100644 lib/tasks_private/spec.rake diff --git a/.rspec b/.rspec index 1c13385c05..30a045574b 100644 --- a/.rspec +++ b/.rspec @@ -2,3 +2,4 @@ --require spec_helper --color --order random +--exclude-pattern "spec/manageiq/**/*_spec.rb" diff --git a/.rspec_ci b/.rspec_ci index a635c038c7..ef3e060477 100644 --- a/.rspec_ci +++ b/.rspec_ci @@ -3,3 +3,4 @@ --color --order random --profile 25 +--exclude-pattern "spec/manageiq/**/*_spec.rb" diff --git a/README.md b/README.md index a1ab062838..d91ffc4325 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ See the section on pluggable providers in the [ManageIQ Developer Setup](http://manageiq.org/docs/guides/developer_setup) +For quick local setup run `bin/setup`, which will clone the core ManageIQ repository under the *spec* directory and setup necessary config files. If you have already cloned it, you can run `bin/update` to bring the core ManageIQ code up to date. + ## License The gem is available as open source under the terms of the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0). diff --git a/Rakefile b/Rakefile index 5d1c037791..452f0b4736 100644 --- a/Rakefile +++ b/Rakefile @@ -1,20 +1,16 @@ require 'bundler/setup' -require 'bundler/gem_tasks' begin require 'rspec/core/rake_task' APP_RAKEFILE = File.expand_path("../spec/manageiq/Rakefile", __FILE__) load 'rails/tasks/engine.rake' + load 'rails/tasks/statistics.rake' rescue LoadError end -namespace :spec do - desc "Setup environment for specs" - task :setup => 'app:test:providers:lenovo:setup' -end +require 'bundler/gem_tasks' -desc "Run all Lenovo specs" -task :spec => 'app:test:providers:lenovo' +FileList['lib/tasks_private/**/*.rake'].each { |r| load r } task :default => :spec diff --git a/bin/setup b/bin/setup index e01a8505c0..b3837b0559 100755 --- a/bin/setup +++ b/bin/setup @@ -9,4 +9,4 @@ unless gem_root.join("spec/manageiq").exist? end require gem_root.join("spec/manageiq/lib/manageiq/environment").to_s -ManageIQ::Environment.manageiq_plugin_setup +ManageIQ::Environment.manageiq_plugin_setup(gem_root) diff --git a/bin/update b/bin/update index 417a86127c..5a8b21228b 100755 --- a/bin/update +++ b/bin/update @@ -11,4 +11,4 @@ else end require gem_root.join("spec/manageiq/lib/manageiq/environment").to_s -ManageIQ::Environment.manageiq_plugin_setup +ManageIQ::Environment.manageiq_plugin_update(gem_root) diff --git a/config/settings.yml b/config/settings.yml new file mode 100644 index 0000000000..e955423021 --- /dev/null +++ b/config/settings.yml @@ -0,0 +1,12 @@ +--- +:ems: + :ems_lenovo: + :blacklisted_event_names: [] + :event_handling: + :event_groups: +:http_proxy: + :lenovo: + :host: + :password: + :port: + :user: diff --git a/lib/manageiq-providers-lenovo.rb b/lib/manageiq-providers-lenovo.rb new file mode 100644 index 0000000000..506317ed62 --- /dev/null +++ b/lib/manageiq-providers-lenovo.rb @@ -0,0 +1,2 @@ +require "manageiq/providers/lenovo/engine" +require "manageiq/providers/lenovo/version" diff --git a/lib/tasks/README.md b/lib/tasks/README.md new file mode 100644 index 0000000000..0d36d3ebb1 --- /dev/null +++ b/lib/tasks/README.md @@ -0,0 +1,6 @@ +Tasks (.rake files) in this directory will be available in the main ManageIQ app. +They can be executed in the provider gem via the app: namespace + +bin/rails app: + +Task private to the provider should go into lib/tasks/tasks_private. diff --git a/lib/tasks/lenovo.rake b/lib/tasks/lenovo.rake new file mode 100644 index 0000000000..5076497561 --- /dev/null +++ b/lib/tasks/lenovo.rake @@ -0,0 +1,10 @@ +#namespace :manageiq do +# namespace :providers do +# namespace :lenovo do +# desc "Explaining what the task does" +# task :your_task do +# # Task goes here +# end +# end +# end +#end diff --git a/lib/tasks_private/spec.rake b/lib/tasks_private/spec.rake new file mode 100644 index 0000000000..da5c5d3827 --- /dev/null +++ b/lib/tasks_private/spec.rake @@ -0,0 +1,10 @@ +namespace :spec do + desc "Setup environment specs" + task :setup => ["app:test:vmdb:setup"] +end + +desc "Run all specs" +RSpec::Core::RakeTask.new(:spec => ["app:test:initialize", "app:evm:compile_sti_loader"]) do |t| + spec_dir = File.expand_path("../../spec", __dir__) + EvmTestHelper.init_rspec_task(t, ['--require', File.join(spec_dir, 'spec_helper')]) +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e0bda47f0f..1badde2949 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,3 +9,4 @@ end Dir[Rails.root.join("spec/shared/**/*.rb")].each { |f| require f } +Dir[ManageIQ::Providers::Lenovo::Engine.root.join("spec/support/**/*.rb")].each { |f| require f }