Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1cb3e00

Browse files
Remove "double CI" for testing Bundler 4 mode
Since now every functionality that changes in Bundler 4 is under a setting, we can enable that setting to test the new functionality, without having to run our full CI twice. This can actually be seen as increasing coverage, because Bundler 4 functionality will now be tested on Windows, MacOS, or any other environment where previously "Bundler 4 mode" was not running.
1 parent 0b5a8bf commit 1cb3e00

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+155
-203
lines changed

.github/workflows/bundler.yml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ defaults:
2020

2121
jobs:
2222
bundler:
23-
name: Bundler ${{ matrix.bundler }} on ${{ matrix.os.name }} (${{ matrix.ruby.name }})
23+
name: Bundler on ${{ matrix.os.name }} (${{ matrix.ruby.name }})
2424
runs-on: ${{ matrix.os.value }}
2525
strategy:
2626
fail-fast: false
@@ -33,21 +33,17 @@ jobs:
3333
- { name: ruby-3.3, value: 3.3.8 }
3434
- { name: ruby-3.4, value: 3.4.4 }
3535

36-
bundler:
37-
- 2
38-
- 4
39-
4036
include:
41-
- { os: { name: macOS, value: macos-15 }, bundler: 2, ruby: { name: ruby-3.2, value: 3.2.8 }, timeout: 90 }
42-
- { os: { name: macOS, value: macos-15 }, bundler: 2, ruby: { name: ruby-3.3, value: 3.3.8 }, timeout: 90 }
43-
- { os: { name: macOS, value: macos-15 }, bundler: 2, ruby: { name: ruby-3.4, value: 3.4.4 }, timeout: 90 }
37+
- { os: { name: macOS, value: macos-15 }, ruby: { name: ruby-3.2, value: 3.2.8 }, timeout: 90 }
38+
- { os: { name: macOS, value: macos-15 }, ruby: { name: ruby-3.3, value: 3.3.8 }, timeout: 90 }
39+
- { os: { name: macOS, value: macos-15 }, ruby: { name: ruby-3.4, value: 3.4.4 }, timeout: 90 }
4440

45-
- { os: { name: Windows, value: windows-2025 }, bundler: 2, ruby: { name: ruby-3.2, value: 3.2.8 }, timeout: 150 }
46-
- { os: { name: Windows, value: windows-2025 }, bundler: 2, ruby: { name: ruby-3.3, value: 3.3.8 }, timeout: 150 }
47-
- { os: { name: Windows, value: windows-2025 }, bundler: 2, ruby: { name: ruby-3.4, value: 3.4.4 }, timeout: 150 }
41+
- { os: { name: Windows, value: windows-2025 }, ruby: { name: ruby-3.2, value: 3.2.8 }, timeout: 150 }
42+
- { os: { name: Windows, value: windows-2025 }, ruby: { name: ruby-3.3, value: 3.3.8 }, timeout: 150 }
43+
- { os: { name: Windows, value: windows-2025 }, ruby: { name: ruby-3.4, value: 3.4.4 }, timeout: 150 }
4844

49-
- { os: { name: Ubuntu, value: ubuntu-24.04 }, bundler: 2, ruby: { name: jruby, value: jruby-10.0.0.1 } }
50-
- { os: { name: Windows, value: windows-2025 }, bundler: 2, ruby: { name: jruby, value: jruby-10.0.0.1 } }
45+
- { os: { name: Ubuntu, value: ubuntu-24.04 }, ruby: { name: jruby, value: jruby-10.0.0.1 } }
46+
- { os: { name: Windows, value: windows-2025 }, ruby: { name: jruby, value: jruby-10.0.0.1 } }
5147

5248
env:
5349
RGV: ..
@@ -69,10 +65,7 @@ jobs:
6965
if: matrix.ruby.name == 'jruby'
7066
- name: Install graphviz (Ubuntu)
7167
run: sudo apt-get install graphviz -y
72-
if: matrix.bundler == 2 && matrix.os.name == 'Ubuntu'
73-
- name: Set version
74-
run: echo "BUNDLE_SIMULATE_VERSION=4" >> $GITHUB_ENV
75-
if: matrix.bundler == 4
68+
if: matrix.os.name == 'Ubuntu'
7669
- name: Prepare dependencies
7770
run: |
7871
bin/rake dev:deps

