aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Improved assertionsNobuyoshi Nakada2020-06-091-2/+2
|
* [ruby/gdbm] Workaround for GitHub ActionsHiroshi SHIBATA2020-06-091-1/+1
| | | | https://github.com/ruby/gdbm/commit/f42103fe93
* Return seconds slept after Thread.scheduler wait_sleepnicholas a. evans2020-06-091-1/+18
| | | | | | Kernel#sleep should still return seconds slept, even when using a Thread.scheduler. The return value of Scheduler#wait_sleep can be ignored.
* disable GC on a testKoichi Sasada2020-06-091-1/+1
| | | | CI fails with GC while `foo{}`, so that disable GC for this script.
* Differentiate `...` in lambda argumentsNobuyoshi Nakada2020-06-071-2/+3
|
* Add leading arguments support to arguments forwardingJeremy Evans2020-06-062-3/+124
| | | | | | | | The idFWD_KWREST sections may be wrong. However, the existing idFWD_KWREST sections for ... without leading arguments are already broken. Implements [Feature #16378]
* Make test for no method error more reliableYuki Nishijima2020-06-061-8/+12
| | | | This test should not depend on the bahaviour of the did_you_mean gem.
* Sync did_you_meanYuki Nishijima2020-06-065-130/+147
|
* [ruby/psych] Fixing compatibility with libyaml 0.2.5Aaron Patterson2020-06-053-24/+21
| | | | | | | | | The main issue is that commas aren't allowed in local tags. libyaml was updated to follow the spec, and our tests were out of date. See: https://github.com/yaml/libyaml/issues/196 https://github.com/ruby/psych/commit/3f5e520fd3
* [ruby/psych] Fix ArgumentError with leading and trailing underscores in ↵Mark Thorn2020-06-051-0/+3
| | | | | | number strings. https://github.com/ruby/psych/commit/ac2d2c9b1b
* [ruby/psych] Implement `freeze` option for Pysch.loadJean Boussier2020-06-051-0/+16
| | | | https://github.com/ruby/psych/commit/7dae24894d
* `local_address` may raise IOError in debug printKazuhiro NISHIYAMA2020-06-051-1/+1
| | | | | | | | | | | | | | | https://rubyci.org/logs/rubyci.s3.amazonaws.com/wsl2/ruby-master/log/20200605T020004Z.fail.html.gz ``` [ 984/20282] IMAPTest#test_connection_closed_without_greeting#<Thread:0x000055b6e9589d28 /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/test/net/imap/test_imap.rb:133 run> terminated with exception (report_on_exception is true): /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/.ext/common/socket.rb:252:in `local_address': closed stream (IOError) from /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/.ext/common/socket.rb:252:in `connect_address' from /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/test/net/imap/test_imap.rb:514:in `block (2 levels) in test_connection_closed_without_greeting' from /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/test/net/imap/test_imap.rb:514:in `each_object' from /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/test/net/imap/test_imap.rb:514:in `each' from /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/test/net/imap/test_imap.rb:514:in `map' from /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/test/net/imap/test_imap.rb:514:in `block in test_connection_closed_without_greeting' from /home/mame/chkbuild/tmp/build/20200605T020004Z/ruby/test/net/imap/test_imap.rb:134:in `block in start_server' ```
* Add sockets to debug printKazuhiro NISHIYAMA2020-06-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | debug print does not include `in_tcp_socket_2`, so I think other socket connected to server socket. Add sockets to debug print, and check other socket is in same process or not. https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11-gcc/ruby-master/log/20200604T160009Z.fail.html.gz ``` 1) Failure: IMAPTest#test_connection_closed_without_greeting [/export/home/chkbuild/chkbuild-gcc/tmp/build/20200604T160009Z/ruby/test/net/imap/test_imap.rb:523]: [Net::IMAP::Error] exception expected, not #<RuntimeError: {:server=>#<TCPServer:(closed)>, :port=>35490, :server_created=> {:server=>"#<TCPServer:fd 10, AF_INET6, ::1, 35490>", :t=>45917010.30510591}, :in_start_server_before_accept=>{:t=>45917010.305154555}, :in_tcp_socket=> {:host=>"::1", :port=>35490, :server=>"#<TCPServer:fd 10, AF_INET6, ::1, 35490>", :t=>45917010.40560127}, :in_start_server=> {:sock_addr=>["AF_INET6", 35490, "::1", "::1"], :sock_peeraddr=>["AF_INET6", 51584, "::1", "::1"], :t=>45917010.40767231}, :in_start_server_sock_closed=>{:t=>45917010.40770047}, :in_rescue=> {:e=>#<Errno::EINVAL: Invalid argument - connect(2) for [::1]:35490>, :server_addr=>"::1", :t=>45917010.40867455}} >. ```
* Skip tests which do not work until installed when load-relativeNobuyoshi Nakada2020-06-051-0/+3
|
* Show better failure messagesNobuyoshi Nakada2020-06-051-4/+9
|
* Enable `Style/MethodCallWithoutArgsParentheses` in rubygemsDavid Rodríguez2020-06-051-1/+1
|
* [rubygems/rubygems] Use LoadError#path to figure out the argument passed to ↵Yuki Nishijima2020-06-051-0/+27
| | | | | | 'require' https://github.com/rubygems/rubygems/commit/5995394ec4
* [rubygems/rubygems] Modify `RakeFileUtils.verbose_flag` only when neededDavid Rodríguez2020-06-051-18/+3
| | | | https://github.com/rubygems/rubygems/commit/d490309d75
* [rubygems/rubygems] Fix test warningsDavid Rodríguez2020-06-051-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [rubygems/rubygems] Only run optional validations in packaging contextsDavid Rodríguez2020-06-051-0/+11
| | | | https://github.com/rubygems/rubygems/commit/f4fe949dfa
* [rubygems/rubygems] Respect files loaded from default gems before rubygemsDavid Rodríguez2020-06-051-0/+18
| | | | https://github.com/rubygems/rubygems/commit/f3da3c1190
* [rubygems/rubygems] Use a real file to run the testBenoit Daloze2020-06-051-2/+5
| | | | | | * JRuby doesn't support multi-line -e. https://github.com/rubygems/rubygems/commit/1fb6657a7d
* [rubygems/rubygems] Add a more comprehensive and reliable test for upgraded ↵Benoit Daloze2020-06-051-0/+22
| | | | | | | | | 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
* [rubygems/rubygems] Relax test to still check we're calling the expected RubyBenoit Daloze2020-06-051-5/+1
| | | | | | | | | | | | | | * 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
* [rubygems/rubygems] Fix check for testing in the ruby repositoryBenoit Daloze2020-06-051-4/+11
| | | | | | | | * 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
* [rubygems/rubygems] Clarify what ↵Benoit Daloze2020-06-051-3/+16
| | | | | | | | 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
* [rubygems/rubygems] Simplify #warn test to not rely on the effect of -C on -IBenoit Daloze2020-06-051-2/+2
| | | | https://github.com/rubygems/rubygems/commit/382642a0d4
* [rubygems/rubygems] Fix `$LOADED_FEATURES` cache sometimes not respectedDavid Rodríguez2020-06-051-0/+29
| | | | | | | | | | | 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
* [rubygems/rubygems] Fix performance regression in `require`David Rodríguez2020-06-051-0/+11
| | | | | | Our check for `-I` paths should not go through all activated gems. https://github.com/rubygems/rubygems/commit/00d98eb8a3
* [rubygems/rubygems] Add build warning when rake based extension is present, ↵Josef Šimánek2020-06-051-0/+31
| | | | | | but rake is not specified as dependency. https://github.com/rubygems/rubygems/commit/75fe5475b6
* [rubygems/rubygems] Fix template cleanup as wellDavid Rodríguez2020-06-051-1/+3
| | | | https://github.com/rubygems/rubygems/commit/10cc79ee21
* [rubygems/rubygems] Fix installing template files with dotsDavid Rodríguez2020-06-051-0/+5
| | | | https://github.com/rubygems/rubygems/commit/a82a77251d
* [rubygems/rubygems] Move require to the topbronzdoc2020-06-051-2/+1
| | | | https://github.com/rubygems/rubygems/commit/e6cabc3f1e
* [rubygems/rubygems] Use ruby_with_rubygems_in_load_path helperbronzdoc2020-06-051-3/+5
| | | | https://github.com/rubygems/rubygems/commit/5e6d82b1f2
* [rubygems/rubygems] Make sure rubygems/package can be directly required reliablybronzdoc2020-06-051-0/+6
| | | | https://github.com/rubygems/rubygems/commit/73c199b087
* [rubygems/rubygems] Make `rake package` log messages to stdout by defaultDavid Rodríguez2020-06-051-0/+28
| | | | | | | 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
* [rubygems/rubygems] Move setting verbosity to each testDavid Rodríguez2020-06-051-1/+8
| | | | | | So that I can add a separate test that doesn't set it. https://github.com/rubygems/rubygems/commit/5726cb418c
* [rubygems/rubygems] Don't leave side effects on verbosityDavid Rodríguez2020-06-051-0/+8
| | | | https://github.com/rubygems/rubygems/commit/c58e711598
* [rubygems/rubygems] Remove unnecessary rescue and loading of bundlerDavid Rodríguez2020-06-051-6/+2
| | | | https://github.com/rubygems/rubygems/commit/7ecc216505
* test/socket/test_addrinfo.rb: Fix syntax errorYusuke Endoh2020-06-041-1/+1
| | | | Sorry!
* test/socket/test_addrinfo.rb: Suppress Errno::EACCES when addr is in useYusuke Endoh2020-06-041-1/+4
| | | | | | | | | | | | | | | | | | MinGW seems to raise Errno::EACCES instead of EADDRINUSE when bind fails due to in use. https://github.com/ruby/ruby/runs/736825846 ``` 2) Error: TestSocketAddrinfo#test_connect_from: Errno::EACCES: Permission denied - bind(2) for 0.0.0.0:49721 D:/a/ruby/ruby/build/.ext/common/socket.rb:54:in `bind' D:/a/ruby/ruby/build/.ext/common/socket.rb:54:in `connect_internal' D:/a/ruby/ruby/build/.ext/common/socket.rb:114:in `connect_from' D:/a/ruby/ruby/src/test/socket/test_addrinfo.rb:379:in `block in test_connect_from' D:/a/ruby/ruby/src/test/socket/test_addrinfo.rb:374:in `open' D:/a/ruby/ruby/src/test/socket/test_addrinfo.rb:374:in `test_connect_from' ```
* Properly resolve refinements in defined? on private call [Bug #16932]Nobuyoshi Nakada2020-06-041-0/+21
|
* Properly resolve refinements in defined? on method call [Bug #16932]Nobuyoshi Nakada2020-06-041-0/+28
|
* Ensure origins for all included, prepended, and refined modulesJeremy Evans2020-06-032-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes various issues when a module is included in or prepended to a module or class, and then refined, or refined and then included or prepended to a module or class. Implement by renaming ensure_origin to rb_ensure_origin, making it non-static, and calling it when refining a module. Fix Module#initialize_copy to handle origins correctly. Previously, Module#initialize_copy did not handle origins correctly. For example, this code: ```ruby module B; end class A def b; 2 end prepend B end a = A.dup.new class A def b; 1 end end p a.b ``` Printed 1 instead of 2. This is because the super chain for a.singleton_class was: ``` a.singleton_class A.dup B(iclass) B(iclass origin) A(origin) # not A.dup(origin) ``` The B iclasses would not be modified, so the includer entry would be still be set to A and not A.dup. This modifies things so that if the class/module has an origin, all iclasses between the class/module and the origin are duplicated and have the correct includer entry set, and the correct origin is created. This requires other changes to make sure all tests still pass: * rb_undef_methods_from doesn't automatically handle classes with origins, so pass it the origin for Comparable when undefing methods in Complex. This fixed a failure in the Complex tests. * When adding a method, the method cache was not cleared correctly if klass has an origin. Clear the method cache for the klass before switching to the origin of klass. This fixed failures in the autoload tests related to overridding require, without breaking the optimization tests. Also clear the method cache for both the module and origin when removing a method. * Module#include? is fixed to skip origin iclasses. * Refinements are fixed to use the origin class of the module that has an origin. * RCLASS_REFINED_BY_ANY is removed as it was only used in a single place and is no longer needed. * Marshal#dump is fixed to skip iclass origins. * rb_method_entry_make is fixed to handled overridden optimized methods for modules that have origins. Fixes [Bug #16852]
* Fixed `defined?` against protected method callNobuyoshi Nakada2020-06-021-0/+1
| | | | | | Protected methods are restricted to be called according to the class/module in where it is defined, not the actual receiver's class. [Bug #16931]
* Split test_defined_methodNobuyoshi Nakada2020-06-021-1/+22
|
* test/ruby/test_process.rb: GID.from_name may raise Errno:ESRCHYusuke Endoh2020-05-301-3/+9
| | | | | | | | | | | | | getgrnam(3) says: ``` ERRORS 0 or ENOENT or ESRCH or EBADF or EPERM or ... The given name or gid was not found. ``` Process::GID.from_name raises an ArgumentError for 0, but Errno::ESRCH for ESRCH. Actually, WSL 2 raises Errno::ESRCH. This change accepts all exceptions above.
* Correctly remove temporary directory if path yielded is mutatedJeremy Evans2020-05-291-0/+11
| | | | | | | Another approach would be to freeze the string, but that could cause backwards compatibility issues. Fixes [Bug #16918]
* Explicitly loading with envutil.rbHiroshi SHIBATA2020-05-282-0/+2
|
* test/drb/test_drbssl.rb: skip LeakChecker as openssl keeps /dev/randomYusuke Endoh2020-05-271-0/+1
| | | | | | | | | | | | | | | | and /dev/urandom intentionally. OpenSSL::PKey::RSA.new opens the two random generators and keeps the file descriptors. https://github.com/openssl/openssl/blob/93f99b681ab5a1cf7062053323e09b0cad5ff854/crypto/rand/rand_unix.c#L674 They are detected by the LeakChecker as fd leak, but it is intentional. http://rubyci.s3.amazonaws.com/graviton2/ruby-master/log/20200526T160005Z.log.html.gz ``` [ 597/20199] DRbTests::TestDRbSSLAry#test_01 = 0.29 s Leaked file descriptor: DRbTests::TestDRbSSLAry#test_01: 8 #<File::Stat dev=0x6, ino=11, mode=020666, nlink=1, uid=0, gid=0, rdev=0x109, size=0, blksize=4096, blocks=0, atime=2020-05-23 14:45:13.751999995 +0000, mtime=2020-05-23 14:45:13.751999995 +0000, ctime=2020-05-23 14:45:13.751999995 +0000> Leaked file descriptor: DRbTests::TestDRbSSLAry#test_01: 9 #<File::Stat dev=0x6, ino=10, mode=020666, nlink=1, uid=0, gid=0, rdev=0x108, size=0, blksize=4096, blocks=0, atime=2020-05-23 14:45:13.755999995 +0000, mtime=2020-05-23 14:45:13.755999995 +0000, ctime=2020-05-23 14:45:13.755999995 +0000> ```