Commit graph

169 commits

Author SHA1 Message Date
Hiroshi SHIBATA
61bd28b836
[ruby/date] Workaround for non-ruby repository like ruby/date, flori/json
1ff7fa2d80
2020-12-23 13:53:40 +09:00
Marc-Andre Lafortune
1ecac8e4d0 Add require_relative option to assert_ractor 2020-12-20 22:00:05 -05:00
Marc-Andre Lafortune
b1b6dbfdc3 assert_ractor tweak. Thanks Nobu 2020-12-19 22:37:27 -05:00
Marc-Andre Lafortune
70f20234b2 Add assert_ractor [Feature #17367] 2020-12-19 17:13:08 -05:00
Jeremy Evans
05313c914b Use category: :deprecated in warnings that are related to deprecation
Also document that both :deprecated and :experimental are supported
:category option values.

The locations where warnings were marked as deprecation warnings
was previously reviewed by shyouhei.

Comment a couple locations where deprecation warnings should probably
be used but are not currently used because deprecation warning
enablement has not occurred at the time they are called
(RUBY_FREE_MIN, RUBY_HEAP_MIN_SLOTS, -K).

Add assert_deprecated_warn to test assertions.  Use this to simplify
some tests, and fix failing tests after marking some warnings with
deprecated category.
2020-12-18 09:54:11 -08:00
Nobuyoshi Nakada
9908177857
test/ruby: Check warning messages at a finer granularity
Instead of suppressing all warnings wholly in each test scripts by
setting `$VERBOSE` to `nil` in `setup` methods.
2020-12-17 20:06:18 +09:00
Takashi Kokubun
aacd2295d0
Debug the command used for gdb dump
It's not working
http://ci.rvm.jp/results/trunk-mjit@phosphorus-docker/3288206. I'm
debugging why.
2020-12-13 23:35:29 -08:00
Takashi Kokubun
246d7e4f1d
Dump a backtrace with gdb
Because Ruby often fails to dump a C backtrace.
2020-12-12 18:46:24 -08:00
Takashi Kokubun
f1757a88a4
Avoid leaving too many core files in /tmp
for CIs like ci.rvm.jp.
2020-12-03 21:33:35 -08:00
Takashi Kokubun
30fba5f37d
Do not require time and fileutils by default
I have no idea what I'm doing, but the previous commit caused lots of CI
failures like 1496949568 and this
place is the most suspicious.
2020-12-03 21:24:36 -08:00
Takashi Kokubun
067f45ecd3
Save a core file on a worker crash
CI failures like
http://ci.rvm.jp/results/trunk-mjit@phosphorus-docker/3280458 doesn't
provide any useful information, and it doesn't leave a core file in a CI
environment because a test like `Process.kill(:TRAP, $$)` overwrites in
a next run very quickly.

Thus I'd like to keep core files in /tmp.
2020-12-03 21:01:25 -08:00
Takashi Kokubun
0734a6cd59
Revert "Report a full_message on a worker crash"
This reverts commit 00f046ef57.
It was not helpful for an issue I was debugging.
2020-12-03 20:55:36 -08:00
Koichi Sasada
e79f1941b2 tune parallel test
This patch contains the fowllowing hacks:

(1) Add "--timetable-data=FILE" option for test-all
    This option enables to dump timeline event
    contains worker, suite, and start/end time.
(2) remove TestJIT in test_jit_debug.rb on parallel test.
    it is duplicated test.
(3) move test_jit.rb and test_jit_debug.rb at first
    because these two tests are bottleneck of parallel tests.

On my environment, `make test-all TESTS=-j12` reduced the total time
190 seconds -> 140 seconds.
2020-12-01 09:39:09 +09:00
Takashi Kokubun
00f046ef57
Report a full_message on a worker crash
A worker crash happens very often, but we're not sure why.
I'd like to know a backtrace if it's available.
2020-11-24 20:36:39 -08:00
Koichi Sasada
7ad56fd87b freeze dynamic regexp literals
Regexp literals are frozen, and also dynamically comppiled Regexp
literals (/#{expr}/) are frozen.
2020-10-27 01:45:57 +09:00
Hiroshi SHIBATA
533bca57e0
Expose assert, assert_respond_to and assert_not_respond_to for default gems. 2020-10-08 16:40:46 +09:00
Nobuyoshi Nakada
9fbbbadc96
Added just working Test::Unit::CoreAssertions#diff
This is not "diff", but show expected and actual results both,
just to get rid of `NoMethodError` when an assertion failed.
2020-09-14 18:19:40 +09:00
Hiroshi SHIBATA
59ded36c60
Expose assert_pattern_list for drb test with test-unit gem. 2020-07-02 20:53:42 +09:00
Nobuyoshi Nakada
968d6df49f
Added --test-order=nosort option
Run tests in the order given in the command line.
2020-05-17 16:34:06 +09:00
Nobuyoshi Nakada
2e87488d13
Expand retrying test file names to realpath
As well as worker processes do in Test::Unit::Worker#run.
2020-04-23 10:25:09 +09:00
Nobuyoshi Nakada
3152977b31
Rescue EPIPE in _report
Instead of letting callers rescue the error always.
2020-04-17 14:25:20 +09:00
Nobuyoshi Nakada
3cca0d1958 core_assertions.rb: fixed fd leak at timeout 2020-04-17 00:52:29 +09:00
卜部昌平
f7048f9d55 tool/lib/test/unit: support TESTS='-- -ext-' again
There is a test directory named test/-ext-.  Because this directry
starts with a hyphen, we have to cheat test/unit in order for it to
run the tests underneath.  TESTS='-- -ext' worked for a long time.
Let's not break that maneuver.
2020-03-04 12:30:42 +09:00
Koichi Sasada
413c98003b show backtrace.
assert_nothing_raised doesn't show the backtrace if an exception
is thrown in a block. This patch shows this backtrace.
2020-03-01 03:02:05 +09:00
Koichi Sasada
28399e4e0f respect --test-order=random
Now --test-order=random is simply ignored. This patch respect
this option.
2020-02-28 17:44:23 +09:00
Koichi Sasada
116c632095 don't ignore --seed option
`--seed N` option is just ignored so respect this option.
[Feature #16655]

Also making "Run options" display pretty.
2020-02-27 02:26:14 +09:00
Hiroshi SHIBATA
9b2e671944 Expose assert_no_memory_leak for weakref 2020-02-11 13:29:23 +09:00
Hiroshi SHIBATA
a5d7b8e13d Expose assert_normal_exit for weakref 2020-02-11 13:29:23 +09:00
Nobuyoshi Nakada
a3fb97465d
Stop auto runner
Auto runner should not run in forked processes in separated tests.
2020-02-07 13:43:50 +09:00
Nobuyoshi Nakada
3d21a75c72
No crafted backtrace for SystemExit
As SystemExit is ignored, it is just useless.
2020-02-07 11:09:19 +09:00
Nobuyoshi Nakada
5fac54a594
Fixed the output from separated test in parallel test
Redirect the output of separated child process to
`MiniTest::Unit.output`.
2020-02-06 20:53:11 +09:00
Nobuyoshi Nakada
f1c230f18b
Add separated assertion count 2020-02-06 20:52:25 +09:00
Nobuyoshi Nakada
0226d72e95
Fixed the output from separated test in parallel test
To output to the STDOUT of the parent process according to the
parallel test protocol, should send to the `MiniTest::Unit.output`
instead of each own STDOUT.
2020-02-05 09:39:14 +09:00
Nobuyoshi Nakada
6fe44576b9
Fixed FD leaks 2020-02-05 09:30:12 +09:00
Nobuyoshi Nakada
c6cd4206df
Get rid of nested string interpolations to be editor-friendly 2020-02-05 08:53:21 +09:00
NARUSE, Yui
390a9d3b72 just use STDOUT 2020-02-04 21:51:57 +09:00
NARUSE, Yui
9b9a621ae3 On Windows it cannot receive fd except 0..2 2020-02-04 20:54:48 +09:00
NARUSE, Yui
0529fead36 assert_separately uses their own pipe instead of stdout 2020-02-04 19:30:11 +09:00
卜部昌平
12de92a368 implement make test-all TESTS=--gc-compact
79eb5e1aca implemented
RUBY_TEST_GC_COMPACT=1 so why not make it also possible via the command
line argument.
2019-12-12 11:13:42 +09:00
Koichi Sasada
27ac034f19 support gc_compact_checker on parallel test. 2019-12-12 04:27:06 +09:00
Yusuke Endoh
409e4ab740 tool/lib/test/unit/parallel.rb: fail explicitly when failing to get io
`(ulimit -n 30; make test-tool)` fails with unexplicit message:
"undefined method `write' for nil:NilClass" due to lack of stdout.

This change makes it explicit.  [Bug #5577]
2019-12-03 17:26:12 +09:00
David Rodríguez
a2fc6a51dd [ruby/fileutils] Fix test failure under ruby 2.4
`Exception#full_message` is only defined on ruby 2.5.0 and above.

a8968f41ed
2019-12-01 08:23:05 +09:00
David Rodríguez
fa0f3eff22 [ruby/fileutils] Fix error printing test failure
`exception_details` is not defined anywhere.

This commit fixes the following test crash in ruby 2.4

```
Error: test_assert_output_lines(TestFileUtils): NoMethodError: undefined method `exception_details' for #<TestFileUtils:0x00005556ef699178>
```

And replaces it with an actual test failure:

```
[Test::Unit::CoreAssertions::MiniTest::Assertion] exception expected, not #<NoMethodError: undefined method `full_message' for #<RuntimeError: ok>
Did you mean?  message>.
```

2f38ba6e82
2019-12-01 08:22:37 +09:00
Kazuhiro NISHIYAMA
50bc7e7e9f
Add debug print
http://ci.rvm.jp/results/trunk-mjit@silicon-docker/2380788
```
test_all             #<Thread:0x000055b6c8e9fca8@/tmp/ruby/v2/src/trunk-mjit/tool/lib/test/unit/parallel.rb:42 run> terminated with exception (report_on_exception is true):
<internal:pack>:134:in `pack': no implicit conversion of false into String (TypeError)
	from /tmp/ruby/v2/src/trunk-mjit/tool/lib/test/unit/parallel.rb:160:in `_report'
	from /tmp/ruby/v2/src/trunk-mjit/tool/lib/test/unit/parallel.rb:45:in `block in _run_suite'
```
2019-11-09 15:20:52 +09:00
Hiroshi SHIBATA
1c03026ea3 Try to run assert_output_unchanged with racc tests 2019-10-31 08:39:48 +09:00
Nobuyoshi Nakada
601f1fb456
Catch syntax error even if fatal 2019-10-23 02:05:28 +09:00
Nobuyoshi Nakada
f8fb51c976
Revert "alias assert_raise_message for compatibility with test-unit"
This reverts commit 43015275b9.

`assert_raise_message` in test-unit is different from
`assert_raise_with_message`.  It checks the exception message
only, but not the exception class,
2019-10-16 21:00:36 +09:00
Nobuyoshi Nakada
43015275b9
alias assert_raise_message for compatibility with test-unit 2019-10-16 17:44:51 +09:00
Hiroshi SHIBATA
c14755e9ca
[ruby/fileutils] improve the compatibility of minitest
f16f5a0dd6
2019-10-03 18:32:21 +09:00
卜部昌平
84fc1de512 use bind_call for test-all --gc-stress
This one allocation of Method object is worth avoiding.  We don't
want to test UnboundMethod#bind right here.  GC need not run.
2019-10-03 15:24:09 +09:00