Repository navigation
fix: set up Bundler under coverage only when the target has a bundle - #455
Open
TrapsterDK wants to merge 1 commit into
Open
TrapsterDK wants to merge 1 commit into
TrapsterDK wants to merge 1 commit into
Conversation
The coverage helper required bundler/setup unconditionally and rescued only LoadError. A target without a bundle has no BUNDLE_GEMFILE, so Bundler searched for a Gemfile and raised GemfileNotFound or GemNotFound, which failed the test. Set up Bundler only when BUNDLE_GEMFILE is set, and warn if that fails.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sets up Bundler in the coverage helper only when the target has a bundle, so
bazel coverageno longer fails for targets without one.Without a bundle there is no
BUNDLE_GEMFILE.require 'bundler/setup'then searches for a Gemfile and raisesBundler::GemfileNotFound(orBundler::GemNotFoundif it finds an unrelated one). The helper only rescuedLoadError, so the test failed. Now Bundler is set up only whenBUNDLE_GEMFILEis set, and a failure there prints a warning. The existingrescue LoadErrorstill covers missing SimpleCov gems.Fixes #453
Tested: adds a bundle-less
rb_test(//spec:plain) toexamples/gemand a CI step that runsbazel coverage //spec:plain. I could not run Bazel or Ruby locally, so this is only exercised by CI.Assisted by Claude.