.github/workflows/realworld-bundler.yml

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ permissions: # added using https://github.com/step-security/secure-workflows
1616

1717
jobs:
1818
bundler:
19-
name: Realworld Bundler ${{ matrix.bundler }} on ${{ matrix.os.name }} (${{ matrix.ruby.name }})
19+
name: Realworld Bundler on ${{ matrix.os.name }} (${{ matrix.ruby.name }})
2020
runs-on: ${{ matrix.os.value }}
2121
strategy:
2222
fail-fast: false
@@ -29,14 +29,10 @@ jobs:
2929
- { name: ruby-3.3, value: 3.3.8 }
3030
- { name: ruby-3.4, value: 3.4.4 }
3131

32-
bundler:
33-
- 2
34-
- 4
35-
3632
include:
37-
- { os: { name: macOS, value: macos-15 }, bundler: 2, ruby: { name: ruby-3.2, value: 3.2.8 } }
38-
- { os: { name: macOS, value: macos-15 }, bundler: 2, ruby: { name: ruby-3.3, value: 3.3.8 } }
39-
- { os: { name: macOS, value: macos-15 }, bundler: 2, ruby: { name: ruby-3.4, value: 3.4.4 } }
33+
- { os: { name: macOS, value: macos-15 }, ruby: { name: ruby-3.2, value: 3.2.8 } }
34+
- { os: { name: macOS, value: macos-15 }, ruby: { name: ruby-3.3, value: 3.3.8 } }
35+
- { os: { name: macOS, value: macos-15 }, ruby: { name: ruby-3.4, value: 3.4.4 } }
4036
env:
4137
RGV: ..
4238
RUBYOPT: --disable-gems
@@ -49,17 +45,14 @@ jobs:
4945
with:
5046
ruby-version: ${{ matrix.ruby.value }}
5147
bundler: none
52-
- name: Set version
53-
run: echo "BUNDLE_SIMULATE_VERSION=4" >> $GITHUB_ENV
54-
if: matrix.bundler == 4
5548
- name: Prepare dependencies
5649
run: bin/rake dev:deps
5750
- name: Run Test
5851
run: bin/rake spec:realworld
5952
- name: Upload used cassettes as artifact
6053
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
6154
with:
62-
name: cassettes-bundler-${{ matrix.bundler }}-${{ matrix.os.value }}-${{ matrix.ruby.name }}
55+
name: cassettes-bundler-${{ matrix.os.value }}-${{ matrix.ruby.name }}
6356
path: ./bundler/spec/support/artifice/used_cassettes.txt
6457
timeout-minutes: 20
6558

@@ -84,18 +77,15 @@ jobs:
8477
timeout-minutes: 20
8578

8679
system_rubygems_bundler:
87-
name: Realworld Bundler ${{ matrix.bundler }} against system Rubygems (${{ matrix.ruby.name }})
80+
name: Realworld Bundler against system Rubygems (${{ matrix.ruby.name }})
8881
runs-on: ubuntu-24.04
8982
strategy:
9083
fail-fast: false
9184
matrix:
9285
include:
93-
- { bundler: 2, ruby: { name: ruby-3.2, value: 3.2.8 } }
94-
- { bundler: 2, ruby: { name: ruby-3.3, value: 3.3.8 } }
95-
- { bundler: 2, ruby: { name: ruby-3.4, value: 3.4.4 } }
96-
- { bundler: 4, ruby: { name: ruby-3.2, value: 3.2.8 } }
97-
- { bundler: 4, ruby: { name: ruby-3.3, value: 3.3.8 } }
98-
- { bundler: 4, ruby: { name: ruby-3.4, value: 3.4.4 } }
86+
- { ruby: { name: ruby-3.2, value: 3.2.8 } }
87+
- { ruby: { name: ruby-3.3, value: 3.3.8 } }
88+
- { ruby: { name: ruby-3.4, value: 3.4.4 } }
9989
steps:
10090
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
10191
with:
@@ -105,17 +95,14 @@ jobs:
10595
with:
10696
ruby-version: ${{ matrix.ruby.value }}
10797
bundler: none
108-
- name: Set version
109-
run: echo "BUNDLE_SIMULATE_VERSION=4" >> $GITHUB_ENV
110-
if: matrix.bundler == 4
11198
- name: Prepare dependencies
11299
run: bin/rake dev:deps
113100
- name: Run Test
114101
run: bin/rake spec:realworld
115102
- name: Upload used cassettes as artifact
116103
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
117104
with:
118-
name: cassettes-system-rubygems-bundler-${{ matrix.bundler }}-${{ matrix.ruby.name }}
105+
name: cassettes-system-rubygems-bundler-${{ matrix.ruby.name }}
119106
path: ./bundler/spec/support/artifice/used_cassettes.txt
120107
timeout-minutes: 20
121108

