Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI fails with with different bundler execution #961

Merged
merged 2 commits into from
Mar 12, 2020
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Master (unreleased)

* Fix issue where the wrong version of bundler is used on CI apps (https://github.com/heroku/heroku-buildpack-ruby/pull/961)
* Remove libpq external dependency (https://github.com/heroku/heroku-buildpack-ruby/pull/959)

## v210 (3/6/2020)
Expand Down
11 changes: 6 additions & 5 deletions bin/support/ruby_test
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,20 @@ def execute_command(command)
end

# $ bin/test BUILD_DIR ENV_DIR ARTIFACT_DIR
build_dir, env_dir, artifact_dir = ARGV
build_dir, env_dir, _ = ARGV
LanguagePack::ShellHelpers.initialize_env(env_dir)

bundler = LanguagePack::Helpers::BundlerWrapper.new(
gemfile_path: "#{build_dir}/Gemfile"
)

# The `ruby_test-compile` program installs a version of Ruby for the
# user's application. It needs the propper `PATH`, where ever Ruby is installed
# we always add a symlink to the `bin/ruby` file so that is always valid.
# We calculate the gem path the same way we do when compiling.
LanguagePack::ShellHelpers.user_env_hash["PATH"] = "#{build_dir}/bin:#{ENV["PATH"]}"
LanguagePack::ShellHelpers.user_env_hash["PATH"] = "#{build_dir}/bin:#{bundler.bundler_path}/bin:#{ENV["PATH"]}"
LanguagePack::ShellHelpers.user_env_hash["GEM_PATH"] = LanguagePack::Ruby.slug_vendor_base

bundler = LanguagePack::Helpers::BundlerWrapper.new(
gemfile_path: "#{build_dir}/Gemfile"
)
# load bundler
bundler.install

Expand Down
3 changes: 2 additions & 1 deletion hatchet.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"sharpstone/rails_31_ruby_schema_format",
"sharpstone/rails_31_sql_schema_format",
"sharpstone/ruby_no_rails_test",
"sharpstone/activerecord_rake_tasks_does_not_exist"
"sharpstone/activerecord_rake_tasks_does_not_exist",
"sharpstone/ci_fails_ruby_default_bundler"
]
}
2 changes: 2 additions & 0 deletions hatchet.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
- 116db685f54dae18f703b3beb90e64fdbddb048d
- - "./repos/ci/activerecord_rake_tasks_does_not_exist"
- a6b711be6921cf7a0aa4e31269c37965799ea110
- - "./repos/ci/ci_fails_ruby_default_bundler"
- 43cbf196245957be6242b1e1bc56b8f1bfa00004
- - "./repos/ci/heroku-ci-json-example"
- 4e5410a7381f486ba3df7739e02e52f32fdd4dda
- - "./repos/ci/rails5_ruby_schema_format"
Expand Down
6 changes: 6 additions & 0 deletions spec/hatchet/ci_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,10 @@
expect(test_run.output).to_not match("db:migrate")
end
end

it "works when using a Ruby version different from default with an older version of bundler and not declaring a test script" do
Hatchet::Runner.new("ci_fails_ruby_default_bundler").run_ci do |test_run|
expect(test_run.output).to match("rspec")
end
end
end