Commit graph

108 commits

Author SHA1 Message Date
Hiroshi SHIBATA
a450e9304d Extract Benchmark.measure on assert_cpu_usage_low 2025-01-10 13:27:16 +09:00
Nobuyoshi Nakada
e884d65094
Ignore blocks to Test::Unit::Assertions#pend silently
Although `pend` in test-unit gem expects the block does not pass if it
is given, our `pend` should ignore the block silently as same as it
just skips the test with no message by default.  Add an unused
parameter, to suppress the warning for the block to be ignored.
2024-09-04 14:49:25 +09:00
Yusuke Endoh
2c35a37918 Fix a typo 2024-08-07 02:34:46 +09:00
Yusuke Endoh
062f85e141 Dump all-thread backtraces when test parallel worker exceeds time limit 2024-08-06 21:11:41 +09:00
Naoto Ono
8ede84aa95 Move the file location of launchable.rb 2024-07-08 10:15:04 +09:00
Naoto Ono
5b78925455 Integrate Launchable into make btest 2024-07-08 10:15:04 +09:00
Kevin Newton
b4b39a6199 [PRISM] Enable test_methoddef_endless_command 2024-05-07 14:24:31 -04:00
Naoto Ono
3371936b6f Add Launchable into CI 2024-02-23 14:10:01 +01:00
Nobuyoshi Nakada
1fa4d15ca7
Add Test::Unit::TestCase#method_name
For the compatibility with test-unit gem.
2024-02-21 15:45:53 +09: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)

1851105563 (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
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
ba45be3c43
Supressing warnings messages like:
Ignoring debug-1.7.1 because its extensions are not built. Try: gem pristine debug --version 1.7.

  Revert "Clear gem paths for each test"

  This reverts commit 6698b580dd.
2023-01-18 16:14:00 +09:00
Nobuyoshi Nakada
6698b580dd Clear gem paths for each test
So that rubygems can find the bundled rake.
2023-01-15 23:57:43 +09:00
Nobuyoshi Nakada
f159bbd17d
Prevent accidental use of assert_raises 2022-06-25 19:09:06 +09:00
Hiroshi SHIBATA
c506ddac6c
Added assert_true and assert_false same as test-unit gem 2022-04-20 14:13:10 +09:00
Hiroshi SHIBATA
3515867381 Removed skip alias in test suite 2022-01-17 10:39:24 +09:00
Koichi Sasada
8a49c7e481 Revert "introduce check code for mysterious EBADF"
This reverts commit 7864efa105.
2021-10-26 17:06:57 +09:00
Koichi Sasada
d1424f7f7e Revert "check other IO#close calls"
This reverts commit a1c4cab11d.
2021-10-26 17:06:57 +09:00
Koichi Sasada
a1c4cab11d check other IO#close calls
http://ci.rvm.jp/results/trunk@ruby-iga/3690333
> tool/lib/test/unit/parallel.rb:68:in `close': Bad file descriptor (Errno::EBADF)
2021-10-25 17:38:23 +09:00
Koichi Sasada
7864efa105 introduce check code for mysterious EBADF
parallel test randomly failed with EBADF.
This patch checks wich suite causes this error.

ex) http://ci.rvm.jp/results/trunk@ruby-iga/3690219

```
/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:88:in `close': Bad file descriptor (Errno::EBADF)
	/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:88:in `ensure in _run_suite'
	/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:89:in `_run_suite'
	/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:30:in `block in _run_suites'
	/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:29:in `map'
	/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:29:in `_run_suites'
	/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:128:in `run'
	/tmp/ruby/v3/src/trunk/tool/lib/test/unit/parallel.rb:211:in `<main>'
```
2021-10-25 15:47:09 +09:00
Nobuyoshi Nakada
6c74976aef Remove Test::Unit::TestCase.make_my_diffs_pretty!
`Test::Unit::CoreAssertions#mu_pp` is defined always using
`pretty_inspect`.
2021-10-18 17:36:06 +09:00
Nobuyoshi Nakada
d1b8544b4d Remove Test::Unit::Assertions#exception_details
Never used since fa0f3eff22.
2021-10-18 17:36:06 +09:00
Nobuyoshi Nakada
13716898df Retry hung tests after parallel runs 2021-10-17 16:33:58 +09:00
Nobuyoshi Nakada
5de6e25144
Replace unpack with unpack1 2021-10-17 00:48:45 +09:00
Nobuyoshi Nakada
370fff98ce
Prefer require_relative 2021-10-15 18:47:25 +09:00
Nobuyoshi Nakada
c4570acc86
Refactor ordering of tests
* Split the sorting types into classes.
* Apply the same sorting to method sorting under the parallel
  test.
2021-10-04 20:46:47 +09:00
Nobuyoshi Nakada
34d6720fee
Prohibit test method redefinition 2021-09-17 08:54:18 +09:00
Hiroshi SHIBATA
ec6f04c092
Use capture_output instead of capture_io 2021-09-13 21:14:42 +09:00
Hiroshi SHIBATA
be04006c7d
Rename capture_io to capture_output and deprecate to use capture_io 2021-09-13 20:56:34 +09:00
Hiroshi SHIBATA
455978cd13
Removed unused mu_pp method 2021-09-13 20:41:03 +09:00
Hiroshi SHIBATA
f5993331b2
Renamed skip to pend and prepared to deprecate skip method 2021-09-13 19:09:24 +09:00
Hiroshi SHIBATA
dbdceb8a19 Removed workaround for test_order 2021-09-13 14:39:23 +09:00
Hiroshi SHIBATA
8d0315a2bb
Removed unsed assertions for rubygems 2021-09-11 21:05:15 +09:00
Hiroshi SHIBATA
d58e0ffc24
Removed unused alias for run_test 2021-09-11 20:35:18 +09:00
Hiroshi SHIBATA
a13ee1f33c
Removed rubinius support from test suite 2021-09-11 18:10:15 +09:00
Hiroshi SHIBATA
aebd0a873e
Removed maglev related code because it's not active status now 2021-09-11 18:10:15 +09:00
Nobuyoshi Nakada
952806cdec
Update comments for minitest 2021-09-11 17:37:49 +09:00
Nobuyoshi Nakada
911f62e681
Directly alias orig_run_suite 2021-09-11 17:19:02 +09:00
Hiroshi SHIBATA
b178929469
Fixed uninitialized constant Test::Unit::Assertions::MIN_MEASURABLE.
I'm not sure why it's failed under the chkbuild and rubyci.

  20210911T000007Z.fail.html.gz
2021-09-11 11:21:37 +09:00
Hiroshi SHIBATA
d05383812a Replace Test::Assertion and Test::Skip to Test::Unit::AssertionFailedError and Test::Unit::PendedError 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA
151a1cd45e Fixed inconsistent require order for assertions and core_assertions 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA
9b026ca39b Integrate Minitest to Test 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA
8ec187c091 Replace MiniTest::Unit to Test::Unit::Runner 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA
48933a3409 Added default test-class for parallel tests 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA
e4b5ac9b9a Use Test::Unit namespace 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA
df86d78a26 Use self class for diff 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA
3e32412e08 Fixed broken runner for make test-all 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA
871e7b5f55 Use MiniTest 2021-09-11 08:48:03 +09:00
Hiroshi SHIBATA
7456cbdd09 Move test_order under the Test::Unit::TestCase 2021-09-11 08:48:03 +09:00