summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2025-09-17ZJIT: Const-fold IsMethodCfuncMax Bernstein
2025-09-17Unset RUBY_CRASH_REPORT in tests that crash on purposeAlan Wu
2025-09-17[ruby/prism] Reject `1 if foo = bar baz`Earlopain
and also `1 and foo = bar baz` This is a partial fix for https://github.com/ruby/prism/issues/3106 It still accepts `a = b c and 1` https://github.com/ruby/prism/commit/7a13d3535b
2025-09-17Skip TestObjSpaceRactor#test_tracing_does_not_crashPeter Zhu
It crashes frequently on CI but I am not able to reproduce locally: https://ci.rvm.jp/results/trunk-random1@ruby-sp2-noble-docker/5954509 https://ci.rvm.jp/results/trunk-random0@ruby-sp2-noble-docker/5954501
2025-09-17[ruby/openssl] Fix test_ssl.rb in FIPS.Jun Aruga
test_post_connect_check_with_anon_ciphers: test_tmp_dh_callback: test_tmp_dh: DH missing the q value on unknown named parameters (ciphers) is not FIPS-approved, according to the FIPS-186-4 APPENDIX B: Key Pair Generation - B.1.1 Key Pair Generation Using Extra Random Bits, the inputs p, q, and g are required. However, TLS doesn't send q. https://csrc.nist.gov/pubs/fips/186-4/final OpenSSL has a special workaround to recover the missing "q" value for known named parameters, which is the reason why other tests that use the default parameters in `lib/openssl/ssl.rb` are working. Note that the test_post_connect_check_with_anon_ciphers test got the following error on `OpenSSL.debug = true` in FIPS. ``` /home/jaruga/var/git/ruby/openssl/lib/openssl/ssl.rb:551: warning: error on stack: error:0A0C0103:SSL routines:tls_construct_server_key_exchange:internal error ``` test_get_ephemeral_key: kRSA (PKCS1-v1_5 padding) is not allowed in FIPS according to the NIST SP 800-131A Rev. 2 - 6 Key Agreement and Key Transport Using RSA - Table 5: Approval Status for the RSA-based Key Agreement and Key Transport Schemes - PKCS1-v1_5 padding - Disallowed after 2023 https://csrc.nist.gov/pubs/sp/800/131/a/r2/final Note that the test_get_ephemeral_key test got the following error on `OpenSSL.debug = true` in FIPS. ``` test/openssl/test_ssl.rb:2326: warning: error on stack: error:1C8000A8:Provider routines:rsa_encrypt:invalid padding mode ``` https://github.com/ruby/openssl/commit/ac3559e51e
2025-09-17[ruby/openssl] Add AuthTagError exception for AEAD authenticationSamuel Williams
failures (https://github.com/ruby/openssl/pull/939) * Add AuthTagError exception for AEAD authentication failures - Add OpenSSL::Cipher::AuthTagError as a subclass of CipherError - Raise AuthTagError specifically for AEAD cipher authentication tag verification failures - Enhanced error messages: 'AEAD authentication tag verification failed' for auth failures - Precise detection: Only EVP_CipherFinal_ex failures in AEAD ciphers raise AuthTagError - All other errors (key setup, IV setup, update failures, etc.) still raise CipherError - Comprehensive test coverage for GCM/CCM modes and error inheritance - Fully backwards compatible: AuthTagError < CipherError https://github.com/ruby/openssl/commit/9663b09040
2025-09-17[ruby/openssl] Revert "pkey: stop retrying after non-retryable error from ↵Kazuki Yamaguchi
OSSL_DECODER" This reverts commit https://github.com/ruby/openssl/commit/5347880c6eb0 and https://github.com/ruby/openssl/commit/985ba27d6339. These commits attempted to stop processing after the first relevant PEM block, whether it is successful or not, when the input contains multiple keys. It turned out that it cannot be reliably determined using the OSSL_DECODER API. There is an edge case where OSSL_DECODER_from_bio() reports "unsupported" even though the input actually contains an error: https://redirect.github.com/ruby/openssl/pull/931#discussion_r2347813807 Revert the changes for now and keep the existing behavior, as partial support does not seem worth the added complexity. https://github.com/ruby/openssl/commit/319cd4952a
2025-09-17Revert "Handle `uninitialized constant JSON::GenericObject` at ruby/ruby."Hiroshi SHIBATA
This reverts commit 0dc1cd407e7775610f2bcaef6c1282369867f91c. 1213adfe5526d65cce81a9fb127074130c8faea7 is fixed this issue.
2025-09-16[ruby/json] Better handle missing ostructÉtienne Barrié
In the Ruby test suite, this test class is causing trouble because ostruct is not available. Having an autoload for JSON::GenericObject but causing it not to define the constant causes a warning. See https://github.com/ruby/json/commit/0dc1cd407e77 and https://github.com/ruby/json/commit/caa5d8cdd748 in ruby. We can skip defining the test class entirely instead when ostruct is not available. https://github.com/ruby/json/commit/6f6a4cdfd7
2025-09-15ZJIT: Revert VM_CALL_ARGS_SPLAT and VM_CALL_KWARG support (#14565)Takashi Kokubun
2025-09-15ZJIT: Support compiling block args (#14537)Takashi Kokubun
2025-09-15[ruby/prism] Fix character literal forced encodingKevin Newton
If a character literal was followed by a string concatenation, then the forced encoding of the string concatenation could accidentally overwrite the explicit encoding of the character literal. We now handle this properly. https://github.com/ruby/prism/commit/125c375d74
2025-09-15Share `TestObject::ToStrCounter` classNobuyoshi Nakada
2025-09-13[ruby/prism] Revert "Merge pull request #3606 from tenderlove/clear-flags"Takashi Kokubun
This reverts commit https://github.com/ruby/prism/commit/4052d93cf852, reversing changes made to https://github.com/ruby/prism/commit/47143d17b3f7. https://github.com/ruby/prism/commit/f117ec6354
2025-09-13Fill in lead num for blocks with `it`Kevin Newton
Fixes [Bug #21256] Co-Authored-By: Earlopain <14981592+Earlopain@users.noreply.github.com>
2025-09-13Exclude `JSON::GenericObject` testNobuyoshi Nakada
It depends on ostruct gem that is no longer a part of the default gems, and the all tests are just skipped with a warning.
2025-09-13Remove excludesNobuyoshi Nakada
2025-09-13[Feature #20925] Support leading logical operatorsNobuyoshi Nakada
2025-09-13[Bug #17398] Allow `private def hello = puts "Hello"`yui-knk
2025-09-12Exclude leading logical tests for parseyStan Lo
Prism implemented https://bugs.ruby-lang.org/issues/20925 but parse.y doesn't seem to support it yet and is failing related Prism tests on CI. This adds excludes for the tests that are failing.
2025-09-12Update test syntax to handle command call endless methodsKevin Newton
2025-09-12[ruby/prism] [Bug #17398] Allow `private def hello = puts "Hello"`Earlopain
This was a limitation of parse.y that prism intentionally replicated. https://github.com/ruby/prism/commit/8fd12d594c
2025-09-12[ruby/prism] Support leading logical operatorsKevin Newton
https://github.com/ruby/prism/commit/3f58fa7705
2025-09-12Restore test example for argument forwardingÉtienne Barrié
Since cb419e3912f0514b8151469b0a4a4b83cbbcce78 we're no longer testing this case because foo is redefined on obj1.
2025-09-12[ruby/openssl] pkey: stop retrying after non-retryable error from OSSL_DECODERKazuki Yamaguchi
Continue processing only when OSSL_DECODER_from_bio() returns the error code ERR_R_UNSUPPORTED. Otherwise, raise an exception without retrying decoding the input in another format. This fixes another case where OpenSSL::PKey.read prompts for a passphrase multiple times when the input contains multiple passphrase-protected PEM blocks and the first one cannot be decoded. I am not entirely sure if the error code ERR_R_UNSUPPORTED is considered part of the public interface of OpenSSL, but this seems to be the only option available and is the approach used internally by the PEM_read_bio_*() functions. Fixes https://github.com/ruby/openssl/issues/927 https://github.com/ruby/openssl/commit/985ba27d63
2025-09-12[ruby/openssl] pkey: pass pem_password_cb to OSSL_DECODER only when it is neededKazuki Yamaguchi
Specify OSSL_DECODER_CTX_set_pem_password_cb() only when we expect a passphrase-protected private key. OSSL_DECODER appears to try to decrypt every PEM block in the input even when the PEM header does not match the requested selection. This can cause repeated prompts for a passphrase in a single OpenSSL::PKey.read call. https://github.com/ruby/openssl/commit/933503f49f
2025-09-12[ruby/openssl] pkey: add more tests for OpenSSL::PKey.readKazuki Yamaguchi
Add tests covering edge cases in the current behavior to prevent accidental regressions. The next patches will update the OpenSSL 3.x path. https://github.com/ruby/openssl/commit/468f8ceea2
2025-09-12Remove unused variable warningÉtienne Barrié
2025-09-12Suppress warnings when testing RubyVM::AbstractSyntaxTreeÉtienne Barrié
2025-09-12Remove block may be ignored warnings from ↵Étienne Barrié
TestRubyOptimization#test_block_given_aset_aref
2025-09-12Remove redefined method warnings from TestRubyOptimization#test_opt_newÉtienne Barrié
2025-09-12[ruby/json] Enable coverage before loading simplecovJean Boussier
Fix: https://github.com/ruby/json/pull/853 Simplecov end up requiring json so we need to start collecting coverage before. https://github.com/ruby/json/commit/ca72019fd3
2025-09-11ZJIT: Check for VM stack overflowAlan Wu
Previously, the included test crashed or turned into an infinite loop due to the missing check.
2025-09-11[ruby/prism] Reject some cases with `return` and command callsEarlopain
The same also applies to `break`/`next`. https://bugs.ruby-lang.org/issues/21540 https://github.com/ruby/prism/commit/3a38b192e3
2025-09-11Handle `uninitialized constant JSON::GenericObject` at ruby/ruby.Hiroshi SHIBATA
``` 1) Error: JSONGenericObjectTest#test_from_hash: Test::Unit::ProxyError: uninitialized constant JSON::GenericObject /Users/hsbt/Documents/github.com/ruby/ruby/.ext/common/json/common.rb:1006:in 'JSON.const_missing' /Users/hsbt/Documents/github.com/ruby/ruby/test/json/json_generic_object_test.rb:8:in 'JSONGenericObjectTest#setup' ```
2025-09-11Revert "test_gem_command_manager.rb.Hiroshi SHIBATA
This reverts commit 8aa885c460aeb70878538eebdd155c6318989fd2 and cd07c3cbae7e287350d713ead237aeef27cc2b9e.
2025-09-11[ruby/json] Improve test coverageÉtienne Barrié
Test SubArrayWrapper#[] and SubOpenStruct#[] https://github.com/ruby/json/commit/bae760aa19 Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2025-09-11[ruby/json] Stop checking for String#@-Étienne Barrié
https://github.com/ruby/json/commit/a9e05d6ff3 Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2025-09-11[ruby/json] Change invalid encoding test to use assert_raiseÉtienne Barrié
https://github.com/ruby/json/commit/efc61682ee Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2025-09-11[ruby/json] Fix deprecation warning backtraceÉtienne Barrié
The gem root was including the test/ directory, so lines from tests were skipped, and the deprecation warnings were shown as coming from the test framework. https://github.com/ruby/json/commit/2ec31a7363 Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2025-09-11[ruby/json] Fix JSON::GenericObject testsÉtienne Barrié
https://github.com/ruby/json/commit/7a2a24d663 Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2025-09-11[ruby/json] Enable test coverage when simplecov is availableÉtienne Barrié
https://github.com/ruby/json/commit/f37e73cf44 Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2025-09-10Fix tempfile leaking in TestRequirePeter Zhu
The test introduced in 928fea3 is leaking files because the Tempfile is not cleaned when the process exits. We see this in the output: Children under /var/folders/51/_yzlsvf96v9729jtj8_mcp7w0000gn/T/rubytest.7lbdlp: * -rw------- 1 0 2025-09-10 10:09:51 -0400 test20250910-13775-g4op87.rb * -rw------- 1 0 2025-09-10 10:09:51 -0400 test20250910-13775-pu621v.rb * -rw------- 1 0 2025-09-10 10:09:51 -0400 test20250910-13775-4xv688.rb * -rw------- 1 0 2025-09-10 10:09:51 -0400 test20250910-13775-1rvp4b.rb
2025-09-10ZJIT: Support `invokeblock` insn (#14496)Stan Lo
ZJIT: Support invokeblock insn Basically like other send-ish insns, except that it doesn't pop the receiver.
2025-09-10ZJIT: Compile ISEQs with forwardable parameters (#14491)Takashi Kokubun
2025-09-10Fix crash when $LOADED_FEATURES is modified during requirePeter Zhu
[Bug #21567] When we require an object that is not a string, it will attempt to convert it to a string by calling to_str on it. If we modify the $LOADED_FEATURES array while it calls to_str, Ruby can crash because it can end up inserting the string in the wrong index in the array. For example, the following script crashes: require "tempfile" class MyString def initialize(path) @path = path end def to_str $LOADED_FEATURES.clear @path end def to_path = @path end def create_ruby_file = Tempfile.create(["test", ".rb"]).path require MyString.new(create_ruby_file) $LOADED_FEATURES.unshift(create_ruby_file) $LOADED_FEATURES << MyString.new(create_ruby_file) require create_ruby_file Crash log: test.rb:21: [BUG] Segmentation fault at 0x0000000000000004 ruby 3.5.0dev (2025-09-09T09:29:35Z master ce94add7fb) +PRISM [arm64-darwin24] -- Crash Report log information -------------------------------------------- See Crash Report log file in one of the following locations: * ~/Library/Logs/DiagnosticReports * /Library/Logs/DiagnosticReports for more details. Don't forget to include the above Crash Report log file in bug reports. -- Control frame information ----------------------------------------------- c:0003 p:---- s:0011 e:000010 CFUNC :require c:0002 p:0076 s:0006 e:000005 EVAL test.rb:21 [FINISH] c:0001 p:0000 s:0003 E:0001b0 DUMMY [FINISH] -- Ruby level backtrace information ---------------------------------------- test.rb:21:in '<main>' test.rb:21:in 'require' -- Threading information --------------------------------------------------- Total ractor count: 1 Ruby thread count for this ractor: 1 -- Machine register context ------------------------------------------------ x0: 0x0000000000000004 x1: 0x000000000000c800 x2: 0x0000000000000000 x3: 0x0000000000000000 x4: 0x0000000000000205 x5: 0x0000000000000000 x6: 0x0000000000000000 x7: 0x0000000000000001 x18: 0x0000000000000000 x19: 0x0000000209dfc0b0 x20: 0x0000000209dfc018 x21: 0x000000016ee8ab58 x22: 0x0fffffff0009d71d x23: 0x0000000209dfc018 x24: 0x0000000209dfc150 x25: 0x000000016ee8acc0 x26: 0x0000000000000000 x27: 0x0000000000000000 x28: 0x0000000000000000 lr: 0x0000000101244140 fp: 0x000000016ee887f0 sp: 0x000000016ee887d0 -- C level backtrace information ------------------------------------------- miniruby(rb_print_backtrace+0x24) [0x101317b08] vm_dump.c:843 miniruby(rb_print_backtrace) (null):0 miniruby(rb_vm_bugreport+0x26c) [0x101317d94] vm_dump.c:1175 miniruby(rb_bug_for_fatal_signal+0xa4) [0x10105ddac] error.c:1130 miniruby(sig_do_nothing+0x0) [0x1012278c0] signal.c:948 miniruby(sigsegv) (null):0 /usr/lib/system/libsystem_platform.dylib(_sigtramp+0x38) [0x19c1216a4] miniruby(rb_str_new_frozen+0x1c) [0x101244140] string.c:1495 miniruby(rb_check_realpath_internal+0x68) [0x101077804] file.c:4679 miniruby(rb_check_realpath+0x2c) [0x101077aa4] file.c:4765 miniruby(get_loaded_features_index+0x37c) [0x1010f9c94] load.c:467 miniruby(rb_feature_p+0xd0) [0x1010f8174] load.c:582 miniruby(search_required+0xac) [0x1010f6ad4] load.c:1193 miniruby(require_internal+0x274) [0x1010f7518] load.c:1424 miniruby(rb_require_string_internal+0x94) [0x1010f6830] load.c:1571 miniruby(rb_require_string+0x58) [0x1010f66e8] load.c:1557 miniruby(rb_f_require+0x1c) [0x1010f6684] load.c:1150 miniruby(ractor_safe_call_cfunc_1+0x38) [0x101306c28] vm_insnhelper.c:3696 miniruby(vm_call_cfunc_with_frame_+0x250) [0x1012f857c] vm_insnhelper.c:3873 miniruby(vm_call_cfunc_with_frame+0x6c) [0x1012f8834] vm_insnhelper.c:3919 miniruby(vm_sendish+0x1a8) [0x1012c990c] vm_insnhelper.c:6087 miniruby(vm_exec_core+0x4050) [0x1012cfb48] insns.def:900 miniruby(vm_exec_loop+0x80) [0x1012e5448] vm.c:2666 miniruby(rb_vm_exec+0x134) [0x1012c9b40] vm.c:2645 miniruby(rb_iseq_eval_main+0x34) [0x1012e5628] vm.c:2919 miniruby(rb_ec_exec_node+0xe4) [0x10106d094] eval.c:282 miniruby(ruby_run_node+0x94) [0x10106cf64] eval.c:320 miniruby(rb_main+0x40) [0x100f7499c] main.c:42 miniruby(main+0x60) [0x100f74928] main.c:62
2025-09-09ZJIT: Remove unneeded omission for optional param test (#14488)Stan Lo
2025-09-09ZJIT: Implement getblockparamproxy (#14483)Takashi Kokubun
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
2025-09-09ZJIT: Optimize `ObjToString` with type guards (#14469)André Luiz Tiago Soares
* failing test for ObjToString optimization with GuardType * profile ObjToString receiver and rewrite with guard * adjust integration tests for objtostring type guard optimization * Implement new GuardTypeNot HIR; objtostring sends to_s directly on profiled nonstrings * codegen for GuardTypeNot * typo fixes * better name for tests; fix side exit reason for GuardTypeNot * revert accidental change * make bindgen * Fix is_string to identify subclasses of String; fix codegen for identifying if val is String
2025-09-08ZJIT: Add RubyVM::ZJIT.reset_stats! method (GH-14479)Randy Stauner
This allows for more precise tracking of stats programmatically which is particularly useful for our nightly benchmarking suite. - Define rust function - Expose to C - Wrap with Ruby API - Add a test