.github/workflows/system-rubygems-bundler.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,15 @@ defaults:
2323

2424
jobs:
2525
system_rubygems_bundler:
26-
name: Bundler ${{ matrix.bundler }} against system Rubygems (${{ matrix.ruby.name }})
26+
name: Bundler against system Rubygems (${{ matrix.ruby.name }})
2727
runs-on: ubuntu-24.04
2828
strategy:
2929
fail-fast: false
3030
matrix:
3131
include:
32-
- { bundler: 2, ruby: { name: ruby-3.2, value: 3.2.0 } }
33-
- { bundler: 2, ruby: { name: ruby-3.3, value: 3.3.0 } }
34-
- { bundler: 2, ruby: { name: ruby-3.4, value: 3.4.1 } }
35-
- { bundler: 4, ruby: { name: ruby-3.2, value: 3.2.0 } }
36-
- { bundler: 4, ruby: { name: ruby-3.3, value: 3.3.0 } }
37-
- { bundler: 4, ruby: { name: ruby-3.4, value: 3.4.1 } }
32+
- { ruby: { name: ruby-3.2, value: 3.2.0 } }
33+
- { ruby: { name: ruby-3.3, value: 3.3.0 } }
34+
- { ruby: { name: ruby-3.4, value: 3.4.1 } }
3835
steps:
3936
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4037
with:
@@ -46,10 +43,6 @@ jobs:
4643
bundler: none
4744
- name: Install graphviz
4845
run: sudo apt-get install graphviz -y
49-
if: matrix.bundler == 2
50-
- name: Set version
51-
run: echo "BUNDLE_SIMULATE_VERSION=4" >> $GITHUB_ENV
52-
if: matrix.bundler == 4
5346
- name: Prepare dependencies
5447
run: |
5548
bin/rake dev:deps

bundler/lib/bundler/feature_flag.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ def deprecated_major?(target_major_version)
5050
@major_version >= target_major_version
5151
end
5252

53-
attr_reader :bundler_version
54-
5553
def initialize(bundler_version)
5654
@bundler_version = Gem::Version.create(bundler_version)
5755
@major_version = @bundler_version.segments.first

bundler/spec/bundler/cli_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def out_with_macos_man_workaround
250250
end
251251

252252
RSpec.describe "bundler executable" do
253-
it "shows the bundler version just as the `bundle` executable does", bundler: "2" do
253+
it "shows the bundler version just as the `bundle` executable does" do
254254
bundler "--version"
255255
expect(out).to eq("Bundler version #{Bundler::VERSION}")
256256
end

bundler/spec/bundler/current_ruby_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@
139139
end
140140

141141
describe "Deprecated platform" do
142-
it "Outputs a deprecation warning when calling maglev?", bundler: "2" do
142+
it "Outputs a deprecation warning when calling maglev?" do
143143
expect(Bundler.ui).to receive(:warn).with(/`CurrentRuby#maglev\?` is deprecated with no replacement./)
144144

145145
Bundler.current_ruby.maglev?
146146
end
147147

148-
it "Outputs a deprecation warning when calling maglev_31?", bundler: "2" do
148+
it "Outputs a deprecation warning when calling maglev_31?" do
149149
expect(Bundler.ui).to receive(:warn).with(/`CurrentRuby#maglev_31\?` is deprecated with no replacement./)
150150

151151
Bundler.current_ruby.maglev_31?

bundler/spec/bundler/dsl_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
)
104104
end
105105

106-
context "default hosts", bundler: "2" do
106+
context "default hosts" do
107107
it "converts :github to URI using https" do
108108
subject.gem("sparks", github: "indirect/sparks")
109109
github_uri = "https://github.com/indirect/sparks.git"

