Skip to content

Commit

Permalink
Merge pull request #63 from durandom/provider_generator
Browse files Browse the repository at this point in the history
run provider generator to sync changes from core
  • Loading branch information
Fryguy authored Jul 20, 2017
2 parents bac97e4 + 9380548 commit d10e68d
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 9 deletions.
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
--require spec_helper
--color
--order random
--exclude-pattern "spec/manageiq/**/*_spec.rb"
1 change: 1 addition & 0 deletions .rspec_ci
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
--color
--order random
--profile 25
--exclude-pattern "spec/manageiq/**/*_spec.rb"
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
10 changes: 3 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion bin/update
Original file line number Diff line number Diff line change
Expand Up @@ -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)
12 changes: 12 additions & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
:ems:
:ems_lenovo:
:blacklisted_event_names: []
:event_handling:
:event_groups:
:http_proxy:
:lenovo:
:host:
:password:
:port:
:user:
2 changes: 2 additions & 0 deletions lib/manageiq-providers-lenovo.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require "manageiq/providers/lenovo/engine"
require "manageiq/providers/lenovo/version"
6 changes: 6 additions & 0 deletions lib/tasks/README.md
Original file line number Diff line number Diff line change
@@ -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>

Task private to the provider should go into lib/tasks/tasks_private.
10 changes: 10 additions & 0 deletions lib/tasks/lenovo.rake
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions lib/tasks_private/spec.rake
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

0 comments on commit d10e68d

Please sign in to comment.