Skip to content

Commit be334bd

Browse files
hsbtclaude
andcommitted
Pin cross-platform cooldown exclusion in an e2e spec
Exclusion is keyed on [name, version] and deliberately ignores platform, so pushing a fresh platform-specific build under an already-ripe version number cannot slip new code past the cooldown. No spec covered that behavior. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 2c4f4f3 commit be334bd

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

spec/install/cooldown_spec.rb

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,19 @@
115115
build_gem "fresh_gem", "0.3.2" do |s|
116116
s.date = now - (1 * 86_400)
117117
end
118+
119+
# the generic build is outside the window, but a platform-specific
120+
# build of the same version was pushed inside it
121+
build_gem "late_platform", "1.0.0" do |s|
122+
s.date = now - (30 * 86_400)
123+
end
124+
build_gem "late_platform", "2.0.0" do |s|
125+
s.date = now - (30 * 86_400)
126+
end
127+
build_gem "late_platform", "2.0.0" do |s|
128+
s.platform = "x86_64-linux"
129+
s.date = now - (1 * 86_400)
130+
end
118131
end
119132
end
120133

@@ -712,6 +725,31 @@
712725
expect(lockfile).not_to include("ripe_gem (2.0.0)")
713726
end
714727

728+
it "excludes a version on every platform when a platform-specific build of it is inside the window" do
729+
# Exclusion is keyed on [name, version] and deliberately ignores
730+
# platform: otherwise pushing a fresh platform-specific build under an
731+
# already-ripe version number would slip new code past the cooldown.
732+
gemfile <<-G
733+
source "https://gem.repo3"
734+
gem "late_platform"
735+
G
736+
737+
bundle "install --cooldown 7", artifice: "compact_index_cooldown"
738+
739+
expect(the_bundle).to include_gems("late_platform 1.0.0")
740+
end
741+
742+
it "selects the version with a late platform-specific build when --cooldown 0 bypasses the filter" do
743+
gemfile <<-G
744+
source "https://gem.repo3"
745+
gem "late_platform"
746+
G
747+
748+
bundle "install --cooldown 0", artifice: "compact_index_cooldown"
749+
750+
expect(the_bundle).to include_gems("late_platform 2.0.0")
751+
end
752+
715753
it "applies CLI --cooldown on bundle lock --update" do
716754
gemfile <<-G
717755
source "https://gem.repo3"

0 commit comments

Comments
 (0)