diff options
author | Stan Lo <[email protected]> | 2025-07-15 23:03:40 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2025-07-15 15:03:40 -0700 |
commit | 5723945335e61efb1c6b23111b2a0f00fcec3111 (patch) | |
tree | 506d26f497fcd768d352385b04c049832b20a2bb | |
parent | 3cf32e936416e6c4aa272e63a9ac626c55087891 (diff) |
ZJIT: Start testing against `/test/ruby/` and update all ZJIT related testing targets/docs (#13791)HEADmaster
* ZJIT: Add test exclusions for ZJIT
* ZJIT: Update test targets and documentation
- Rename `zjit-test-all` to `zjit-check`
- Add `zjit-test-all` target to zjit.mk to run all Ruby tests with ZJIT enabled
excluding known failing tests
- Update documentation and CI workflow to reflect the new targets
30 files changed, 104 insertions, 8 deletions
diff --git a/.github/workflows/zjit-macos.yml b/.github/workflows/zjit-macos.yml index 7a36b296f1..8e5ca954cb 100644 --- a/.github/workflows/zjit-macos.yml +++ b/.github/workflows/zjit-macos.yml @@ -38,9 +38,8 @@ jobs: - test_task: 'ruby' # build test for combo build configure: '--enable-yjit --enable-zjit' - - test_task: 'test-all' + - test_task: 'zjit-test-all' configure: '--enable-zjit=dev' - tests: '../src/test/ruby/test_zjit.rb' - test_task: 'btest' configure: '--enable-zjit=dev' diff --git a/.github/workflows/zjit-ubuntu.yml b/.github/workflows/zjit-ubuntu.yml index 91aa436b58..ecfd0ddede 100644 --- a/.github/workflows/zjit-ubuntu.yml +++ b/.github/workflows/zjit-ubuntu.yml @@ -40,9 +40,8 @@ jobs: - test_task: 'zjit-test' configure: '--enable-yjit --enable-zjit=dev' - - test_task: 'test-all' + - test_task: 'zjit-test-all' configure: '--enable-zjit=dev' - tests: '../src/test/ruby/test_zjit.rb' - test_task: 'btest' configure: '--enable-zjit=dev' diff --git a/doc/zjit.md b/doc/zjit.md index f337487af8..90f890bfa0 100644 --- a/doc/zjit.md +++ b/doc/zjit.md @@ -28,12 +28,12 @@ in a way that can be easily shared with other team members. Make sure you have a `--enable-zjit=dev` build, and run `brew install cargo-nextest` first. -### make zjit-test-all +### make zjit-check This command runs all ZJIT tests: `make zjit-test` and `test/ruby/test_zjit.rb`. ``` -make zjit-test-all +make zjit-check ``` ### make zjit-test @@ -78,6 +78,16 @@ use `make`. </details> +### make zjit-test-all + +``` +make zjit-test-all +``` + +This command runs all Ruby tests under `/test/ruby/` with ZJIT enabled. + +Certain tests are excluded under `/test/.excludes-zjit`. + ### test/ruby/test\_zjit.rb This command runs Ruby execution tests. diff --git a/test/.excludes-zjit/TestArgf.rb b/test/.excludes-zjit/TestArgf.rb new file mode 100644 index 0000000000..07f305da5c --- /dev/null +++ b/test/.excludes-zjit/TestArgf.rb @@ -0,0 +1 @@ +exclude(:test_skip_in_each_byte, 'Test fails with ZJIT') diff --git a/test/.excludes-zjit/TestArray.rb b/test/.excludes-zjit/TestArray.rb new file mode 100644 index 0000000000..b2ca8c67f7 --- /dev/null +++ b/test/.excludes-zjit/TestArray.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests make ZJIT panic') diff --git a/test/.excludes-zjit/TestBignum.rb b/test/.excludes-zjit/TestBignum.rb new file mode 100644 index 0000000000..66b0cc0c1b --- /dev/null +++ b/test/.excludes-zjit/TestBignum.rb @@ -0,0 +1 @@ +exclude(:test_quad_pack, 'Test fails with ZJIT') diff --git a/test/.excludes-zjit/TestEncoding.rb b/test/.excludes-zjit/TestEncoding.rb new file mode 100644 index 0000000000..2bb8e8df99 --- /dev/null +++ b/test/.excludes-zjit/TestEncoding.rb @@ -0,0 +1 @@ +exclude(/test_ractor/, "Tests make ZJIT panic") diff --git a/test/.excludes-zjit/TestEnumerator.rb b/test/.excludes-zjit/TestEnumerator.rb new file mode 100644 index 0000000000..2089cc15bb --- /dev/null +++ b/test/.excludes-zjit/TestEnumerator.rb @@ -0,0 +1 @@ +exclude(:test_size_for_loops, 'Test crashes on Ubuntu with ZJIT') diff --git a/test/.excludes-zjit/TestEnv.rb b/test/.excludes-zjit/TestEnv.rb new file mode 100644 index 0000000000..f52bdf6d30 --- /dev/null +++ b/test/.excludes-zjit/TestEnv.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Multiple tests make ZJIT panic') diff --git a/test/.excludes-zjit/TestFixnum.rb b/test/.excludes-zjit/TestFixnum.rb new file mode 100644 index 0000000000..b2ca8c67f7 --- /dev/null +++ b/test/.excludes-zjit/TestFixnum.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests make ZJIT panic') diff --git a/test/.excludes-zjit/TestInteger.rb b/test/.excludes-zjit/TestInteger.rb new file mode 100644 index 0000000000..a75fd5f1ea --- /dev/null +++ b/test/.excludes-zjit/TestInteger.rb @@ -0,0 +1 @@ +exclude(:test_ceildiv, 'Test crashes on Ubuntu with ZJIT') diff --git a/test/.excludes-zjit/TestIntegerComb.rb b/test/.excludes-zjit/TestIntegerComb.rb new file mode 100644 index 0000000000..4ab5ade4c4 --- /dev/null +++ b/test/.excludes-zjit/TestIntegerComb.rb @@ -0,0 +1,2 @@ +exclude(:test_pack_utf8, 'Test crashes with ZJIT') +exclude(:test_pack_ber, 'Test fails with ZJIT') diff --git a/test/.excludes-zjit/TestKeywordArguments.rb b/test/.excludes-zjit/TestKeywordArguments.rb new file mode 100644 index 0000000000..f52bdf6d30 --- /dev/null +++ b/test/.excludes-zjit/TestKeywordArguments.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Multiple tests make ZJIT panic') diff --git a/test/.excludes-zjit/TestMemoryView.rb b/test/.excludes-zjit/TestMemoryView.rb new file mode 100644 index 0000000000..dfc9b110e2 --- /dev/null +++ b/test/.excludes-zjit/TestMemoryView.rb @@ -0,0 +1,8 @@ +exclude(:test_rb_memory_view_get_item_pointer_multiple_members, 'Test crashes with ZJIT') +exclude(:test_rb_memory_view_extract_item_members_doble, 'Test crashes with ZJIT') +exclude(:test_rb_memory_view_extract_item_members_float_endianness, 'Test crashes with ZJIT') +exclude(:test_rb_memory_view_get_item_pointer_single_member, 'Test crashes with ZJIT') +exclude(:test_rb_memory_view_extract_item_members_doble_endianness, 'Test crashes with ZJIT') + +exclude(:test_rb_memory_view_extract_item_members_endianness, 'Test fails with ZJIT') +exclude(:test_rb_memory_view_extract_item_members, 'Test fails with ZJIT') diff --git a/test/.excludes-zjit/TestPack.rb b/test/.excludes-zjit/TestPack.rb new file mode 100644 index 0000000000..d505b1c232 --- /dev/null +++ b/test/.excludes-zjit/TestPack.rb @@ -0,0 +1,32 @@ +exclude(:test_ascii_incompatible, 'Test crashes with ZJIT') +exclude(:test_pack_U, 'Test crashes with ZJIT') +exclude(:test_unpack_garbage, 'Test crashes with ZJIT') +exclude(:test_pack_garbage, 'Test crashes with ZJIT') +exclude(:test_pack, 'Test crashes with ZJIT') + +exclude(:test_pack_unpack_lL, 'Test fails with ZJIT') +exclude(:test_pack_unpack_x, 'Test fails with ZJIT') +exclude(:test_unpack_n, 'Test fails with ZJIT') +exclude(:test_pack_N, 'Test fails with ZJIT') +exclude(:test_integer_endian, 'Test fails with ZJIT') +exclude(:test_pack_unpack_m0, 'Test fails with ZJIT') +exclude(:test_pack_p2, 'Test fails with ZJIT') +exclude(:test_pack_unpack_X, 'Test fails with ZJIT') +exclude(:test_pack_unpack_nN, 'Test fails with ZJIT') +exclude(:test_unpack1, 'Test fails with ZJIT') +exclude(:test_pack_n, 'Test fails with ZJIT') +exclude(:test_pack_unpack_percent, 'Test fails with ZJIT') +exclude(:test_unpack_N, 'Test fails with ZJIT') +exclude(:test_pack_unpack_cC, 'Test fails with ZJIT') +exclude(:test_pack_unpack_vV, 'Test fails with ZJIT') +exclude(:test_format_string_modified, 'Test fails with ZJIT') +exclude(:test_pack_unpack_atmark, 'Test fails with ZJIT') +exclude(:test_pack_unpack_iI, 'Test fails with ZJIT') +exclude(:test_illegal_bang, 'Test fails with ZJIT') +exclude(:test_pack_unpack_U, 'Test fails with ZJIT') +exclude(:test_pack_unpack_fdeEgG, 'Test fails with ZJIT') +exclude(:test_invalid_warning, 'Test fails with ZJIT') +exclude(:test_short_string, 'Test fails with ZJIT') +exclude(:test_pack_unpack_sS, 'Test fails with ZJIT') +exclude(:test_comment, 'Test fails with ZJIT') +exclude(:test_pack_unpack_w, 'Test fails with ZJIT') diff --git a/test/.excludes-zjit/TestParse.rb b/test/.excludes-zjit/TestParse.rb new file mode 100644 index 0000000000..e5d3b09447 --- /dev/null +++ b/test/.excludes-zjit/TestParse.rb @@ -0,0 +1,2 @@ +exclude(:test_flip_flop, 'Test fails with ZJIT') +exclude(:test_rescue_in_command_assignment, 'Test fails with ZJIT') diff --git a/test/.excludes-zjit/TestProc.rb b/test/.excludes-zjit/TestProc.rb new file mode 100644 index 0000000000..2667c3aa0b --- /dev/null +++ b/test/.excludes-zjit/TestProc.rb @@ -0,0 +1,6 @@ +exclude(/test_/, 'Tests make ZJIT panic') + +# exclude(:test_proc_args_pos_rest_block, 'Test crashes with ZJIT') +# exclude(:test_proc_args_rest_post_block, 'Test crashes with ZJIT') + +# exclude(:test_binding_receiver, 'Test fails with ZJIT') diff --git a/test/.excludes-zjit/TestRactor.rb b/test/.excludes-zjit/TestRactor.rb new file mode 100644 index 0000000000..b2ca8c67f7 --- /dev/null +++ b/test/.excludes-zjit/TestRactor.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests make ZJIT panic') diff --git a/test/.excludes-zjit/TestRefinement.rb b/test/.excludes-zjit/TestRefinement.rb new file mode 100644 index 0000000000..39e504c9a2 --- /dev/null +++ b/test/.excludes-zjit/TestRefinement.rb @@ -0,0 +1 @@ +exclude(:test_override_builtin_method_with_method_added, 'Test fails with ZJIT') diff --git a/test/.excludes-zjit/TestRegexp.rb b/test/.excludes-zjit/TestRegexp.rb new file mode 100644 index 0000000000..3b396b1ca7 --- /dev/null +++ b/test/.excludes-zjit/TestRegexp.rb @@ -0,0 +1,4 @@ +exclude(:test_inspect, 'Test fails with ZJIT') +exclude(:test_quote, 'Test fails with ZJIT') +exclude(:test_union, 'Test fails with ZJIT') +exclude(:test_unescape, 'Test fails with ZJIT') diff --git a/test/.excludes-zjit/TestRubyOptions.rb b/test/.excludes-zjit/TestRubyOptions.rb new file mode 100644 index 0000000000..966d0b7551 --- /dev/null +++ b/test/.excludes-zjit/TestRubyOptions.rb @@ -0,0 +1,10 @@ +exclude(:test_verbose, 'Test crashes with ZJIT') +exclude(:test_segv_setproctitle, 'Test crashes with ZJIT') +exclude(:test_crash_report, 'Test crashes with ZJIT') +exclude(:test_segv_loaded_features, 'Test crashes with ZJIT') +exclude(:test_crash_report_executable_path, 'Test crashes with ZJIT') +exclude(:test_segv_test, 'Test crashes with ZJIT') +exclude(:test_crash_report_script, 'Test crashes with ZJIT') +exclude(:test_crash_report_script_path, 'Test crashes with ZJIT') + +exclude(:test_version, 'Test fails with ZJIT') diff --git a/test/.excludes-zjit/TestSetTraceFunc.rb b/test/.excludes-zjit/TestSetTraceFunc.rb new file mode 100644 index 0000000000..01b1acbb61 --- /dev/null +++ b/test/.excludes-zjit/TestSetTraceFunc.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Test fails with ZJIT intermittently') diff --git a/test/.excludes-zjit/TestSprintfComb.rb b/test/.excludes-zjit/TestSprintfComb.rb new file mode 100644 index 0000000000..321633f686 --- /dev/null +++ b/test/.excludes-zjit/TestSprintfComb.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Test fails with ZJIT') diff --git a/test/.excludes-zjit/TestString.rb b/test/.excludes-zjit/TestString.rb new file mode 100644 index 0000000000..5d0f95e938 --- /dev/null +++ b/test/.excludes-zjit/TestString.rb @@ -0,0 +1 @@ +exclude(:test_to_f, 'Test crashes with ZJIT') diff --git a/test/.excludes-zjit/TestString2.rb b/test/.excludes-zjit/TestString2.rb new file mode 100644 index 0000000000..5d0f95e938 --- /dev/null +++ b/test/.excludes-zjit/TestString2.rb @@ -0,0 +1 @@ +exclude(:test_to_f, 'Test crashes with ZJIT') diff --git a/test/.excludes-zjit/TestThread.rb b/test/.excludes-zjit/TestThread.rb new file mode 100644 index 0000000000..1eb9c50dba --- /dev/null +++ b/test/.excludes-zjit/TestThread.rb @@ -0,0 +1,2 @@ +exclude(:test_switch_while_busy_loop, 'Test hangs with ZJIT') +exclude(:test_handle_interrupted?, 'Test fails with ZJIT') diff --git a/test/.excludes-zjit/TestTime.rb b/test/.excludes-zjit/TestTime.rb new file mode 100644 index 0000000000..b2ca8c67f7 --- /dev/null +++ b/test/.excludes-zjit/TestTime.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests make ZJIT panic') diff --git a/test/.excludes-zjit/TestTimeTZ.rb b/test/.excludes-zjit/TestTimeTZ.rb new file mode 100644 index 0000000000..b2ca8c67f7 --- /dev/null +++ b/test/.excludes-zjit/TestTimeTZ.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests make ZJIT panic') diff --git a/test/.excludes-zjit/TestVariable.rb b/test/.excludes-zjit/TestVariable.rb new file mode 100644 index 0000000000..b2ca8c67f7 --- /dev/null +++ b/test/.excludes-zjit/TestVariable.rb @@ -0,0 +1 @@ +exclude(/test_/, 'Tests make ZJIT panic') diff --git a/zjit/zjit.mk b/zjit/zjit.mk index 9107c15809..02f1b2b50d 100644 --- a/zjit/zjit.mk +++ b/zjit/zjit.mk @@ -49,11 +49,15 @@ update-zjit-bench: https://github.com/Shopify/zjit-bench zjit-bench $(GIT_OPTS) # Gives quick feedback about ZJIT. Not a replacement for a full test run. -.PHONY: zjit-test-all -zjit-test-all: +.PHONY: zjit-check +zjit-check: $(MAKE) zjit-test $(MAKE) test-all TESTS='$(top_srcdir)/test/ruby/test_zjit.rb' +.PHONY: zjit-test-all +zjit-test-all: + $(MAKE) test-all RUST_BACKTRACE=1 TEST_EXCLUDES='--excludes-dir=$(top_srcdir)/test/.excludes-zjit --name=!/memory_leak/' RUN_OPTS='--zjit-call-threshold=1' TESTS='$(top_srcdir)/test/ruby/' + ZJIT_BINDGEN_DIFF_OPTS = # Generate Rust bindings. See source for details. |