Skip to content

Commit

Permalink
Update multiverse run message
Browse files Browse the repository at this point in the history
The message that read something like
"Running "/Users/jbunch/git/public/newrelic-ruby-
agent/test/multiverse/suites/grpc" in 2 environments in serial"
was slightly misleading, as the 2 environments would be from
a single Envfile-produced Gemfile for both chain and prepend
instrumentation permutations. It would also get repeated
when the next instrumentation permutation would start its test
run.

Now, the message reads something like:
Running "logger" suite in 1 CHAIN environment and
1 PREPEND environment in serial

And will only be printed at the top of the suite's run.
  • Loading branch information
kaylareopelle committed Aug 23, 2022
1 parent 1c6f410 commit 1dd1650
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions test/multiverse/lib/multiverse/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def parse_args(args)

def run(filter = "", opts = {})
execute_suites(filter, opts) do |suite|
puts yellow(suite.execution_message)
suite.each_instrumentation_method do |method|
suite.execute(method)
end
Expand Down
14 changes: 10 additions & 4 deletions test/multiverse/lib/multiverse/suite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,6 @@ def execute(instrumentation_method)
return unless check_environment_condition
configure_instrumentation_method(instrumentation_method)

label = should_serialize? ? 'serial' : 'parallel'
env_count = filter_env ? 1 : environments.size
puts yellow("\nRunning #{directory.inspect} in #{env_count} environments in #{label}")

environments.before.call if environments.before
if should_serialize?
execute_serial(instrumentation_method)
Expand Down Expand Up @@ -681,6 +677,16 @@ def verbose?
def exclude?(file)
EXCLUDED_FILES.include?(File.basename(file))
end

def execution_message
label = should_serialize? ? 'serial' : 'parallel'
env_count = filter_env ? 1 : environments.size
env_plural = env_count > 1 ? 'environments' : 'environment'
opening = "\nRunning \"#{suite}\" suite in"
body = environments.instrumentation_permutations.map { |p| "#{env_count} #{p.upcase} #{env_plural}" }
ending = "in #{label}"
message = [opening, body.join(' and '), ending].join(' ')
end
end
end

Expand Down

0 comments on commit 1dd1650

Please sign in to comment.