Граф коммитов

417 Коммитов

Автор SHA1 Сообщение Дата
Peter Zhu 150ed44d87 Fix compaction during ary_make_partial
The ary_make_shared call may allocate, which can trigger a GC
compaction. This can cause the array to be embedded because it has a
length of 0.
2023-11-27 12:40:26 -05:00
Kevin Newton 323bec6295 RubyVM::InstructionSequence.compile_file_prism
* Provide a new API compile_file_prism which mirrors compile_file
but uses prism to parse/compile.
* Provide the ability to run test-all with RUBY_ISEQ_DUMP_DEBUG set
to "prism". If it is, we'll use the new compile_file_prism API to
load iseqs during the test run.
2023-11-20 12:45:29 -08:00
Yusuke Endoh 5bf75c20a2 Refactor the settings of test-all out
test/runner.rb and tool/lib/test/unit/parallel.rb must use the same
settings. However, some settings were copied and pasted, while some were
added only to test/runner.rb.
This changeset creates tool/test/init.rb for all settings of test-unit,
which is loaded not only by test/runner.rb but also
tool/lib/test/unit/parallel.rb.

Background: the GEM_HOME environment variable was removed in
test/runner.rb, which prohibit `require "rake"` (note that rake is a
bundled gem). However the parallel mode didn't refrect this setting,
i.e., `require "rake"` was allowed.
This leads to an inconsistency, which actually affected a test test
defines s test class *only when* `require "rake"` is successful.
(test/rubygems/test_gem_package_task.rb)

https://github.com/ruby/ruby/actions/runs/6807729617/job/18511055636#step:8:1714
```
  /home/runner/work/ruby/ruby/src/tool/lib/test/unit.rb:729:in `const_get': uninitialized constant TestGemPackageTask (NameError)

                suites.map! {|r| ::Object.const_get(r[:testcase])}
                                         ^^^^^^^^^^
