diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e86026..8f8117e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,7 +78,7 @@ jobs: - ruby: "head" gemfile: gemfiles/rails_head.gemfile env: - BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }} + BUNDLE_GEMFILE: ${{ matrix.gemfile }} steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/gemfiles/rails_head.gemfile b/gemfiles/rails_head.gemfile index 95e43f4..a0c6acd 100644 --- a/gemfiles/rails_head.gemfile +++ b/gemfiles/rails_head.gemfile @@ -1,6 +1,6 @@ # frozen_string_literal: true -# $ BUNDLE_GEMFILE="$(pwd)/gemfiles/rails_git.gemfile" bundle exec m test/integration/tasks_test.rb:50 +# $ BUNDLE_GEMFILE="gemfiles/rails_git.gemfile" bundle exec m test/integration/tasks_test.rb:50 source "https://rubygems.org" diff --git a/test/integration/tasks_test.rb b/test/integration/tasks_test.rb index bb980a6..2a5ecee 100644 --- a/test/integration/tasks_test.rb +++ b/test/integration/tasks_test.rb @@ -26,7 +26,11 @@ def rake(cmd, options = {}) env_string = env.map {|key, value| "#{key.shellescape}=#{value.to_s.shellescape}" }.join(" ") cmd = "env #{env_string} bundle exec rake -f perf.rake #{cmd} --trace" puts "Running: #{cmd}" - result = Bundler.with_original_env { `cd '#{rails_app_path}' && #{cmd} 2>&1` } + result = Bundler.with_original_env do + # Ensure relative BUNDLE_GEMFILE is expanded so path is still correct after cd + ENV['BUNDLE_GEMFILE'] = File.expand_path(ENV['BUNDLE_GEMFILE']) if ENV['BUNDLE_GEMFILE'] + `cd '#{rails_app_path}' && #{cmd} 2>&1` + end if assert_success && !$?.success? puts result raise "Expected '#{cmd}' to return a success status.\nOutput: #{result}" @@ -44,7 +48,7 @@ def rake(cmd, options = {}) end test 'rails perf:library from git' do - # BUNDLE_GEMFILE="$(pwd)/gemfiles/rails_git.gemfile" bundle exec m test/integration/tasks_test.rb: + # BUNDLE_GEMFILE="gemfiles/rails_git.gemfile" bundle exec m test/integration/tasks_test.rb: skip # unless ENV['USING_RAILS_GIT'] @@ -54,7 +58,7 @@ def rake(cmd, options = {}) end test "rails perf:library with bad script" do - # BUNDLE_GEMFILE="$(pwd)/gemfiles/rails_git.gemfile" bundle exec m test/integration/tasks_test.rb: + # BUNDLE_GEMFILE="gemfiles/rails_git.gemfile" bundle exec m test/integration/tasks_test.rb: skip # unless ENV['USING_RAILS_GIT']