Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions bin/integrations
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# bin/integrations batch retry # Run tests matching 'batch' OR 'retry'
# bin/integrations -v fifo # Run with verbose output

require 'bundler'
require 'fileutils'
require 'timeout'

Expand Down Expand Up @@ -88,9 +89,11 @@ class IntegrationRunner
end

def run_spec(spec)
# Start with a clean bundler environment to prevent pollution between tests
env = {
'BUNDLE_GEMFILE' => spec[:gemfile],
'RAILS_ENV' => 'test'
'RAILS_ENV' => 'test',
'RUBYOPT' => nil # Clear any -rbundler/setup from CI or previous tests
}

# Install dependencies if using a local Gemfile
Expand Down Expand Up @@ -131,8 +134,13 @@ class IntegrationRunner

begin
Timeout.timeout(TIMEOUT) do
IO.popen(env, cmd, chdir: spec[:directory], err: [:child, :out]) do |io|
io.each_line { |line| output << line }
# Use unbundled env to prevent pollution from previous test runs
# This is especially important after Rails integration tests that use
# bundle install --standalone with different gem versions
Bundler.with_unbundled_env do
IO.popen(env, cmd, chdir: spec[:directory], err: [:child, :out]) do |io|
io.each_line { |line| output << line }
end
end
end

Expand Down