```
2023-11-15 19:27:10 +09:00
lukeg 7717684d16 tool test/unit/testcase: rename vars @passed, @@current
to @__passed__, @@__current__.
@passed is redefined in a few test suites, and this could lead to bugs.

Also rename @options (Runner#options) to @__runner_options__, which is
only used in make test-tool anyway.
2023-10-26 12:39:13 +09:00
Hiroshi SHIBATA df5bf5bb59
Removed unnecessary libraries of sync_tool 2023-10-23 17:28:50 +09:00
Nobuyoshi Nakada 38b79b05fd
Fallback job status to normal if no tty 2023-10-21 19:47:05 +09:00
Hiroshi SHIBATA bb849ffdb1
Added explicitly begin-end block for Ruby 2.4.
strscan, ipaddr and some default gems still support Ruby 2.4.

  After this, I extract this CoreAssertions to their repositories.
2023-10-20 14:34:08 +09:00
Nobuyoshi Nakada 4f4016497e
Handle `Timeout::Error` reported from workers 2023-10-18 23:41:23 +09:00
Nobuyoshi Nakada ff4c98f125
Fix total count when filters given 2023-10-18 12:19:52 +09:00
Nobuyoshi Nakada f13068afaa
Escape method names containing control characters 2023-10-18 10:36:42 +09:00
Takashi Kokubun 6c46ccf226
Prefer RbConfig.ruby over the 3.times fallback (#8691)
It seems saner to use RbConfig.ruby than using ruby in a random ancestor
directory.
2023-10-17 17:57:39 -07:00
Nobuyoshi Nakada 776d4dec69 Manage parallel test workers after timeout 2023-10-18 02:55:42 +09:00
Nobuyoshi Nakada 10379ebf90
Support regexp in log-fix [ci skip] 2023-10-03 22:02:02 +09:00
Nobuyoshi Nakada d80002c902
Improve VCS::GIT#format_changelog addessing [ci skip] 2023-09-23 16:34:20 +09:00
Hiroshi SHIBATA f1c78b2331 Suppress warning for shadowing outer local variable 2023-09-12 15:10:16 +09:00
Hiroshi SHIBATA 141102b0b0 Expose Test.filter_backtrace for the default gems. 2023-08-29 15:05:30 +09:00
Nobuyoshi Nakada 129663c4a8
tool/lib/output.rb: Make `--color` option like GNU coreutils 2023-08-23 19:40:56 +09:00
Nobuyoshi Nakada de4a1ca792
tool/lib/output.rb: Add `--create-only` and `--overwrite` options 2023-08-23 19:40:56 +09:00
Nobuyoshi Nakada f1c6da65f4
tool/lib/output.rb: Add `--no-color` option 2023-08-23 19:40:55 +09:00
Nobuyoshi Nakada 69292676a2
Add message for `--ruby` option [ci skip] 2023-08-08 09:21:45 +09:00
Nobuyoshi Nakada a502cd80a5
Fix wrong assignment 2023-08-02 23:55:07 +09:00
Nobuyoshi Nakada 85ee4a65a2
Allow to override environment variables for debug 2023-08-02 19:55:31 +09:00
Nobuyoshi Nakada c8d0470bb0
Use `File::NULL` instead of hard coded null device names 2023-07-10 19:21:47 +09:00
Nobuyoshi Nakada 4589056384 Exit with a failure if any test files failed to load 2023-06-03 20:22:10 +09:00
Hiroshi SHIBATA 59646e8798 Allow to use development version of bundled gems for packaging 2023-05-09 12:57:12 +09:00
Hiroshi SHIBATA bb75e83d9f We should not validate development version of bundled gems with fetch timing.
We want to notify above situation when release time. So, I move this check into ruby/actions.
2023-05-09 12:57:12 +09:00
Nobuyoshi Nakada d239643603 core_assertions.rb: Support old rubies
Some symbol argument might not be accepted by Process.clock_gettime.
2023-04-29 11:28:26 +09:00
Nobuyoshi Nakada afc98e3b55 Copy also helper.rb [ci skip] 2023-04-28 22:05:09 +09:00
Nobuyoshi Nakada 533423ebe4 core_assertions.rb: Prefer CPU time clocks
To prevent influence from other processes.
2023-04-06 00:19:03 +09:00
Nobuyoshi Nakada f9eb2515a3 core_assertions.rb: Extract common code block 2023-04-06 00:19:03 +09:00
Nobuyoshi Nakada f07c756494 core_assertions.rb: Tweak timeout limit
Increase the timeout limit when variance at rehearsal is small.
2023-04-06 00:19:03 +09:00
Takashi Kokubun 3fe134759c Skip assert_linear_performance for RJIT 2023-04-02 12:23:23 -07:00
Nobuyoshi Nakada bccdc04166
Check if `Bundler::EnvironmentPreserver` is defined
Only `Bundler` might be defined.  `EnvironmentPreserver` and its
`BUNDLER_PREFIX` would be defined together in the same file.
2023-03-31 11:11:45 +09:00
Nobuyoshi Nakada f6adc5be94 Check if Bundler is defined 2023-03-28 17:17:51 +09:00
Nobuyoshi Nakada db7c38634e
core_assertions.rb: Raise `Timeout::Error` explicitly
So that `assert_raise` inside the block works.
2023-03-23 14:49:41 +09:00
Nobuyoshi Nakada e340eb2106
core_assertions.rb: Fix backward compatibility with pre 2.7 2023-03-22 23:07:26 +09:00
Nobuyoshi Nakada 27916db08c
[DOC] Update comment of assert_pattern_list
`pattern_list` may contain string since d903e76726.
2023-03-22 22:35:58 +09:00
Nobuyoshi Nakada 09bda4ceb5
core_assertions.rb: Refine `assert_linear_performance`
* Calculate each timeout from the ratio of each factor to the first
  factor.
2023-03-22 18:53:12 +09:00
Nobuyoshi Nakada ccd2dbc4c1 core_assertions.rb: Relax `assert_linear_performance`
* Use an `Enumerable` as factors, instead of three arguments.

* Include `assert_operator` time in rehearsal time.

* Round up max expected time.
2023-03-18 02:41:02 +09:00
Takashi Kokubun a8e7fee801 Revert "core_assertions.rb: Refine `assert_linear_performance`"
This reverts commit cae4342dd5.

This is failing a lot of CIs and nobody is actively looking into fixing
it. Let me revert this until we have a solution to it.
2023-03-16 09:22:42 -07:00
Nobuyoshi Nakada cae4342dd5
core_assertions.rb: Refine `assert_linear_performance`
* Use an `Enumerable` as factors, instead of three arguments.
2023-03-16 18:51:02 +09:00
Nobuyoshi Nakada 09041a6ee8
core_assertions.rb: Refine `assert_linear_performance`
* Add `rehearsal` keyword argument
* Stop repeating with the same factor
2023-03-15 18:19:31 +09:00
Nobuyoshi Nakada 7ce4b716bd
Add test for linear performance 2023-03-12 18:50:39 +09:00
Nobuyoshi Nakada 781222a8bc
core_assertions.rb: Consider backward compatibilities
This file is copied to default gems, which might support older
versions.
2023-03-12 18:40:41 +09:00
Hiroshi SHIBATA 1163204021 code style 2023-03-08 17:48:43 +09:00
Hiroshi SHIBATA a7cee4da97 Added debug info to gemspec version check 2023-03-08 17:48:43 +09:00
Takashi Kokubun 23ec248e48 s/mjit/rjit/ 2023-03-06 23:44:01 -08:00
Takashi Kokubun 2e875549a9 s/MJIT/RJIT/ 2023-03-06 23:44:01 -08:00
lukeg ba55706fb6 fix test/rubygems/test_gem_package_task.rb when in -j mode
This test skipped sometimes due to failure to load 'rake/packagetask'.
This is due to manipulation of $LOAD_PATH by other rubygems tests. If
rake is loaded before any rubygems tests run, then it works fine.

To reproduce the skipping behavior:
  $ make test-all TESTOPTS="-j6 --test-order=sorted test/rubygems/test_*.rb"
2023-02-28 06:34:27 +09:00
Hiroshi SHIBATA db0a4c8923 Prefer to use File.foreach instead of IO.foreach 2023-02-27 18:49:18 +09:00