summaryrefslogtreecommitdiff
path: root/test/rubygems
AgeCommit message (Collapse)Author
2020-06-17test/rubygems/test_gem_package.rb: Skip a test when TMPDIR is too longYusuke Endoh
to suppress the following failure: https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11-gcc/ruby-master/log/20200617T130007Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/android29-x86_64/ruby-master/log/20200617T131443Z.fail.html.gz ``` 1) Failure: TestGemPackage#test_extract_symlink_parent_doesnt_delete_user_dir [/export/home/chkbuild/chkbuild-gcc/tmp/build/20200617T130007Z/ruby/test/rubygems/test_gem_package.rb:620]: --- expected +++ actual @@ -1 +1 @@ -"installing into parent path /export/home/chkbuild/chkbuild-gcc/tmp/build/20200617T130007Z/ruby/tmp/test_rubygems_15916/extract/user/dir of /export/home/chkbuild/chkbuild-gcc/tmp/build/20200617T130007Z/ruby/tmp/test_rubygems_15916/extract/subdir is not allowed" +"installing into parent path link/dir of /export/home/chkbuild/chkbuild-gcc/tmp/build/20200617T130007Z/ruby/tmp/test_rubygems_15916/extract/subdir is not allowed" ``` These CI environments use very long TMPDIR for some reason. The test case creates a directory in TMPDIR and attempts to add a symbolic link to the path into a tarball. However, tar format limits the maximum length up to 99, so the path is truncated. This truncation makes the path check of `Gem::Package#install_location` pass through, and then the check of `#mkdir_p_safe` raises an error. The error message is slightly different from the expected value, so the test fails. I'm unsure what to do, so I tentatively skip the test when TMPDIR is long. I'll create a ticket into rubygems bug tracker.
2020-06-17Speed up setup test by not installing docsDavid Rodríguez
This also makes this test consistent with the other tests in this file. Notes: Merged: https://github.com/ruby/ruby/pull/3213
2020-06-17Skip `test_gem_package_task` if `rake` not presentDavid Rodríguez
Instead of erroring. Notes: Merged: https://github.com/ruby/ruby/pull/3213
2020-06-17Simplify handling of a `LoadError`David Rodríguez
The `LoadError` has a `path` reader in all supported rubies. Notes: Merged: https://github.com/ruby/ruby/pull/3213
2020-06-15Exit with non-zero status on disabled gem system update.Josef Šimánek
Notes: Merged: https://github.com/ruby/ruby/pull/3229
2020-06-15Add Gem.disable_system_update_message to disable gem update --system if needed.Josef Šimánek
Notes: Merged: https://github.com/ruby/ruby/pull/3229
2020-06-15Remove encoding magic commentsDavid Rodríguez
They are no longer needed since ruby 2.0. Notes: Merged: https://github.com/ruby/ruby/pull/3229
2020-06-15Deprecate `Gem::Util.silent_system`David Rodríguez
There's better tools for this job. Notes: Merged: https://github.com/ruby/ruby/pull/3229
2020-06-15Replace `Gem::Util.silent_system` with better toolsDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/3229
2020-06-15Use space inside block braces everywhereDavid Rodríguez
To make rubygems code style consistent with bundler. Notes: Merged: https://github.com/ruby/ruby/pull/3229
2020-06-15Revert "Revert "[rubygems/rubygems] Remove unneeded global teardown""David Rodríguez
This reverts commit ac2c07e98373bb62be618001c897fa9d5809d8a4. Notes: Merged: https://github.com/ruby/ruby/pull/3211
2020-06-15Revert "Revert "[rubygems/rubygems] Remove unneeded teardown""David Rodríguez
This reverts commit ceacb06311cf150cd3682b277bbe6cf7e7bbbc30. Notes: Merged: https://github.com/ruby/ruby/pull/3211
2020-06-10[rubygems/rubygems] Use parenthesis for clarity for ternary conditionBenoit Daloze
https://github.com/rubygems/rubygems/commit/d1247472b9
2020-06-10[rubygems/rubygems] Increase timeouts in test_gem_stream_ui.rbBenoit Daloze
* 0.1s is really short and fails in CI: #3622 https://github.com/rubygems/rubygems/commit/d8495ae1c1
2020-06-05Skip tests which do not work until installed when load-relativeNobuyoshi Nakada
2020-06-05Show better failure messagesNobuyoshi Nakada
2020-06-05Enable `Style/MethodCallWithoutArgsParentheses` in rubygemsDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Use LoadError#path to figure out the argument passed to ↵Yuki Nishijima
'require' https://github.com/rubygems/rubygems/commit/5995394ec4 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Modify `RakeFileUtils.verbose_flag` only when neededDavid Rodríguez
https://github.com/rubygems/rubygems/commit/d490309d75 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Fix test warningsDavid Rodríguez
Since `rake package` started printing to stdout by default, we get these warnings printed when running rubygems tests: ``` $ rake Run options: --seed 6097 # Running: ...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................mkdir -p pkg mkdir -p pkg/pkgr-1.2.3 rm -f pkg/pkgr-1.2.3/x ln x pkg/pkgr-1.2.3/x rm -f pkg/pkgr-1.2.3/y ln y pkg/pkgr-1.2.3/y cd pkg/pkgr-1.2.3 cd - .... Finished in 50.578889s, 43.0812 runs/s, 134.8191 assertions/s. 2179 runs, 6819 assertions, 0 failures, 0 errors, 0 skips Coverage report generated for Unit Tests to /home/deivid/Code/rubygems/coverage. 8080 / 8978 LOC (90.0%) covered. ``` The reason is that, although these tests wrap the `Rake.application["package"].invoke` with a `capture_io` block, the rake application initialization happens outside of this block, and a copy of `$stdout` is saved in there, and that's where the task prints. So the `capture_io` `$stdout` and `$stderr` dance is not effective. To fix, we move the `Rake` application initialization inside the `capture_io` block. https://github.com/rubygems/rubygems/commit/7f6e2398a5 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Only run optional validations in packaging contextsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/f4fe949dfa Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Respect files loaded from default gems before rubygemsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/f3da3c1190 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Use a real file to run the testBenoit Daloze
* JRuby doesn't support multi-line -e. https://github.com/rubygems/rubygems/commit/1fb6657a7d Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Add a more comprehensive and reliable test for upgraded ↵Benoit Daloze
default gems * Test that the correct version is loaded and that the default gem is not loaded at all. https://github.com/rubygems/rubygems/commit/ee08508b2a Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Relax test to still check we're calling the expected RubyBenoit Daloze
* But not enforce that error looks like /full/path/to/ruby/bin/ruby: No such file or directory but instead allow truffleruby: No such file or directory A typical output for gem_make.out looks like: current directory: /.../rubygems/tmp/test_rubygems_112388/gemhome/gems/a-2 /.../ruby-2.6.6/bin/ruby -I /.../rubygems/lib -r ./siteconf20200422-112388-nyrcy0.rb extconf.rb '' /.../ruby-2.6.6/bin/ruby: No such file or directory -- extconf.rb (LoadError) https://github.com/rubygems/rubygems/commit/e6e08882cc Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Fix check for testing in the ruby repositoryBenoit Daloze
* When testing in the rubygems/rubygems repository, the previous code would move the lib/ dir at the end of $LOAD_PATH, which would cause to load a mix of lib/ RubyGems and in-stdlib-dir RubyGems, which blows up. https://github.com/rubygems/rubygems/commit/f6f6f00ed1 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Clarify what ↵Benoit Daloze
test_activate_via_require_respects_loaded_files does and tests * Clearly require the benchmark stdlib instead of far away in test_case.rb https://github.com/rubygems/rubygems/commit/d74b9ca04c Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Simplify #warn test to not rely on the effect of -C on -IBenoit Daloze
https://github.com/rubygems/rubygems/commit/382642a0d4 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Fix `$LOADED_FEATURES` cache sometimes not respectedDavid Rodríguez
In the cases where the initial manually `-I` path resolution succeeded, we were passing a full path to the original require effectively skipping the `$LOADED_FEATURES` cache. With this change, we _only_ do the resolution when a matching requirable path is found in a default gem. In that case, we skip activation of the default gem if we detect that the required file will be picked up for a `-I` path. https://github.com/rubygems/rubygems/commit/22ad5717c3 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Fix performance regression in `require`David Rodríguez
Our check for `-I` paths should not go through all activated gems. https://github.com/rubygems/rubygems/commit/00d98eb8a3 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Add build warning when rake based extension is present, ↵Josef Šimánek
but rake is not specified as dependency. https://github.com/rubygems/rubygems/commit/75fe5475b6 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Fix template cleanup as wellDavid Rodríguez
https://github.com/rubygems/rubygems/commit/10cc79ee21 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Fix installing template files with dotsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/a82a77251d Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Move require to the topbronzdoc
https://github.com/rubygems/rubygems/commit/e6cabc3f1e Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Use ruby_with_rubygems_in_load_path helperbronzdoc
https://github.com/rubygems/rubygems/commit/5e6d82b1f2 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Make sure rubygems/package can be directly required reliablybronzdoc
https://github.com/rubygems/rubygems/commit/73c199b087 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Make `rake package` log messages to stdout by defaultDavid Rodríguez
The logging to $stderr is only happening due to a bug in `FileUtils`. Logging messages are not errors. https://github.com/rubygems/rubygems/commit/4d1b6659e6 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Move setting verbosity to each testDavid Rodríguez
So that I can add a separate test that doesn't set it. https://github.com/rubygems/rubygems/commit/5726cb418c Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Don't leave side effects on verbosityDavid Rodríguez
https://github.com/rubygems/rubygems/commit/c58e711598 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-06-05[rubygems/rubygems] Remove unnecessary rescue and loading of bundlerDavid Rodríguez
https://github.com/rubygems/rubygems/commit/7ecc216505 Notes: Merged: https://github.com/ruby/ruby/pull/3184
2020-05-10Run rb_syswait on exec failureTakashi Kokubun
not only when !w but also when w == WAITPID_LOCK_ONLY. See also: f7c0cc36920a4ed14a3ab1ca6cfdf18ceff1e5d5 and a2264342063260d660b99872eaf5080f6ab08e81. We thought this change was an oversight in the latter commit. Without this change, the test fails like: $ make test-all TESTS="../test/ruby/test_process.rb -n test_exec_failure_leaves_no_child" RUN_OPTS="--jit" ... 1) Failure: TestProcess#test_exec_failure_leaves_no_child [/home/k0kubun/src/github.com/ruby/ruby/test/ruby/test_process.rb:2493]: Expected [[26799, #<Process::Status: pid 26799 exit 127>]] to be empty. Co-Authored-By: Yusuke Endoh <mame@ruby-lang.org>
2020-05-09Workaround a zombie process created by Open3Takashi Kokubun
with MJIT worker enabled The problem: ``` $ ruby -ropen3 --jit -e 'Open3.capture2e("cmake") rescue nil;binding.irb' irb(main)[01:0]> Process.waitall => [[10656, #<Process::Status: pid 10656 exit 127>]] $ ruby -ropen3 -e 'Open3.capture2e("cmake") rescue nil;binding.irb' irb(main)[01:0]> Process.waitall => [] ``` Not sure why it's happening yet, but first I'd like to prevent trunk-mjit-wait from failing like http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2929075.
2020-05-10test/rubygems/test_gem_ext_cmake_builder.rb: make sure cmake availableYusuke Endoh
just for a case. In addition, this change suppresses unused variable warning.
2020-05-08`Open3.capture2e` raises exception when the command is not present.Hiroshi SHIBATA
2020-05-08Revert "[rubygems/rubygems] Remove unneeded global teardown"Hiroshi SHIBATA
This reverts commit 93d1588c782ab9d61699f98b6c64d7f0ab8121c0. Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08Revert "[rubygems/rubygems] Remove unneeded teardown"Hiroshi SHIBATA
This reverts commit 0da416ab170dbe1cbd530a5a7c5e8128910014b2. Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Remove unneeded teardownDavid Rodríguez
Tests using credentials shouldn't be leaving side effects. https://github.com/rubygems/rubygems/commit/975bcafdfc Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Remove unneeded global teardownDavid Rodríguez
Instead, make each test cleanup after itself. https://github.com/rubygems/rubygems/commit/e0aba9d64f Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Removed needless setup to clear credentialHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/4f694f4fb7 Notes: Merged: https://github.com/ruby/ruby/pull/3092
2020-05-08[rubygems/rubygems] Also added credential_setup to the some of testsHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/2ac557d008 Notes: Merged: https://github.com/ruby/ruby/pull/3092