Commit graph

68 commits

Author SHA1 Message Date
David Rodríguez
e67f595e8f [rubygems/rubygems] Build bundler gem just once for specs
When we need to reset system gems during specs, there's no need to
rebuild bundler, we can copy over the original gem home.

7b4f80747b
2025-07-25 11:10:37 +09:00
David Rodríguez
51e890030f
[rubygems/rubygems] Reset tmp directories before spec suite
If you abort running test suite with a quick double Ctrl-C, tmp files
will be left around, and they will interfere with the next test run.

To avoid this, make sure to clear them once at the beginning of the test
suite.

### Before

```
$ bin/parallel_rspec
16 processes for 175 specs, ~ 11 specs per process
.............................................................................................^C^C

Finished in 19.45 seconds (files took 0.42722 seconds to load)
94 examples, 0 failures

(... turbo tests backtrace ...)

$ bin/parallel_rspec
16 processes for 175 specs, ~ 11 specs per process
.F....F....F...F......^C

Failures:

(... failures' details ...)
```

### After

```
$ bin/parallel_rspec
16 processes for 175 specs, ~ 11 specs per process
.................................................................................^C^C

Finished in 18.18 seconds (files took 0.4383 seconds to load)
82 examples, 0 failures

(... turbo tests backtrace ...)

$ bin/parallel_rspec
16 processes for 175 specs, ~ 11 specs per process
................................................................................^C^C

Finished in 8.79 seconds (files took 0.45187 seconds to load)
80 examples, 0 failures

(... turbo tests backtrace ...)
```

6767a52711
2025-07-14 11:52:13 +09:00
David Rodríguez
6217216be2
[rubygems/rubygems] Use ENV consistently over CLI flags for specs
dafe50f171
2025-06-24 12:10:50 +09:00
David Rodríguez
21bce66f59 [rubygems/rubygems] Reset variables that can cause specs to fail if set
8df67b7322
2025-06-05 19:12:36 +09:00
David Rodríguez
756479324f Sync Bundler and adapt to new spec setup 2025-04-10 19:21:51 +09:00
David Rodríguez
51958bae66 [rubygems/rubygems] Prefer FileUtils.rm_r to FileUtils.rm_rf for specs
Because it does not swallow errors if it fails to remove the given
folders, making issues easier to debug.

0db12d7afc
2025-03-12 18:02:09 +09:00
David Rodríguez
eb8f29c46c [rubygems/rubygems] Fix test failure when running tests with ENV["EDITOR"] set
Can be reproduced, for example, with

```
bin/rspec spec/bundler/cli_spec.rb spec/other/cli_man_pages_spec.rb --order defined
```

f57d199225
2025-01-10 16:01:49 +00:00
David Rodríguez
cfb7213882 [rubygems/rubygems] Normalize CLI flag documentation and make sure all flags are documented
20a834818b
2024-12-11 17:56:28 +00:00
Hiroshi SHIBATA
f20b6e5dbc [rubygems/rubygems] Explicitly load build_metadata.rb because Spec::BuildMetadata is only called from BundlerBuilder.
The current code is broken to call Spec::Builders#build_* method directly.

4922ae40dd
2024-11-21 04:39:31 +00:00
David Rodríguez
abb6f5c8bc [rubygems/rubygems] Fix bin/rake spec:all task
Only in CI, if two different test runs are started (like `bin/rake
spec:all` does), the second one would not install the dev version of
Bundler and would fail to start.

This commit makes it work the same locally and in CI.

7a5ca6c40f
2024-11-14 11:21:39 +09:00
David Rodriguez
5f8375381b [rubygems/rubygems] Avoid concurrent builds of Bundler when running specs
Instead, build it during setup when in CI.

This should avoid some Windows specific test failures when Bundler
copies the same files from multiple processes and runs into EACESS
errors.

