summaryrefslogtreecommitdiff
path: root/test/rubygems/helper.rb
AgeCommit message (Collapse)Author
2022-05-20Merge RubyGems and Bundler HEADHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/125415593ead9ab69a9f0bb5392c9d7ec61b1f51
2022-04-28Move testing_ruby_repo into test helperHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/5669
2022-04-28Merge ↵Hiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/3f7d0352e84b29d4a2d4cd93b31e5ebdb5f79cc6 Notes: Merged: https://github.com/ruby/ruby/pull/5669
2022-04-28Merge rubygems master 1e4eda741d732ca1bd7031aef0a16c7348adf7a5Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/5669
2022-04-07[rubygems/rubygems] Set `@tempdir` as early as possibleDavid Rodríguez
We have seen some errors during test `setup` before `@tempdir` is actually set, in particular, when instantiating `Gem::MockUI` which in turn requires `stringio`. In this case, the `teardown` method will also produce an error because it tries to remove the `@tempdir`, which has not been set, so tries to remove a `nil` directory. It results in a confusing error like ``` <internal:D:/a/rubygems/rubygems/lib/rubygems/core_ext/kernel_require.rb>:85:in `require': Interrupt Error: test_bump_one_level(TestGemVersion): TypeError: no implicit conversion of nil into String C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/3.1.0/fileutils.rb:1570:in `path' from <internal:D:/a/rubygems/rubygems/lib/rubygems/core_ext/kernel_require.rb>:85:in `require' C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/3.1.0/fileutils.rb:1570:in `block in fu_list' from D:/a/rubygems/rubygems/lib/rubygems/mock_gem_ui.rb:43:in `initialize' C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/3.1.0/fileutils.rb:1570:in `map' from D:/a/rubygems/rubygems/test/rubygems/helper.rb:323:in `new' C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/3.1.0/fileutils.rb:1570:in `fu_list' from D:/a/rubygems/rubygems/test/rubygems/helper.rb:323:in `setup' C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/3.1.0/fileutils.rb:616:in `rm_r' from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/fixture.rb:284:in `run_fixture_callback' C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/3.1.0/fileutils.rb:638:in `rm_rf' from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/fixture.rb:272:in `block in create_fixtures_runner' D:/a/rubygems/rubygems/test/rubygems/helper.rb:462:in `teardown' from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/fixture.rb:276:in `block in create_fixtures_runner' =============================================================================== from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/fixture.rb:257:in `run_fixture' from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/fixture.rb:292:in `run_setup' Finished in 683.0312862 seconds. from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/testcase.rb:564:in `block in run' ------------------------------------------------------------------------------- from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/testcase.rb:563:in `catch' 2185 tests, 5929 assertions, 0 failures, 1 errors, 28 pendings, 0 omissions, 0 notifications from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/testcase.rb:563:in `run' 98.7185% passed from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/testsuite.rb:124:in `run_test' ------------------------------------------------------------------------------- from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/testsuite.rb:53:in `run' 3.20 tests/s, 8.68 assertions/sTerminate batch job (Y/N)? from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/testsuite.rb:124:in `run_test' from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/testsuite.rb:53:in `run' from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/testsuite.rb:124:in `run_test' from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/testsuite.rb:53:in `run' from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunnermediator.rb:67:in `run_suite' from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunnermediator.rb:45:in `block (2 levels) in run' from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunnermediator.rb:102:in `with_listener' from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunnermediator.rb:41:in `block in run' from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunnermediator.rb:39:in `catch' from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunnermediator.rb:39:in `run' from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunner.rb:40:in `start_mediator' from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunner.rb:25:in `start' from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/ui/testrunnerutilities.rb:24:in `run' from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/autorunner.rb:458:in `block in run' from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/autorunner.rb:514:in `change_work_directory' from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/autorunner.rb:457:in `run' from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit/autorunner.rb:66:in `run' from C:/hostedtoolcache/windows/Ruby/3.1.1/x64/lib/ruby/gems/3.1.0/gems/test-unit-3.5.3/lib/test/unit.rb:518:in `block (2 levels) in <top (required)>' rake aborted! Interrupt: ``` The should make this same error much cleaner if it happens again. https://github.com/rubygems/rubygems/commit/fa649d22e8
2022-03-24[rubygems/rubygems] Avoid crash in test teardownDavid Rodríguez
If an exception happens during test `setup` method, the `teardown` method will still be run for cleaning up, but if some other errors occurs then, it will hide the original error. This is happening sometimes in CI where restoring original gem hooks is failing because the error in `setup` happened before the variable holding the original hooks was initialized. This commit moves initialization of `@orig_hooks` to the beginning of the `setup` method to avoid this issue. https://github.com/rubygems/rubygems/commit/8524d2b74d
2022-01-19Merge rubygems/rubygems HEAD.Hiroshi SHIBATA
Picked at 12aeef6ba9a3be0022be9934c1a3e4c46a03ed3a Notes: Merged: https://github.com/ruby/ruby/pull/5462
2022-01-19[rubygems/rubygems] Normalize end alignment style with BundlerDavid Rodríguez
https://github.com/rubygems/rubygems/commit/f7f504b24c
2021-12-15[rubygems/rubygems] Extract a helper to temporarily modify internal encodingDavid Rodríguez
https://github.com/rubygems/rubygems/commit/93051fd2aa
2021-12-15[rubygems/rubygems] Unify duplicated helperDavid Rodríguez
https://github.com/rubygems/rubygems/commit/c6ef75424d
2021-11-18[rubygems/rubygems] `Gem::Specification.reset` already clears loaded spec cacheDavid Rodríguez
Plus, that method is supposed to be private. https://github.com/rubygems/rubygems/commit/f8a01ddb9f
2021-11-09[rubygems/rubygems] Remove more unused stuff from make command parsingDavid Rodríguez
https://github.com/rubygems/rubygems/commit/eba7d173d4
2021-11-09[rubygems/rubygems] This method is never passed a blockDavid Rodríguez
https://github.com/rubygems/rubygems/commit/d79ade274b
2021-11-09[rubygems/rubygems] Fix assert_contains_make_command on make defined by ↵Jun Aruga
environment variable. The `parse_make_command_line` in `assert_contains_make_command` fails to get the make targets correctly, when the make command is set with make options by environment variable such as `export make='make -j2'` at lib/rubygems/ext/builder.rb::make. So, we include the make options (eg, -XX) as a part of the command to fix the case. Note that this commit still doesn't fix the case of `export make='make -j 2'`. https://github.com/rubygems/rubygems/commit/7730ef3fa0
2021-11-09[rubygems/rubygems] Improve error message when make command doesn't matchDavid Rodríguez
https://github.com/rubygems/rubygems/commit/8c2725e9a6
2021-11-05[rubygems/rubygems] Refactor setup tests to not always pass `--prefix`David Rodríguez
Standard usage should be tested by default. I will add a test for `--prefix` once I fix that option since it's not working correctly at the moment. https://github.com/rubygems/rubygems/commit/50a7e34586
2021-11-03[rubygems/rubygems] Fix `gem install` vs `gem fetch` inconsistencyDavid Rodríguez
https://github.com/rubygems/rubygems/commit/b3e985799e
2021-11-02Remove SimpleCov at all.Josef Šimánek
2021-10-26[rubygems/rubygems] Add support to build and sign certificates with multiple ↵Jenny Shen
key algorithms https://github.com/rubygems/rubygems/commit/967876f15d Co-Authored-By: Frederik Dudzik <frederik.dudzik@shopify.com>
2021-10-14[rubygems/rubygems] Remove save_loaded_featuresNobuyoshi Nakada
https://github.com/rubygems/rubygems/commit/f5e408f83d
2021-10-14[rubygems/rubygems] Keep loaded featuresNobuyoshi Nakada
Now `$LOADED_FEATURES` list is being maintained by `setup` and `teardown` and, only libaries under the temporary directory will be removed. As `save_loaded_features` removes the rest libraries other than this test directory, ordinary libraries loaded from files under rubygems also removed, and often causes constant redefinition warnings. https://github.com/rubygems/rubygems/commit/9e1f92aafd
2021-10-09[rubygems/rubygems] Improve performance of Specification#missing_extensions?Masataka Pocke Kuwabara
https://github.com/rubygems/rubygems/commit/90c1919f94
2021-09-24[rubygems/rubygems] Use pend instead of skip in the absence of git in test ↵Lucas Kanashiro
helper https://github.com/rubygems/rubygems/commit/798a93a98c
2021-08-31[rubygems/rubygems] Use `Gem.use_gemdeps` only from binstubsDavid Rodríguez
The previous behavior was to automatically require `bundler/setup` everytime `rubygems` was required, which I think was too much. https://github.com/rubygems/rubygems/commit/b25379a295 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-07-07Sync RubyGems and Bundler with upstreamHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4634
2021-07-07Sync latest bundler & rubygems development versionDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/4533
2021-06-22Avoid a duplicated method definition of Object#stubYusuke Endoh
http://rubyci.s3.amazonaws.com/ubuntu/ruby-master/log/20210622T063005Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20210622T063005Z/ruby/test/rubygems/helper.rb:1565: warning: method redefined; discarding old stub /home/chkbuild/chkbuild/tmp/build/20210622T063005Z/ruby/test/resolv/test_dns.rb:8: warning: previous definition of stub was here ```
2021-06-17[rubygems/rubygems] Close then unlink tempfiles on WindowsNobuyoshi Nakada
In ruby/ruby test actions, number of "leaked tempfile" messages are shown on Windows. As Windows disallows removing open files, `Tempfile#unlink` fails silently before `#close`. Close then unlink by `#close!` instead. https://github.com/rubygems/rubygems/commit/fe0b88ac30
2021-06-03[rubygems/rubygems] Rename test/rubygems/test_{case,utilities}.rb to avoid ↵Yusuke Endoh
"test_" prefix This changes "test/rubygems/test_case.rb" to "test/rubygems/helper.rb", and "test/rubygems/test_utilities.rb" to "test/rubygems/utilities.rb". The two files are a helper for tests, not test files. However, a file starting with "test_" prefix is handled as a test file directly loaded by test-unit because Rakefile specifies: ``` t.test_files = FileList['test/**/test_*.rb'] ``` Directly loading test/rubygems/test_utilities.rb caused "uninitialized constant Gem::TestCase". This issue was fixed by 59c682097197fee4052b47e4b4ab86562f3eaa9b, but the fix caused a "circular require" warning because test_utilities.rb and test_case.rb are now requiring each other. Anyway, adding "test_" prefix to a test helper file is confusing, so this changeset reverts the fix and solve the issue by renaming them. https://github.com/rubygems/rubygems/commit/6460e018df