summaryrefslogtreecommitdiff
path: root/test/rubygems
AgeCommit message (Collapse)Author
2025-10-25merge revision(s) 4368e6c42effc16904e35f753fc2002f0bba375a:nagachika
[PATCH] [ruby/rubygems] Removed credential assertion from stdout https://github.com/ruby/rubygems/commit/3946be008c
2025-04-02[rubygems/rubygems] Bump up minimum required version for cmake 4Hiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/3e77caeddf
2024-10-17Merge RubyGems-3.5.22 and Bundler-2.5.22Hiroshi SHIBATA
2024-10-17Merge RubyGems-3.5.21 and Bundler-2.5.21Hiroshi SHIBATA
2024-09-25Merge RubyGems-3.5.19 and Bundler-2.5.19Hiroshi SHIBATA
2024-09-25Merge RubyGems-3.5.18 and Bundler-2.5.18Hiroshi SHIBATA
2024-09-25Merge RubyGems-3.5.17 and Bundler-2.5.17Hiroshi SHIBATA
2024-07-30Update RubyGems 3.5.16 and Bundler 2.5.16 for Ruby 3.3 (#11252)Hiroshi SHIBATA
* Merge RubyGems-3.5.12 and Bundler-2.5.12 * Merge RubyGems-3.5.13 and Bundler-2.5.13 * Merge RubyGems-3.5.14 and Bundler-2.5.14 * Merge RubyGems-3.5.15 and Bundler-2.5.15 * Merge RubyGems-3.5.16 and Bundler-2.5.16
2024-06-04Merge RubyGems 3.5.11 and Bundler 2.5.11 for Ruby 3.3 (#10870)Hiroshi SHIBATA
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2024-05-28[rubygems/rubygems] Should rescue vendored net-http exceptionNobuyoshi Nakada
https://github.com/rubygems/rubygems/commit/7d2c4cf364
2024-04-16Merge RubyGems 3.5.9 and Bundler 2.5.9 (Fixed CI at Ruby 3.3) (#10348)Hiroshi SHIBATA
* Merge RubyGems-3.5.6 and Bundler-2.5.6 * Merge RubyGems-3.5.7 and Bundler-2.5.7 * Merge RubyGems-3.5.8 and Bundler-2.5.8 * Partly reverted about https://github.com/rubygems/rubygems/pull/7483 * Merge RubyGems-3.5.9 and Bundler-2.5.9
2024-02-05Merge RubyGems 3.5.5 and Bundler 2.5.5 (#9676)Hiroshi SHIBATA
* Merge RubyGems-3.5.4 and Bundler-2.5.4 * Merge RubyGems-3.5.5 and Bundler-2.5.5 * Make tests play with upstream Ruby tests CI broke in https://github.com/ruby/ruby/pull/9604 because if any Ruby tests run `require 'net/http'`, they will pollute the `$LOADED_FEATURES` for the RubyGems tests. We can fix this by renaming the test default gem from `net-http` to `my-http`. See https://github.com/rubygems/rubygems/pull/7379#issuecomment-1901241299 for more details. --------- Co-authored-by: Stan Hu <stanhu@gmail.com>
2023-12-23Merge RubyGems-3.5.3 and Bundler-2.5.3Hiroshi SHIBATA
2023-12-22Merge RubyGems-3.5.2 and Bundler-2.5.2Hiroshi SHIBATA
2023-12-14[rubygems/rubygems] Warn for duplicate meta data linksDrew Stevenson
Match order of METADATA_LINK_KEYS to order used by rubygems.org in Links model. Add missing download_uri key. https://github.com/rubygems/rubygems/commit/d2922cd6e9
2023-12-13[rubygems/rubygems] Use match? when regexp match data is unusedSamuel Giddins
Improved performance / reduced allocations https://github.com/rubygems/rubygems/commit/b04726c9a7
2023-12-13[rubygems/rubygems] Test if the user dir is used for auto user installationVít Ondruch
This is mainly to align this test case with the `test_process_options_does_not_fallback_to_user_install_when_gem_home_ not_writable_and_no_user_install`, where the `install_dir` is checked already. https://github.com/rubygems/rubygems/commit/02b1884b61
2023-12-13[rubygems/rubygems] Make sure `--no-user-install` is respected for auto user ↵Vít Ondruch
installation The `options[:user_install]` might have three states: * `true`: `--user-install` * `false`: `--no-user-install` and * `nil`: option was not specified However, this had not been respected previously and the `false` and `nil` were treated the same. This could lead to auto user installation despite `--no-user-install` being specified on the command line. Fixes https://github.com/rubygems/rubygems/pull/7237 https://github.com/rubygems/rubygems/commit/9281545474
2023-12-13[rubygems/rubygems] Vendor timeout in RubyGems tooDavid Rodríguez
https://github.com/rubygems/rubygems/commit/e2e7440ede
2023-12-13[rubygems/rubygems] Vendor net-http and net-protocol in RubyGemsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/99d91c9ed2
2023-12-12[rubygems/rubygems] Remove non-transparent requirement added to prerelease gemsDavid Rodríguez
I think we can safely assume these days that all RubyGems and Bundler versions that will ever bundle a new gem created in 2023 support prereleases. So this non transparent requirement is not necessary. In my opinion, it should be the gem author to explicitly add this constraint, not RubyGems. https://github.com/rubygems/rubygems/commit/b165e6d725
2023-12-08[rubygems/rubygems] Extract generate_index command to ↵Samuel Giddins
rubygems-generate_index gem So generate_index can be implemented with dependencies, such as the compact index Took this approach from feedback in https://github.com/rubygems/rubygems/pull/6853 Running `gem generate_index` by default will use an installed rubygems-generate_index, or install and then use the command from the gem Apply suggestions from code review https://github.com/rubygems/rubygems/commit/fc1cb9bc9e Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
2023-12-07[rubygems/rubygems] Use modern hashes consistentlyDavid Rodríguez
https://github.com/rubygems/rubygems/commit/bb66253f2c
2023-12-07[rubygems/rubygems] Make --build-root disable auto-user-install.Ellen Marie Dash
https://github.com/rubygems/rubygems/commit/6a06b0763f
2023-12-07[rubygems/rubygems] Better approach to falling back to user installation ↵David Rodríguez
when GEM_HOME not writable https://github.com/rubygems/rubygems/commit/f67bced16b
2023-12-07[rubygems/rubygems] Add some early assertions to make sure the test is ↵David Rodríguez
progressing fine If an error happens during the install command, it will fail in an strange way right now. https://github.com/rubygems/rubygems/commit/2b6e0c703a
2023-12-07[rubygems/rubygems] Use globals variables for standard input/outputVít Ondruch
Replace use of `STDIN`, `STDOUT` and `STDERR` constants by their `$stdin`, `$stdout` and `$stderr` global variable equivalents. This enables easier testing via standard means, such as `assert_output` for minitest or `expect { print 'foo' }.to output.to_stdout` for RSpec test suites. https://github.com/rubygems/rubygems/commit/a0a6fc1b76
2023-12-06[rubygems/rubygems] Gem::UpdateSuggestion uses Gem::CIDetectorEric Mueller
https://github.com/rubygems/rubygems/commit/e5b0458342
2023-12-06[rubygems/rubygems] Introduce the Gem::CIDetectorEric Mueller
This is based on the list in Gem::UpdateSuggestion and Bundler::Fetcher; these have similar purposes (determining whether/what CI we're executing in), and can benefit from being combined and updated (they're both slightly out of date). Noteable changes: * We'll consider ourselves to be on a CI in more cases - if CI_NAME or TASKCLUSTER_ROOT_URL are set specifically, since those represent two cases that were either overlooked or are no longer covered by the existing implementation. (Or possibly TaskCluster still does provide RUN_ID, but failed to document it) * We will notice/track a few additional services in ci_strings (cirrus, dsari, taskcluster), stop tracking 'snap' (they went under in 2017), and update buildbox to buildkite (they've been called that for 8 years, and the BUILDBOX envs have been deprecated for 3). * We'll also sort/uniq/downcase the values (all of which only matter because of the special case of CI_NAME). https://github.com/rubygems/rubygems/commit/60652b942f
2023-12-06[rubygems/rubygems] test_bundled_ca.rb: Add Net::OpenTimeout as a offline case.Jun Aruga
It seems that when DNS connection is enabled, but the TCP connection is disabled in a way, the `Net::HTTP.connect` raises `Net::OpenTimeout`. And I want to skip the tests in this case. https://github.com/ruby/net-http/blob/042faf74e77d786ff60dff81555f6ec4f21e77a9/lib/net/http.rb#L1601-L1608 ``` 1) Error: TestBundledCA#test_accessing_new_index: Net::OpenTimeout: execution expired /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:987:in `initialize' /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:987:in `open' /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:987:in `block in connect' /builddir/build/BUILD/ruby-3.0.4/lib/timeout.rb:107:in `timeout' /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:985:in `connect' /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:970:in `do_start' /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:959:in `start' /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:1512:in `request' /builddir/build/BUILD/ruby-3.0.4/lib/net/http.rb:1270:in `get' /builddir/build/BUILD/ruby-3.0.4/test/rubygems/test_bundled_ca.rb:34:in `assert_https' /builddir/build/BUILD/ruby-3.0.4/test/rubygems/test_bundled_ca.rb:58:in `test_accessing_new_index' ... ``` https://github.com/rubygems/rubygems/commit/5defe0a2f6
2023-12-05[rubygems/rubygems] Instead of checking writability, try to writeDavid Rodríguez
Checking writability is prone to errors. For example: $ mkdir -p foo/bar $ chmod -w foo $ touch foo/bar/baz # succeeds even if foo is not writable https://github.com/rubygems/rubygems/commit/6056138b6a
2023-12-05[rubygems/rubygems] Set specs as pending at the beginningDavid Rodríguez
And word them consistently with other specs. https://github.com/rubygems/rubygems/commit/eee7afefd3
2023-12-05[rubygems/rubygems] Simplify `--no-user-install` specDavid Rodríguez
This spec is ignoring the local `.gem` file, so most stuff is not needed. https://github.com/rubygems/rubygems/commit/d52526800f
2023-11-30[rubygems/rubygems] Only show "Defaulting to user installation" message when ↵Ellen Marie Dash
it matters. https://github.com/rubygems/rubygems/commit/61b0947225
2023-11-21[rubygems/rubygems] Bump rb-sysdependabot[bot]
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.82 to 0.9.83. - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.82...v0.9.83) --- updated-dependencies: - dependency-name: rb-sys dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> https://github.com/rubygems/rubygems/commit/9eb6220c6c
2023-11-21[rubygems/rubygems] Bump rb-sysdependabot[bot]
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.82 to 0.9.83. - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.82...v0.9.83) --- updated-dependencies: - dependency-name: rb-sys dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> https://github.com/rubygems/rubygems/commit/41670ad4e2
2023-11-15[rubygems/rubygems] Make temp gem home independent of pwdDavid Rodríguez
https://github.com/rubygems/rubygems/commit/5c36556d2e
2023-11-13[rubygems/rubygems] Explicitly define `@default_specifications_dir` for testsVít Ondruch
Resetting `@default_specifications_dir` to `nil` means that the `Gem.default_specifications_dir` needs to be invoked. However, given that this method might be overridden by operating_system.rb and similar, this might lead to various test failures. Providing the default value makes the issues go away. https://github.com/rubygems/rubygems/commit/59626cb650
2023-11-13[rubygems/rubygems] Provide more insightful test error outputVít Ondruch
Original output: ~~~ Failure: test_realworld_upgraded_default_gem(TestGemRequire): <false> is not true. /mnt/test/rubygems/test_require.rb:474:in `test_realworld_upgraded_default_gem' 471: File.write(path, code) 472: 473: output = Gem::Util.popen({ "GEM_HOME" => @gemhome }, *ruby_with_rubygems_in_load_path, path).strip => 474: assert $?.success? 475: refute_empty output 476: assert_equal "999.99.9", output.lines[0].chomp 477: # Make sure only files from the newer json gem are loaded, and no files from the default json gem ~~~ New output: ~~~ Failure: test_realworld_upgraded_default_gem(TestGemRequire) /mnt/test/rubygems/test_require.rb:475:in `test_realworld_upgraded_default_gem' 472: 473: output = Gem::Util.popen({ "GEM_HOME" => @gemhome }, *ruby_with_rubygems_in_load_path, path).strip 474: refute_empty output => 475: assert_equal "999.99.9", output.lines[0].chomp 476: # Make sure only files from the newer json gem are loaded, and no files from the default json gem 477: assert_equal ["#{@gemhome}/gems/json-999.99.9/lib/json.rb"], output.lines.grep(%r{/gems/json-}).map(&:chomp) 478: assert $?.success? <"999.99.9"> expected but was <"/mnt/tmp/test_rubygems_20231110-36663-of405r/test_realworld_upgraded_default_gem.rb:3:in `<main>': undefined method `version' for nil:NilClass (NoMethodError)"> diff: ? 999 .99.9 ? /mnt/tmp/test_rubygems_20231110-36663-of405r/test_realworld_upgraded_default_gem rb:3:in `<main>': undefined method `version' for nil:NilClass (NoMethodError) ? ??? ???? ~~~ It is more valuable to check the command output then the error code. If the command fails for some reason, the output probably contains some detail, while checking the return code tells not much. https://github.com/rubygems/rubygems/commit/b76062e852
2023-11-13[rubygems/rubygems] Drop support for Ruby 2.6 and Ruby 2.7 in RubyGemsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/10c26a483d
2023-11-13[rubygems/rubygems] Report possible error prior checking output of gem uninstallVít Ondruch
Originally, the failed test case reported following error: ~~~ Failure: test_gem_exec_gem_uninstall(TestGemCommandsExecCommand): <""> was expected to include <"Successfully uninstalled a-2\n">. /mnt/test/rubygems/test_gem_commands_exec_command.rb:742:in `block in test_gem_exec_gem_uninstall' 739: 740: # assert_empty @ui.error 741: refute_includes @ui.output, "running gem exec with" => 742: assert_includes @ui.output, "Successfully uninstalled a-2\n" 743: 744: invoke "--verbose", "gem", "uninstall", "b" 745: assert_includes @ui.output, "Successfully uninstalled b-2\n" /mnt/lib/rubygems/user_interaction.rb:46:in `use_ui' /mnt/lib/rubygems/user_interaction.rb:69:in `use_ui' /mnt/test/rubygems/test_gem_commands_exec_command.rb:726:in `test_gem_exec_gem_uninstall' ~~~ This does not tell much. Empty string is more often good sign, but not in this case. However, checking error output first helps with understanding possible issue: ~~~ Failure: test_gem_exec_gem_uninstall(TestGemCommandsExecCommand): <"ERROR: While executing gem ... (Gem::FilePermissionError)\n" + " You don't have write permissions for the /builddir/bin directory.\n" + "\t/mnt/lib/rubygems/uninstaller.rb:213:in `remove_executables'\n" + ... snip ... /mnt/test/rubygems/test_gem_commands_exec_command.rb:740:in `block in test_gem_exec_gem_uninstall' 737: nil 738: end 739: => 740: assert_empty @ui.error 741: refute_includes @ui.output, "running gem exec with" 742: assert_includes @ui.output, "Successfully uninstalled a-2\n" 743: /mnt/lib/rubygems/user_interaction.rb:46:in `use_ui' /mnt/lib/rubygems/user_interaction.rb:69:in `use_ui' /mnt/test/rubygems/test_gem_commands_exec_command.rb:726:in `test_gem_exec_gem_uninstall' ~~~ BTW this issue is caused by operating_system.rb overriding `Gem.operating_system_defaults` method and explicitly adding `--bindir` option. https://github.com/rubygems/rubygems/commit/d98e36bbe7
2023-11-09[rubygems/rubygems] Make the `test_build_extensions` more predictableVít Ondruch
The `test_build_extensions` make assumptions about return value of `Gem.install_extension_in_lib`. Givent that RubyGems allow to override this method via `defaults.rb` / `operating_system.rb`, this test might not always pass. This change makes sure that the `Gem.install_extension_in_lib` is predictable. https://github.com/rubygems/rubygems/commit/e83d0a5da8
2023-11-09[rubygems/rubygems] Use `extension_in_lib` helper instead of custom codeVít Ondruch
`extension_in_lib` helper improves readibility and it also uses `stub` on on background instead of custom code. https://github.com/rubygems/rubygems/commit/aacc8ac22c
2023-11-08[rubygems/rubygems] Allow `--install-dir` to be specified together with ↵Vít Ondruch
`--user-install` The combination of `install-dir` and `--user-install` used to be disabled for no good reason. This even makes problem on Linux distributions such as Fedora, where `--user-install` is set by default via operating_system.rb. The `--install-dir` is already prefered over the `--user-install` by the implementation, therefore just drop the check. https://github.com/rubygems/rubygems/commit/313b1c5e76
2023-11-08[rubygems/rubygems] Don't use `util_installer` for user installVít Ondruch
It is not nice to require install directory to be always specified, while this option is later ignored for user installed gems. Actually, the next step will be to remove `check_install_dir` check and let the install dir override the user install. https://github.com/rubygems/rubygems/commit/beb79e929f
2023-11-08[rubygems/rubygems] Check for `:install_dir` precedence over `:user_install`Vít Ondruch
https://github.com/rubygems/rubygems/commit/6539da07aa
2023-11-08[rubygems/rubygems] Make the user installation less exceptionalVít Ondruch
The main purpose is to put handling of user installation into the same place as e.g. handling the --build-root option handling. There is no reason why the --build-root option should not prefix also paths used for user installation. Please note that the `util_installer` in `test_generate_plugins_with_user_install` enforced the `:install_dir`, which is against what user install is about. https://github.com/rubygems/rubygems/commit/0b10cb41aa
2023-11-08[rubygems/rubygems] Remove kludge that should be unnecessary.Ellen Marie Dash
https://github.com/rubygems/rubygems/commit/f1d44ecb62
2023-11-08[rubygems/rubygems] Allow test_gem_install_update_options to raise ↵Ellen Marie Dash
Errno::ACCES, in addition to Gem::FilePermissionError. https://github.com/rubygems/rubygems/commit/784fe2a814
2023-10-26Revert "[ruby/prism] Use `cargo fmt`"Hiroshi SHIBATA
This reverts commit 4259d5b5aefd58d0bf86ad20122beee53533ff59. This commits is wrong result of sync_default_gems.rb