bundler/spec/bundler/settings_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@
333333
C
334334

335335
expect(Bundler.ui).not_to receive(:warn)
336-
expect(settings.all).to eq(simulated_version ? ["simulate_version"] : [])
336+
expect(settings.all).to be_empty
337337
end
338338

339339
it "converts older keys with dashes" do

bundler/spec/cache/path_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
expect(bundled_app("vendor/cache/foo-1.0")).not_to exist
9898
end
9999

100-
it "does not cache path gems by default", bundler: "2" do
100+
it "does not cache path gems by default" do
101101
build_lib "foo"
102102

103103
install_gemfile <<-G

bundler/spec/commands/binstubs_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
expect(bundled_app("exec/myrackup")).to exist
169169
end
170170

171-
it "setting is saved for bundle install", bundler: "2" do
171+
it "setting is saved for bundle install" do
172172
install_gemfile <<-G
173173
source "https://gem.repo1"
174174
gem "myrack"

bundler/spec/commands/cache_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
end
159159
end
160160

161-
context "with --path", bundler: "2" do
161+
context "with --path" do
162162
it "sets root directory for gems" do
163163
gemfile <<-D
164164
source "https://gem.repo1"
@@ -221,7 +221,7 @@
221221
expect(bundled_app("vendor/cache/myrack-1.0.0.gem")).to exist
222222
end
223223

224-
it "puts the gems in vendor/cache even for legacy windows rubies, but prints a warning", bundler: "2" do
224+
it "puts the gems in vendor/cache even for legacy windows rubies, but prints a warning" do
225225
gemfile <<-D
226226
source "https://gem.repo1"
227227
gem 'myrack', :platforms => [:ruby_20, :x64_mingw_20]

bundler/spec/commands/check_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
expect(err).to include("Bundler can't satisfy your Gemfile's dependencies.")
124124
end
125125

126-
it "remembers --without option from install", bundler: "2" do
126+
it "remembers --without option from install" do
127127
gemfile <<-G
128128
source "https://gem.repo1"
129129
group :foo do
@@ -272,7 +272,7 @@
272272
expect(last_command).to be_failure
273273
end
274274

275-
context "--path", bundler: "2" do
275+
context "--path" do
276276
context "after installing gems in the proper directory" do
277277
before do
278278
gemfile <<-G

bundler/spec/commands/clean_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ def should_not_have_gems(*gems)
383383
expect(out).to include("myrack (1.0.0)").and include("thin (1.0)")
384384
end
385385

386-
it "--clean should override the bundle setting on install", bundler: "2" do
386+
it "--clean should override the bundle setting on install" do
387387
gemfile <<-G
388388
source "https://gem.repo1"
389389
@@ -405,7 +405,7 @@ def should_not_have_gems(*gems)
405405
should_not_have_gems "thin-1.0"
406406
end
407407

408-
it "--clean should override the bundle setting on update", bundler: "2" do
408+
it "--clean should override the bundle setting on update" do
409409
build_repo2
410410

411411
gemfile <<-G

bundler/spec/commands/config_spec.rb

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@
453453
it "does not make bundler crash and ignores the configuration" do
454454
bundle "config list --parseable"
455455

456-
expect(out).to eq(simulated_version ? "simulate_version=#{simulated_version}" : "")
456+
expect(out).to be_empty
457457
expect(err).to be_empty
458458

459459
ruby(<<~RUBY)
@@ -476,38 +476,26 @@
476476
describe "subcommands" do
477477
it "list" do
478478
bundle "config list", env: { "BUNDLE_FOO" => "bar" }
479-
expected = "Settings are listed in order of priority. The top value will be used.\nfoo\nSet via BUNDLE_FOO: \"bar\""
480-
expected += "\n\nsimulate_version\nSet via BUNDLE_SIMULATE_VERSION: \"#{simulated_version}\"" if simulated_version
481-
expect(out).to eq(expected)
479+
expect(out).to eq "Settings are listed in order of priority. The top value will be used.\nfoo\nSet via BUNDLE_FOO: \"bar\""
482480

