Skip to content

Commit 40112f7

Browse files
hsbtclaudeCopilot
authored
Skip bundler self-checksum on ruby-core in test fixtures (#9506)
* Skip bundler self-checksum on ruby-core in test fixtures In ruby-core test setup, bundler is loaded as a default gem and the bundler.gem cache file is not present on disk where LockfileGenerator#bundler_checksum looks for it. As a result, the generator omits the bundler checksum from the regenerated lockfile, while the test's checksums_section helper still adds it, making the "does not change the lock" expectations in setup_spec.rb fail on ruby-core CI for release branches (where Bundler::VERSION does not end in .dev). Mirror the generator's give-up conditions in the helper so that test fixtures and the regenerated lockfile stay in sync. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent ee558f2 commit 40112f7

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

spec/support/checksums.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ def checksums_section(enabled = true, bundler_checksum: true, &block)
5858
ChecksumsBuilder.new(enabled, &block).tap do |builder|
5959
next if builder.bundler_registered || !bundler_checksum
6060

61-
next if Bundler::VERSION.to_s.end_with?(".dev")
61+
# Mirror the conditions under which LockfileGenerator#bundler_checksum
62+
# gives up and omits the bundler checksum from the lockfile:
63+
# - .dev: development builds have no released bundler.gem to checksum.
64+
# - ruby_core?: bundler is loaded as a default gem, so bundler.gem
65+
# is not present on disk under the test gem cache.
66+
next if Bundler::VERSION.to_s.end_with?(".dev") || Spec::Path.ruby_core?
6267
builder.checksum(system_gem_path, "bundler", Bundler::VERSION, Gem::Platform::RUBY, "cache")
6368
end
6469
end

0 commit comments

Comments
 (0)