summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Ilyin <dilyin@mirantis.com>2016-05-24 18:54:01 +0300
committerDmitry Ilyin <dilyin@mirantis.com>2016-05-24 19:08:42 +0300
commit21da3912a0bf8ce86ecdff8b712c98ad31763337 (patch)
tree3a130d2ed4fd44ee5c8d1bf682563a3aad507a9e
parentda6ea6109e3ca92c852c4543bb226569c74beb50 (diff)
Improve environment integration
Notes
Notes (review): Verified+1: Fuel CI <fuel-ci-bot@mirantis.com> Code-Review+1: Sergii Golovatiuk <sgolovatiuk@mirantis.com> Code-Review+2: Dmitry Ilyin <dilyin@mirantis.com> Workflow+1: Dmitry Ilyin <dilyin@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Fri, 27 May 2016 16:19:46 +0000 Reviewed-on: https://review.openstack.org/320547 Project: openstack/fuel-noop-fixtures Branch: refs/heads/master
-rw-r--r--lib/noop/config/base.rb8
-rw-r--r--lib/noop/manager/base.rb4
-rw-r--r--lib/noop/manager/options.rb2
-rw-r--r--lib/noop/task/run.rb9
-rwxr-xr-xnoop_tests.rb6
5 files changed, 24 insertions, 5 deletions
diff --git a/lib/noop/config/base.rb b/lib/noop/config/base.rb
index a09c55e..aa43e91 100644
--- a/lib/noop/config/base.rb
+++ b/lib/noop/config/base.rb
@@ -117,7 +117,13 @@ module Noop
117 # @return [Pathname] 117 # @return [Pathname]
118 def self.dir_path_reports 118 def self.dir_path_reports
119 return @dir_path_reports if @dir_path_reports 119 return @dir_path_reports if @dir_path_reports
120 @dir_path_reports = dir_path_root + 'reports' 120 @dir_path_reports = Noop::Utils.path_from_env 'SPEC_REPORTS_DIR'
121 @dir_path_reports = dir_path_root + 'reports' unless @dir_path_reports
122 begin
123 @dir_path_reports = @dir_path_reports.realpath
124 rescue
125 @dir_path_reports
126 end
121 end 127 end
122 end 128 end
123end 129end
diff --git a/lib/noop/manager/base.rb b/lib/noop/manager/base.rb
index 7915bb0..98f6a63 100644
--- a/lib/noop/manager/base.rb
+++ b/lib/noop/manager/base.rb
@@ -176,7 +176,9 @@ module Noop
176 176
177######################################### 177#########################################
178 178
179 def main 179 def main(override_options = {})
180 options.merge! override_options
181
180 if ENV['SPEC_TASK_CONSOLE'] 182 if ENV['SPEC_TASK_CONSOLE']
181 require 'pry' 183 require 'pry'
182 binding.pry 184 binding.pry
diff --git a/lib/noop/manager/options.rb b/lib/noop/manager/options.rb
index 4765662..5db9504 100644
--- a/lib/noop/manager/options.rb
+++ b/lib/noop/manager/options.rb
@@ -15,7 +15,7 @@ module Noop
15 opts.on('-j', '--jobs JOBS', 'Parallel run RSpec jobs') do |jobs| 15 opts.on('-j', '--jobs JOBS', 'Parallel run RSpec jobs') do |jobs|
16 @options[:parallel_run] = jobs 16 @options[:parallel_run] = jobs
17 end 17 end
18 opts.on('-g', '--globals', 'Run all globals tasks and update saved globals YAML files') do |jobs| 18 opts.on('-g', '--globals', 'Run all globals tasks and update saved globals YAML files') do
19 ENV['SPEC_UPDATE_GLOBALS'] = 'YES' 19 ENV['SPEC_UPDATE_GLOBALS'] = 'YES'
20 options[:filter_specs] = [Noop::Config.spec_name_globals] 20 options[:filter_specs] = [Noop::Config.spec_name_globals]
21 end 21 end
diff --git a/lib/noop/task/run.rb b/lib/noop/task/run.rb
index 09f4309..56ab03c 100644
--- a/lib/noop/task/run.rb
+++ b/lib/noop/task/run.rb
@@ -59,6 +59,15 @@ module Noop
59 'SPEC_FACTS_NAME' => file_name_facts.to_s, 59 'SPEC_FACTS_NAME' => file_name_facts.to_s,
60 'SPEC_FILE_NAME' => file_name_spec.to_s, 60 'SPEC_FILE_NAME' => file_name_spec.to_s,
61 'GEM_HOME' => Noop::Config.dir_path_gem_home.to_s, 61 'GEM_HOME' => Noop::Config.dir_path_gem_home.to_s,
62
63 'SPEC_ROOT_DIR' => Noop::Config.dir_path_root.to_s,
64 'SPEC_DEPLOYMENT_DIR' => Noop::Config.dir_path_deployment.to_s,
65 'SPEC_HIERA_DIR' => Noop::Config.dir_path_hiera.to_s,
66 'SPEC_FACTS_DIR' => Noop::Config.dir_path_facts.to_s,
67 'SPEC_REPORTS_DIR' => Noop::Config.dir_path_reports.to_s,
68 'SPEC_SPEC_DIR' => Noop::Config.dir_path_task_spec.to_s,
69 'SPEC_TASK_DIR' => Noop::Config.dir_path_tasks_local.to_s,
70 'SPEC_MODULE_PATH' => Noop::Config.dir_path_modules_local.to_s,
62 } 71 }
63 command = "rspec #{file_path_spec.to_s} #{rspec_options} --format json --out #{file_path_report_json.to_s}" 72 command = "rspec #{file_path_spec.to_s} #{rspec_options} --format json --out #{file_path_report_json.to_s}"
64 command = "bundle exec #{command}" if ENV['SPEC_BUNDLE_EXEC'] 73 command = "bundle exec #{command}" if ENV['SPEC_BUNDLE_EXEC']
diff --git a/noop_tests.rb b/noop_tests.rb
index 5e5a2ba..e5369bb 100755
--- a/noop_tests.rb
+++ b/noop_tests.rb
@@ -5,5 +5,7 @@ require_relative 'lib/noop/task'
5require_relative 'lib/noop/manager' 5require_relative 'lib/noop/manager'
6require_relative 'lib/noop/utils' 6require_relative 'lib/noop/utils'
7 7
8manager = Noop::Manager.new 8if $0 == __FILE__
9manager.main 9 manager = Noop::Manager.new
10 manager.main
11end