lib/openstudio/extension/runner.rb in openstudio-extension-0.2.5 vs lib/openstudio/extension/runner.rb in openstudio-extension-0.2.6

- old
+ new

@@ -75,20 +75,20 @@ puts 'Using runner options from runner.conf file' runner_config = OpenStudio::Extension::RunnerConfig.new(dirname) # use the default values overriden with runner.conf values @options = @options.merge(runner_config.options) end - + # use the passed values or defaults overriden by passed options @options = @options.merge(options) - + puts "Initializing runner with dirname: '#{dirname}' and options: #{@options}" @dirname = File.absolute_path(dirname) - + # use passed options, otherwise assume @dirname - @gemfile_path = (!@options.key?(:gemfile_path) || @options[:gemfile_path] === '') ? File.join(@dirname, 'Gemfile') : @options[:gemfile_path] - @bundle_install_path = (!@options.key?(:bundle_install_path) || @options[:bundle_install_path] === '')? File.join(@dirname, '.bundle/install/') : @options[:bundle_install_path] + @gemfile_path = !@options.key?(:gemfile_path) || @options[:gemfile_path] === '' ? File.join(@dirname, 'Gemfile') : @options[:gemfile_path] + @bundle_install_path = !@options.key?(:bundle_install_path) || @options[:bundle_install_path] === '' ? File.join(@dirname, '.bundle/install/') : @options[:bundle_install_path] @original_dir = Dir.pwd # puts "DIRNAME: #{@dirname}" # puts "@gemfile_path set to: #{@gemfile_path}" # puts "@bundle_install_path set to: #{@bundle_install_path}" @@ -654,10 +654,19 @@ STDOUT.flush else puts 'simulations are not performed, since to the @options[:run_simulations] is set to false' end - # DLM: this does not always return false for failed CLI runs, consider checking for failed.job file as backup test + if @options[:run_simulations] + # Additional checks for failed CLI + if File.exist?(File.join(run_dir, 'failed.job')) + result = false + end + + if !File.exist?(File.join(run_dir, 'finished.job')) + result = false + end + end return result end # run osws, return any failure messages