483481
bundle "config list", env: { "BUNDLE_FOO" => "bar" }, parseable: true
484-
expected = "foo=bar"
485-
expected += "\nsimulate_version=#{simulated_version}" if simulated_version
486-
expect(out).to eq(expected)
482+
expect(out).to eq "foo=bar"
487483
end
488484

489485
it "list with credentials" do
490486
bundle "config list", env: { "BUNDLE_GEMS__MYSERVER__COM" => "user:password" }
491-
expected = "Settings are listed in order of priority. The top value will be used.\ngems.myserver.com\nSet via BUNDLE_GEMS__MYSERVER__COM: \"user:[REDACTED]\""
492-
expected += "\n\nsimulate_version\nSet via BUNDLE_SIMULATE_VERSION: \"#{simulated_version}\"" if simulated_version
493-
expect(out).to eq(expected)
487+
expect(out).to eq "Settings are listed in order of priority. The top value will be used.\ngems.myserver.com\nSet via BUNDLE_GEMS__MYSERVER__COM: \"user:[REDACTED]\""
494488

495489
bundle "config list", parseable: true, env: { "BUNDLE_GEMS__MYSERVER__COM" => "user:password" }
496-
expected = "gems.myserver.com=user:password"
497-
expected += "\nsimulate_version=#{simulated_version}" if simulated_version
498-
expect(out).to eq(expected)
490+
expect(out).to eq "gems.myserver.com=user:password"
499491
end
500492

501493
it "list with API token credentials" do
502494
bundle "config list", env: { "BUNDLE_GEMS__MYSERVER__COM" => "api_token:x-oauth-basic" }
503-
expected = "Settings are listed in order of priority. The top value will be used.\ngems.myserver.com\nSet via BUNDLE_GEMS__MYSERVER__COM: \"[REDACTED]:x-oauth-basic\""
504-
expected += "\n\nsimulate_version\nSet via BUNDLE_SIMULATE_VERSION: \"#{simulated_version}\"" if simulated_version
505-
expect(out).to eq(expected)
495+
expect(out).to eq "Settings are listed in order of priority. The top value will be used.\ngems.myserver.com\nSet via BUNDLE_GEMS__MYSERVER__COM: \"[REDACTED]:x-oauth-basic\""
506496

507497
bundle "config list", parseable: true, env: { "BUNDLE_GEMS__MYSERVER__COM" => "api_token:x-oauth-basic" }
508-
expected = "gems.myserver.com=api_token:x-oauth-basic"
509-
expected += "\nsimulate_version=#{simulated_version}" if simulated_version
510-
expect(out).to eq(expected)
498+
expect(out).to eq "gems.myserver.com=api_token:x-oauth-basic"
511499
end
512500

513501
it "get" do

bundler/spec/commands/inject_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
RSpec.describe "bundle inject", bundler: "2" do
3+
RSpec.describe "bundle inject" do
44
before :each do
55
gemfile <<-G
66
source "https://gem.repo1"

bundler/spec/commands/install_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
expect(bundled_app_lock).to exist
3030
end
3131

32-
it "does not create ./.bundle by default", bundler: "2" do
32+
it "does not create ./.bundle by default" do
3333
gemfile <<-G
3434
source "https://gem.repo1"
3535
gem "myrack"
@@ -334,22 +334,22 @@
334334
expect(the_bundle).to include_gems "myrack 1.0"
335335
end
336336

337-
it "allows running bundle install --system without deleting foo", bundler: "2" do
337+
it "allows running bundle install --system without deleting foo" do
338338
bundle "install --path vendor"
339339
bundle "install --system"
340340
FileUtils.rm_r(bundled_app("vendor"))
341341
expect(the_bundle).to include_gems "myrack 1.0"
342342
end
343343

344-
it "allows running bundle install --system after deleting foo", bundler: "2" do
344+
it "allows running bundle install --system after deleting foo" do
345345
bundle "install --path vendor"
346346
FileUtils.rm_r(bundled_app("vendor"))
347347
bundle "install --system"
348348
expect(the_bundle).to include_gems "myrack 1.0"
349349
end
350350
end
351351

352-
it "finds gems in multiple sources", bundler: "2" do
352+
it "finds gems in multiple sources" do
353353
build_repo2 do
354354
build_gem "myrack", "1.2" do |s|
355355
s.executables = "myrackup"

0 commit comments

Comments
 (0)