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 # @return [Pathname] def self.dir_path_reports return @dir_path_reports if @dir_path_reports - @dir_path_reports = dir_path_root + 'reports' + @dir_path_reports = Noop::Utils.path_from_env 'SPEC_REPORTS_DIR' + @dir_path_reports = dir_path_root + 'reports' unless @dir_path_reports + begin + @dir_path_reports = @dir_path_reports.realpath + rescue + @dir_path_reports + end end end end 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 ######################################### - def main + def main(override_options = {}) + options.merge! override_options + if ENV['SPEC_TASK_CONSOLE'] require 'pry' 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 opts.on('-j', '--jobs JOBS', 'Parallel run RSpec jobs') do |jobs| @options[:parallel_run] = jobs end - opts.on('-g', '--globals', 'Run all globals tasks and update saved globals YAML files') do |jobs| + opts.on('-g', '--globals', 'Run all globals tasks and update saved globals YAML files') do ENV['SPEC_UPDATE_GLOBALS'] = 'YES' options[:filter_specs] = [Noop::Config.spec_name_globals] 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 'SPEC_FACTS_NAME' => file_name_facts.to_s, 'SPEC_FILE_NAME' => file_name_spec.to_s, 'GEM_HOME' => Noop::Config.dir_path_gem_home.to_s, + + 'SPEC_ROOT_DIR' => Noop::Config.dir_path_root.to_s, + 'SPEC_DEPLOYMENT_DIR' => Noop::Config.dir_path_deployment.to_s, + 'SPEC_HIERA_DIR' => Noop::Config.dir_path_hiera.to_s, + 'SPEC_FACTS_DIR' => Noop::Config.dir_path_facts.to_s, + 'SPEC_REPORTS_DIR' => Noop::Config.dir_path_reports.to_s, + 'SPEC_SPEC_DIR' => Noop::Config.dir_path_task_spec.to_s, + 'SPEC_TASK_DIR' => Noop::Config.dir_path_tasks_local.to_s, + 'SPEC_MODULE_PATH' => Noop::Config.dir_path_modules_local.to_s, } command = "rspec #{file_path_spec.to_s} #{rspec_options} --format json --out #{file_path_report_json.to_s}" 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' require_relative 'lib/noop/manager' require_relative 'lib/noop/utils' -manager = Noop::Manager.new -manager.main +if $0 == __FILE__ + manager = Noop::Manager.new + manager.main +end