test/multiverse/lib/multiverse/runner.rb in newrelic_rpm-3.8.1.221 vs test/multiverse/lib/multiverse/runner.rb in newrelic_rpm-3.9.0.229
- old
+ new
@@ -44,19 +44,31 @@
end
opts
end
def run(filter="", opts={})
+ execute_suites(filter, opts) do |suite|
+ suite.execute
+ end
+ end
+
+ def prime(filter="", opts={})
+ execute_suites(filter, opts) do |suite|
+ suite.prime
+ end
+ end
+
+ def execute_suites(filter, opts)
Dir.new(SUITES_DIRECTORY).entries.each do |dir|
full_path = File.join(SUITES_DIRECTORY, dir)
next if dir =~ /\A\./
next unless filter.nil? || dir.include?(filter)
next unless File.exists?(File.join(full_path, "Envfile"))
begin
suite = Suite.new(full_path, opts)
- suite.execute
+ yield suite
rescue => e
puts red("Error when trying to run suite in #{full_path.inspect}")
puts
puts "#{e.class}: #{e}"
puts *e.backtrace