aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems
Commit message (Collapse)AuthorAgeFilesLines
* [rubygems/rubygems] Use modern hashes consistentlyDavid Rodríguez2023-12-0732-366/+366
| | | | https://github.com/rubygems/rubygems/commit/bb66253f2c
* [rubygems/rubygems] Make --build-root disable auto-user-install.Ellen Marie Dash2023-12-071-0/+20
| | | | https://github.com/rubygems/rubygems/commit/6a06b0763f
* [rubygems/rubygems] Better approach to falling back to user installation ↵David Rodríguez2023-12-073-93/+20
| | | | | | when GEM_HOME not writable https://github.com/rubygems/rubygems/commit/f67bced16b
* [rubygems/rubygems] Add some early assertions to make sure the test is ↵David Rodríguez2023-12-071-0/+3
| | | | | | | | | 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
* [rubygems/rubygems] Use globals variables for standard input/outputVít Ondruch2023-12-071-0/+19
| | | | | | | | | | | 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
* [rubygems/rubygems] Gem::UpdateSuggestion uses Gem::CIDetectorEric Mueller2023-12-061-1/+1
| | | | https://github.com/rubygems/rubygems/commit/e5b0458342
* [rubygems/rubygems] Introduce the Gem::CIDetectorEric Mueller2023-12-061-0/+44
| | | | | | | | | | | | | | | | | | | | | | 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
* [rubygems/rubygems] test_bundled_ca.rb: Add Net::OpenTimeout as a offline case.Jun Aruga2023-12-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [rubygems/rubygems] Instead of checking writability, try to writeDavid Rodríguez2023-12-051-2/+4
| | | | | | | | | | 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
* [rubygems/rubygems] Set specs as pending at the beginningDavid Rodríguez2023-12-051-13/+10
| | | | | | And word them consistently with other specs. https://github.com/rubygems/rubygems/commit/eee7afefd3
* [rubygems/rubygems] Simplify `--no-user-install` specDavid Rodríguez2023-12-051-14/+7
| | | | | | | This spec is ignoring the local `.gem` file, so most stuff is not needed. https://github.com/rubygems/rubygems/commit/d52526800f
* [rubygems/rubygems] Only show "Defaulting to user installation" message when ↵Ellen Marie Dash2023-11-301-0/+62
| | | | | | it matters. https://github.com/rubygems/rubygems/commit/61b0947225
* [rubygems/rubygems] Bump rb-sysdependabot[bot]2023-11-212-7/+7
| | | | | | | | | | | | | | | | | 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
* [rubygems/rubygems] Bump rb-sysdependabot[bot]2023-11-212-7/+7
| | | | | | | | | | | | | | | | | 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
* [rubygems/rubygems] Make temp gem home independent of pwdDavid Rodríguez2023-11-151-1/+1
| | | | https://github.com/rubygems/rubygems/commit/5c36556d2e
* [rubygems/rubygems] Explicitly define `@default_specifications_dir` for testsVít Ondruch2023-11-131-1/+1
| | | | | | | | | | 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
* [rubygems/rubygems] Provide more insightful test error outputVít Ondruch2023-11-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [rubygems/rubygems] Drop support for Ruby 2.6 and Ruby 2.7 in RubyGemsDavid Rodríguez2023-11-137-36/+8
| | | | https://github.com/rubygems/rubygems/commit/10c26a483d
* [rubygems/rubygems] Report possible error prior checking output of gem uninstallVít Ondruch2023-11-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [rubygems/rubygems] Make the `test_build_extensions` more predictableVít Ondruch2023-11-091-24/+27
| | | | | | | | | | 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
* [rubygems/rubygems] Use `extension_in_lib` helper instead of custom codeVít Ondruch2023-11-092-38/+33
| | | | | | | `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
* [rubygems/rubygems] Allow `--install-dir` to be specified together with ↵Vít Ondruch2023-11-081-15/+0
| | | | | | | | | | | | | | `--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
* [rubygems/rubygems] Don't use `util_installer` for user installVít Ondruch2023-11-081-6/+4
| | | | | | | | | | 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
* [rubygems/rubygems] Check for `:install_dir` precedence over `:user_install`Vít Ondruch2023-11-081-0/+13
| | | | https://github.com/rubygems/rubygems/commit/6539da07aa
* [rubygems/rubygems] Make the user installation less exceptionalVít Ondruch2023-11-081-1/+1
| | | | | | | | | | | | | 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
* [rubygems/rubygems] Remove kludge that should be unnecessary.Ellen Marie Dash2023-11-081-1/+1
| | | | https://github.com/rubygems/rubygems/commit/f1d44ecb62
* [rubygems/rubygems] Allow test_gem_install_update_options to raise ↵Ellen Marie Dash2023-11-081-1/+1
| | | | | | Errno::ACCES, in addition to Gem::FilePermissionError. https://github.com/rubygems/rubygems/commit/784fe2a814
* Revert "[ruby/prism] Use `cargo fmt`"Hiroshi SHIBATA2023-10-262-4/+0
| | | | | | This reverts commit 4259d5b5aefd58d0bf86ad20122beee53533ff59. This commits is wrong result of sync_default_gems.rb
* [ruby/prism] Use `cargo fmt`Ian Ker-Seymer2023-10-262-0/+4
| | | | https://github.com/ruby/prism/commit/5969b827ae
* [rubygems/rubygems] Raise exception on unexpected EOF in marshalSamuel Giddins2023-10-251-0/+17
| | | | | | Instead of NoMethodError being raised by accidentally trying to use nil https://github.com/rubygems/rubygems/commit/ac8f812bbf
* [rubygems/rubygems] Ignore non-tar format `.gem` files during searchdearblue2023-10-231-0/+15
| | | | | | Previously, `rake install` or `rake update` would fail if there was a non-tar format `.gem` file in the current working directory. https://github.com/rubygems/rubygems/commit/f562788f1d
* [rubygems/rubygems] Gem::NameTuple equality ignores Gem::Platform/string ↵Martin Emde2023-10-211-8/+25
| | | | | | platform variation https://github.com/rubygems/rubygems/commit/49aaa46708
* [rubygems/rubygems] Allow uninstalling multiple versions of same gemKyle Stevens2023-10-181-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, you can install multiple versions of the same gem just fine: ``` $ gem install simplecov:0.19.0 simplecov:0.22.0 Fetching simplecov-0.19.0.gem Successfully installed simplecov-0.19.0 Parsing documentation for simplecov-0.19.0 Installing ri documentation for simplecov-0.19.0 Done installing documentation for simplecov after 0 seconds Fetching simplecov-0.22.0.gem Successfully installed simplecov-0.22.0 Parsing documentation for simplecov-0.22.0 Installing ri documentation for simplecov-0.22.0 Done installing documentation for simplecov after 0 seconds 2 gems installed ``` But to uninstall both of them, you need to run the equivalent uninstall command twice: ``` ~$ gem uninstall simplecov:0.19.0 simplecov:0.22.0 Successfully uninstalled simplecov-0.22.0 ~$ gem uninstall simplecov:0.19.0 simplecov:0.22.0 Gem 'simplecov' is not installed Successfully uninstalled simplecov-0.19.0 ``` This resolves that problem by using the gem's full name (which includes the version) when tracking which ones have already been uninstalled so when it gets to the second version listed it doesn't think it was already uninstalled. https://github.com/rubygems/rubygems/commit/d96101b753
* [rubygems/rubygems] Remove kludge that should be unnecessary.Ellen Marie Dash2023-10-161-1/+1
| | | | https://github.com/rubygems/rubygems/commit/f1d44ecb62
* [rubygems/rubygems] Simplify logic for Gem::PathSupport#home, and make ↵Ellen Marie Dash2023-10-111-1/+5
| | | | | | GEM_HOME always overide it. https://github.com/rubygems/rubygems/commit/64273fd7e3
* [rubygems/rubygems] Allow test_gem_install_update_options to raise ↵Ellen Marie Dash2023-10-111-1/+1
| | | | | | Errno::ACCES, in addition to Gem::FilePermissionError. https://github.com/rubygems/rubygems/commit/784fe2a814
* [rubygems/rubygems] Update tests to match new implementation of falling back ↵Ellen Marie Dash2023-10-111-4/+4
| | | | | | to user-writable directories. https://github.com/rubygems/rubygems/commit/a06e657ac6
* [rubygems/rubygems] [test_gem_install_update_options.rb] Fix linter warnings.Ellen Marie Dash2023-10-111-3/+3
| | | | https://github.com/rubygems/rubygems/commit/cdcb8394f6
* [rubygems/rubygems] If GEM_HOME exists + isn't writable, use --user-install.Ellen Marie Dash2023-10-111-0/+27
| | | | https://github.com/rubygems/rubygems/commit/6d20585645
* [rubygems/rubygems] Fix typo: eglible -> eligible.Josef Šimánek2023-10-032-49/+49
| | | | https://github.com/rubygems/rubygems/commit/1e487e1337
* [rubygems/rubygems] Update SPDX list and warn on deprecated identifiers.Josef Šimánek2023-09-302-19/+38
| | | | https://github.com/rubygems/rubygems/commit/61667028f5
* [rubygems/rubygems] Bump rb-sysdependabot[bot]2023-09-252-5/+5
| | | | | | | | | | | | | | | | | Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.81 to 0.9.82. - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.81...v0.9.82) --- 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/780fb19b03
* [rubygems/rubygems] Bump rb-sysdependabot[bot]2023-09-252-5/+5
| | | | | | | | | | | | | | | | | Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.81 to 0.9.82. - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.81...v0.9.82) --- 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/f48d03aabd
* [rubygems/rubygems] Fix safe marshal test on jrubySamuel Giddins2023-09-211-2/+2
| | | | | | Allow for variance in order of dumped ivars, fix by setting the disallowed ivar on an object that will have no other ivars so the index is consistent https://github.com/rubygems/rubygems/commit/ccb8f42753
* [rubygems/rubygems] Remove usage of Dir.chdir that just execute a subprocessSamuel Giddins2023-09-211-2/+5
| | | | | | Preferring instead to spawn the subprocess in the correct directory https://github.com/rubygems/rubygems/commit/ad5abd6a45
* [rubygems/rubygems] Freeze more strings in generated gemspecsSamuel Giddins2023-09-211-13/+13
| | | | | | | | | | Specifically, this will have frozen string literals for: - Gem platform tuple entries - Gem::Version strings - Gem::Specification#installed_by_version - Dependency requirement strings https://github.com/rubygems/rubygems/commit/6195da5bdb
* [rubygems/rubygems] Aggressively optimize allocations in SafeMarshalSamuel Giddins2023-09-211-1/+29
| | | | | | | | | | | | | | | | Reduces allocations in a bundle install --full-index by an order of magnitude Main wins are (a) getting rid of exessive string allocations for exception message stack (b) Avoiding hash allocations caused by kwargs for #initialize (c) avoid using unpack to do bit math, its easy enough to do by hand (d) special case the most common elements so they can be read without an allocation (e) avoid string allocations every time a symbol->string lookup is done by using symbol#name https://github.com/rubygems/rubygems/commit/7d2ee51402
* [rubygems/rubygems] Give up, load Time via Marshal.loadSamuel Giddins2023-09-201-9/+136
| | | | https://github.com/rubygems/rubygems/commit/6c92ba2ba3
* [rubygems/rubygems] Ruby 2.6 compatSamuel Giddins2023-09-201-4/+6
| | | | https://github.com/rubygems/rubygems/commit/1a84960af3
* [rubygems/rubygems] All rubies working with different time zonesSamuel Giddins2023-09-201-4/+23
| | | | | | | | Tested with: `ruby -e 'trap("INT") { exit 1 }; TZ=%w[UTC +0000 -0000]; RUBY=%w[ruby-2.7 ruby-3.2.2 jruby-9.4 truffleruby-22 truffleruby-23]; TZ.product(RUBY).each { |t, r| puts ?**120, "TZ=#{t} RUBY=#{r}", "*"*120; system({"TZ"=>t,"RUBY"=>r}, *ARGV) }' zsh -lic 'chruby $RUBY; ruby -vw -Ilib test/rubygems/test_gem_safe_marshal.rb --verbose=progress'` https://github.com/rubygems/rubygems/commit/6192005afb