c194a1d753
2024-06-28 07:33:43 +00:00
David Rodríguez
2755cb1b2f [rubygems/rubygems] Use modern hashes consistently
bb66253f2c
2023-12-07 22:29:33 +00:00
David Rodríguez
50482cd1e5 [rubygems/rubygems] Drop support for Ruby 2.6 and Ruby 2.7 in Bundler
93619c97ff
2023-11-13 11:06:10 +09:00
Samuel Giddins
c5fd94073f
[rubygems/rubygems] Refactor to checksums stored via source
This gets the specs passing, and handles the fact that we expect
checkums to be pinned only to a particular source

This also avoids reading in .gem files during lockfile generation,
instead allowing us to query the source for each resolved gem to grab
the checksum

Finally, this opens up a route to having user-stored checksum databases,
similar to how other package managers do this!

Add checksums to dev lockfiles

Handle full name conflicts from different original_platforms when adding checksums to store from compact index

Specs passing on Bundler 3

86c7084e1c
2023-10-23 13:59:01 +09:00
Thong Kuah
ad08674d8d
[rubygems/rubygems] Add CHECKSUMS for each gem in lockfile
We lock the checksum for each resolved spec under a new CHECKSUMS
section in the lockfile.

If the locked spec does not resolve for the local platform, we preserve
the locked checksum, similar to how we preserve specs.

Checksum locking only makes sense on install. The compact index
information is only available then.

bde37ca6bf
2023-10-23 13:59:01 +09:00
David Rodríguez
908f8fffa2
[rubygems/rubygems] Don't hide original error in after(:suite) hook
For some reason, Windows builds are failing quite consistently now.
However, it seems that errors are happening before this directory is
even created, so removal fails, hiding the original error.

Instead, don't let this removal fail due to files not existing.

7669d6c96e
2023-10-17 13:10:14 +09:00
Hiroshi SHIBATA
bbe56a6437 Merge RubyGems/Bundler master
from bfb0ae6977
2022-12-12 10:49:43 +09:00
David Rodríguez
b2668248b6 [rubygems/rubygems] Make sure RSpec diffs don't omit the different part
We sometimes check assertions on lockfile contents, which involves
comparing a reasonably long string. Sometimes RSpec is not able to show
the part of the string that's actually different, making it hard to
figure out the issue.

Configuring this setting should fix the issue in most cases.

5ad8ee499e
2022-10-04 06:22:50 +09:00
Hiroshi SHIBATA
3eca1e438d Merge 16c3535413 2022-09-05 14:37:12 +09:00
David Rodríguez
78425d7e74 [rubygems/rubygems] Unset ENV set by official Ruby docker images
So that it does not interfere with our specs.

1029714e21
2022-06-17 17:05:52 +09:00
David Rodríguez
d417c1ddc5 [rubygems/rubygems] Revert "Support running specs with asdf version manager"
This reverts commit 4b2d09af5b.

90ca7a7163
2022-06-15 21:10:55 +09:00
David Rodríguez
e09bdc11ec [rubygems/rubygems] Support running specs with asdf version manager
The `asdf-ruby` plugin sets `RUBYLIB` to require some code to reshim
after installing gems. This interferes with our specs.

Reset that, but leave any "internal" entries in places, because the
ruby-core test setup also uses RUBYLIB.

4b2d09af5b
2022-06-15 18:14:21 +09:00
Hiroshi SHIBATA
aeea88174d
Merge RubyGems and Bundler HEAD
125415593e
2022-05-20 17:32:19 +09:00
Hiroshi SHIBATA
ff3d7b720e Merge RubyGems and Bundler master 2022-02-28 11:39:20 +09:00
David Rodríguez
7bd25b9753 [rubygems/rubygems] Print warning when running potentially problematic rubygems + ruby combinations
d6df0b7de0

Co-authored-by: André Arko <andre@arko.net>
2021-12-21 06:48:27 +09:00
David Rodríguez
01f95ede0e [rubygems/rubygems] Rename BUNDLE_SPEC_RUN environment variable
The `BUNDLE_` prefix should be reserved to first class settings that
should be listed when running `bundle config`. This one is just a hacky
environment variable that has not corresponding documented setting.

