diff --git a/.rubocop.yml b/.rubocop.yml index 23c3ac2..6aa5134 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -58,6 +58,9 @@ Style/SymbolArray: Metrics/AbcSize: Enabled: false +Metrics/ClassLength: + Enabled: false + Metrics/BlockLength: Exclude: - Rakefile diff --git a/ruby/Gemfile.lock b/ruby/Gemfile.lock index 935d48e..77d0b6d 100644 --- a/ruby/Gemfile.lock +++ b/ruby/Gemfile.lock @@ -1,13 +1,13 @@ PATH remote: ../../../.. specs: - appsignal (3.0.15) + appsignal (3.9.2) rack GEM remote: https://rubygems.org/ specs: - rack (2.2.3) + rack (3.1.5) PLATFORMS ruby diff --git a/spec/support/runner.rb b/spec/support/runner.rb index ea2f19d..5823fb4 100644 --- a/spec/support/runner.rb +++ b/spec/support/runner.rb @@ -91,7 +91,11 @@ def install_report? end def run_env - { "APPSIGNAL_PUSH_API_KEY" => @push_api_key } + { + "APPSIGNAL_PUSH_API_KEY" => @push_api_key, + "APPSIGNAL_PUSH_API_ENDPOINT" => ENV["APPSIGNAL_PUSH_API_ENDPOINT"], + "APPSIGNAL_DIAGNOSE_ENDPOINT" => ENV["APPSIGNAL_DIAGNOSE_ENDPOINT"] + } end def run_command(_arguments) @@ -99,23 +103,29 @@ def run_command(_arguments) end def run # rubocop:disable Metrics/MethodLength - Dir.chdir directory do - before_setup - setup_commands.each do |command| - run_setup command + Bundler.with_unbundled_env do + Dir.chdir directory do + before_setup + setup_commands.each do |command| + run_setup command + end + after_setup end - after_setup end # Run the command prompt = @prompt ? %(echo "#{@prompt}" | ) : "" command = run_command(@arguments.dup) read, write = IO.pipe - pid = spawn( - run_env, - "#{prompt} #{command}", - { [:out, :err] => write, :chdir => directory } - ) + env = run_env + pid = + Bundler.with_unbundled_env do + spawn( + env, + "#{prompt} #{command}", + { [:out, :err] => write, :chdir => directory } + ) + end _pid, status = Process.wait2 pid # Wait until command exits write.close