428 Commits
Author SHA1 Message Date
Nobuyoshi Nakada 3563a0db80 Add predicates for platforms 2025-12-15 17:38:38 +09:00
Takashi Kokubun c69d59e9b2 Sync tool/lib/core_assertions.rb from master
It seems necessary to pass test-bundled-gems with REXML.
2024-09-02 03:25:23 -07:00
Hiroshi SHIBATAandNobuyoshi Nakada 06f470ce66 Merge RubyGems 3.5.11 and Bundler 2.5.11 for Ruby 3.3 (#10870)
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2024-06-04 21:36:46 -07:00
Takashi Kokubun 0a0338b06f merge revision(s) 9f708d48f6, 0301473fb5, 874e9fc34d, 7f0e26b7f9: [Backport #20516]
Clear runtime dependencies if default gems is specified.

	The current build system uses runtime dependencies from only
	`.bundle` directory. We shouldn't install runtime dependencies
	from rubygems.org when `make test-bundled-gems` is invoked.

	Fixed dependencies list format

	Don't need to remove ruby2_keywords dependency from drb

	Re-use strscan with ruby repo
2024-06-04 11:43:25 -07:00
Takashi Kokubun 2f4fe76eff Skip under_gc_compact_stress on s390x (#10073) 2024-05-29 11:13:02 -07:00
NARUSE, Yui f585171a6b merge revision(s) e12d4c654e: [Backport #20104]
Don't create T_MATCH object if /regexp/.match(string) doesn't match

	Fixes [Bug #20104]
	---
	 re.c                     |  9 ++++++---
	 test/ruby/test_regexp.rb | 12 ++++++++++++
	 tool/lib/envutil.rb      |  8 ++++++++
	 3 files changed, 26 insertions(+), 3 deletions(-)
2024-01-30 20:29:02 +09:00
Takashi Kokubun c25705c267 Get rid of obsoleted RJITFirst
It was renamed from test_mjit, but we did not maintain it as test_rjit.
We test RJIT very differently.
2023-12-22 20:20:42 -08:00
Peter Zhu 32ecda354f Support GC.auto_compact = :empty on debug builds
This commit adds `GC.auto_compact = :empty` which will run
auto-compaction sorting pages by empty slots so the most amount of
objects will be moved. This will make it easier to write tests for
auto-compaction.
2023-12-19 18:29:36 -05:00
Kazuhiro NISHIYAMA 9765ada69c Fix NoMethodError on fail
```
.../tool/lib/colorize.rb:56:in `resolve_color': undefined method `gsub' for an instance of Symbol (NoMethodError)

    color.gsub(/\b[a-z][\w ]+/) do |n|
	 ^^^^^
	from .../tool/lib/colorize.rb:47:in `decorate'
	from .../tool/lib/test/unit.rb:1012:in `block in failed'
```
2023-12-12 09:14:11 +09:00
Nobuyoshi Nakada d9dbcd848f Add bright colors and multiple attributes [ci skip]
Not only:
```
$ ruby colorize.rb fail foo
```

Also:
```
$ ruby colorize.rb 'bright_blue;bold' foo
```
2023-12-10 20:43:47 +09:00
Nobuyoshi Nakada 0096d6a809 Extract configuration and lookup methods [ci skip] 2023-12-10 20:43:44 +09:00
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