Merge "Improve environment integration"
This commit is contained in:
commit
f925f5e84c
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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']
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user