7e255c5058
2021-12-21 06:48:27 +09:00
David Rodríguez
ea16a0df80 [rubygems/rubygems] Disable RUBYGEMS_GEMDEPS for bundler spec run
Running `bundler` specs using `bundler` is not supported.

cc97b6773d
2021-08-31 19:06:14 +09:00
Hiroshi SHIBATA
c082c6eb7c Sync RubyGems and Bundler with upstream 2021-07-07 15:31:52 +09:00
David Rodríguez
5b0abba931 Sync bundler & rubygems 2021-05-11 11:29:41 +09:00
Kazuhiro NISHIYAMA
50f17241a3
Try to fix other failures of writing XDG_CONFIG_HOME
756591173
759073690
761341026
```
Errno::EACCES: Permission denied @ dir_s_mkdir - /home/runner/.config/irb
```
2021-04-19 21:40:29 +09:00
Hiroshi SHIBATA
ed149dbf46 Merge the master branch of Bundler 2021-04-15 15:36:15 +09:00
David Rodríguez
53468cc111 Sync latest development version of bundler & rubygems 2021-03-08 13:47:35 +09:00
Hiroshi SHIBATA
69ed64949b Track Bundler master(2.3.0.dev) branch at 55634a8af18a52df86c4275d70fa1179118bcc20 2021-01-04 13:14:43 +09:00
Hiroshi SHIBATA
d386a58f6f Merge bundler-2.2.0.rc.2 2020-10-15 17:19:02 +09:00
David Rodríguez
5783d0dbfc Import remaining changes
The "sync with commits" scripts failed to properly import these for some
reason.
2020-07-15 16:05:12 +09:00
Hiroshi SHIBATA
c7ebeb7eda Sync Bundler PR #3624 2020-05-22 20:32:30 +09:00
Hiroshi SHIBATA
0e60b59d58 Update the bundler version with master branch 2020-05-13 07:54:37 +09:00
Hiroshi SHIBATA
38002a8adb Prepare to release bundler-2.1.0 2019-12-15 16:41:10 +09:00
Hiroshi SHIBATA
bb9ecd026a Merge Bundler 2.1.0.pre3 released version 2019-11-13 10:19:51 +09:00
Hiroshi SHIBATA
7585bc3187 Merge Bundler 2.1.0.pre.3
Features:
    - Add caller information to some deprecation messages to make them easier to fix [#7361](https://github.com/bundler/bundler/pull/7361)
    - Reconcile `bundle cache` vs `bundle package` everywhere. Now in docs, CLI help and everywhere else `bundle cache` is the preferred version and `bundle package` remains as an alias [#7389](https://github.com/bundler/bundler/pull/7389)
    - Display some basic `bundler` documentation together with ruby's RDoc based documentation [#7394](https://github.com/bundler/bundler/pull/7394)

  Bugfixes:
    - Fix typos deprecation message and upgrading docs [#7374](https://github.com/bundler/bundler/pull/7374)
    - Deprecation warnings about `taint` usage on ruby 2.7 [#7385](https://github.com/bundler/bundler/pull/7385)
    - Fix `--help` flag not correctly delegating to `man` when used with command aliases [#7388](https://github.com/bundler/bundler/pull/7388)
    - `bundle add` should cache newly added gems if an application cache exists [#7393](https://github.com/bundler/bundler/pull/7393)
    - Stop using an insecure folder as a "fallback home" when user home is not defined [#7416](https://github.com/bundler/bundler/pull/7416)
    - Fix `bundler/inline` warning about `Bundler.root` redefinition [#7417](https://github.com/bundler/bundler/pull/7417)
2019-11-11 18:56:25 +09:00
Hiroshi SHIBATA
d9b73dcc0d Remove github_action_linux tag from bundler examples.
Maybe it has fixed at 5a384e2c08
2019-08-23 19:05:45 +10:00
David Rodríguez
1120bacd8b
[bundler/bundler] Remove the :ruby exclusion tag
Our current set of specs is the same for all supported rubies, and we
should keep it that way.

c9dc0f6f2c
2019-08-21 07:58:46 +09:00
David Rodríguez
5a384e2c08 Fix some bundler specs (#2380)
* These seem to consistenly pass already

* Show actual command when running `make test-bundler`

Current the setup command that installs the necessary gems for testing
bundler was printed, but not the actual command that runs the tests.
That was a bit confusing.

* Borrow trick from setproctitle specs

* A title that long doesn't get set sometimes

No idea why, but the test doesn't need that the title is that long.

* Fix most gem helper spec ruby-core failures

* Fix the rest of the gem helper failures

* Fix version spec by improving the assertion

* Remove unnecessary `BUNDLE_RUBY` environment var

We can use `RUBY` when necessary, and `BUNDLE_RUBY` is not a good name
because bundler considers `BUNDLE_*` variables as settings.

* Rename `BUNDLE_GEM` to `GEM_COMMAND`

This is more descriptive I think, and also friendlier for bundler
because `BUNDLE_` env variables are interpreted by bundler as settings,
and this is not a bundler setting.

This fixes one bundler spec failure in config specs against ruby-core.

* Fix quality spec when run in core

Use the proper path helper.

* Fix dummy lib builder to never load default gems

If a dummy library is named as a default gem, when requiring the library
from its executable, the default gem would be loaded when running from
core, because in core all default gems share path with bundler, and thus
they are always in the $LOAD_PATH. We fix the issue by loading lib
relatively inside dummy lib executables.

* More exact assertions

Sometimes I have the problem that I do some "print debugging" inside
specs, and suddently the spec passes. This happens when the assertion is
too relaxed, and the things I print make it match, specially when they
are simple strings like "1.0" than can be easily be part of gem paths
that I print for debugging.

I fix this by making a more exact assertion.

* Detect the correct shebang when ENV["RUBY"] is set

* Relax assertion

So that the spec passes even if another paths containing "ext" are in
the load path. This works to fix a ruby-core issue, but it's a better
assertion in general. We just want to know that the extension path was
added.

* Use folder structure independent path helper

It should fix this spec for ruby-core.

* Fix the last failing spec on ruby-core

* Skip `bundle open <default_gem>` spec when no default gems
2019-08-20 09:46:31 +09:00
Hiroshi SHIBATA
8cf90a2f80 [bundler/bundler] Fixed rubocop error
9256177446
2019-08-16 14:30:23 +09:00
David Rodríguez
f48a61fb46 [bundler/bundler] Commit man pages to source control
This has the benefit that:

* Allows the installation of bundler as a default gem from rubygems to
include man pages.
* Removes the need to build man pages during our tests.
* Makes working with the manifest easier, because we only have source
controlled files, and not a mix of source control and generated files.

To make sure they never fall out of sync, we replace the previous
`man:build` CI task with a `man:check` task that makes sure the
generated man pages are up to date.

23de1d0177
2019-08-16 14:30:23 +09:00
Hiroshi SHIBATA
ed9d59afc8
Added example filter for Linux of GitHub Actions. 2019-08-12 12:14:39 +09:00
Hiroshi SHIBATA
8a8f680f01
Re-use GITHUB_ACTION variables for filtering bundler examples. 2019-08-12 12:14:39 +09:00
Hiroshi SHIBATA
bb2f24251f
GitHub Actions does not support ANSI color code. Skip failing examples. 2019-08-11 12:17:22 +09:00
Hiroshi SHIBATA
220f6aa01c
Explicitly ignored GEMRC environmental variable. 2019-08-03 09:30:00 +09:00
Hiroshi SHIBATA
d4b1804b11
[bundler/bundler] Removed the environmental variables that are BUNDLE_USER_*.
It's affect with rspec examples and broke them.

355a922073
2019-08-03 09:30:00 +09:00