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

340 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada a2e7b11f2a
output.rb: extract from generic_erb.rb
- writing to a file or stdout
- touching timestamp files
- overwriting only if changed
- colorizing
2022-11-01 14:34:05 +09:00
Nobuyoshi Nakada 99a79dc40b
colorize.rb: support for NO_COLOR 2022-11-01 14:34:05 +09:00
Nobuyoshi Nakada f0c8c1e878
vpath.rb: tweak --vpath option message 2022-11-01 14:34:05 +09:00
Nobuyoshi Nakada aa8c6759ee
vcs.rb: do not reference the constant before assignment 2022-11-01 11:40:32 +09:00
Nobuyoshi Nakada 00d5b7ce7c vcs.rb: copy safe directory configuration
Now revision.tmp will be regenerated always and every times, even if
the recent file exists in the source directory, as far as using git.
On the other hand, VirtualBox mounts shared folders as root, and git
rejects the repository there as dubious ownership.
2022-10-30 17:06:33 +09:00
Nobuyoshi Nakada b64514f132 vcs.rb: prettify debug print 2022-10-30 17:06:33 +09:00
Nobuyoshi Nakada ab31d2e69f
Add `--zone` option to `VCS`
Which controls the timezone offset for `RUBY_RELEASE_DATE`.
2022-09-30 10:39:43 +09:00
Nobuyoshi Nakada 5a5644dadc
Introduce `VCS::Null` for fallback 2022-09-30 10:39:42 +09:00
Nobuyoshi Nakada f70ba9cf80
Check for the availability of the command when detecting 2022-09-30 10:39:42 +09:00
Nobuyoshi Nakada 58b3a535cc
Pull up `VCS.short_revision` from `VCS::SVN` 2022-09-30 09:21:02 +09:00
Takashi Kokubun 922e61fcc2
Remove git command existence check again
With 33c6dd2cc8, it's no longer necessary.

This is what I got on openbsd-current:

```
-bash-5.1$ git -v
unknown option: -v
usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           [--super-prefix=<path>] [--config-env=<name>=<envvar>]
           <command> [<args>]
-bash-5.1$ git version
git version 2.35.1
```
2022-09-17 23:05:10 +09:00
Takashi Kokubun 33c6dd2cc8
Fallback to VCS.release_date on VCS::NotFoundError
when -q is given.

One of the RubyCI servers, freebsd12, had a broken git environment:

```
$ git show
fatal: detected dubious ownership in repository at '/usr/home/chkbuild/chkbuild/tmp/build/20220917T123002Z/ruby'
To add an exception for this directory, call:

        git config --global --add safe.directory /usr/home/chkbuild/chkbuild/tmp/build/20220917T123002Z/ruby
```

tool/lib/vcs.rb doesn't work normally for that server.
Even for such cases, we'd like to generate a usable revision.h.

So this patch lets revision.h fallback to default VCS.release_date
when VCS::NotFoundError is raised.
2022-09-17 22:24:10 +09:00
Takashi Kokubun 38a7a13ac6
Auto-generate the release date on version.h from git CommitDate (#6382)
* Auto-generate the release date on version.h

from git CommitDate

* Generate revision.h on mswin
2022-09-17 21:16:06 +09:00
Nobuyoshi Nakada c28a4e0340
Replace "Fixes"/"Fixed" in commit logs as well as vcs.rb [ci skip]
Use the same regexp to replace "(#NNNN)" and "GH-NNNN" style
references in vcs.rb, too.
2022-09-14 11:24:06 +09:00
Benoit Daloze 92b907d12d Enable deprecation warnings for test-all
* So deprecated methods/constants/functions are dealt with early,
  instead of many tests breaking suddenly when removing a deprecated
  method/constant/function.
* Follows https://bugs.ruby-lang.org/issues/17591
2022-09-10 13:14:18 +02:00
Nobuyoshi Nakada 462a8be511
VCS#revision_header: Make arguments optional 2022-09-01 20:57:30 +09:00
Nobuyoshi Nakada 55b1600987
Update revision.h in packages using `VCS#revision_header` 2022-09-01 18:45:09 +09:00
Nobuyoshi Nakada ee09f75a6b
Extract `VCS#revision_header` 2022-09-01 18:01:40 +09:00
Hiroshi SHIBATA f229b36087
Fix test fail with assert_ractor outside of ruby/ruby repo
Revert 806583c093
2022-09-01 16:15:51 +09:00
Nobuyoshi Nakada d903e76726 Allow strings in assert_pattern_list 2022-08-19 01:28:31 +09:00
Nobuyoshi Nakada 5791171201
Load gemspec file at that directory
Gemspec files generated by old bundler run `git` without changing the
working directory.
Or some gemspec files expect an owned file at the top exists ath the
current working directory.
2022-08-05 09:52:20 +09:00
Nobuyoshi Nakada 44a0a66559
Move to tool/lib/bundled_gem.rb 2022-08-05 09:44:18 +09:00
Nobuyoshi Nakada 5921bfc7ce
Add `--stdout-on-failure`, the reverse of `--stderr-on-failure` 2022-07-05 14:40:19 +09:00
Nobuyoshi Nakada 1b34bd07c1
Separate failed output option
It is unrelated to `GlobOption` at all.
2022-07-05 14:40:19 +09:00
Nobuyoshi Nakada f159bbd17d
Prevent accidental use of assert_raises 2022-06-25 19:09:06 +09:00
Nobuyoshi Nakada 7fd51c0241
vcs.rb: ignore configuration files get rid of aliases [ci skip] 2022-06-22 09:33:25 +09:00
Nobuyoshi Nakada bc77cda8fd
vcs.rb: just one log to check if `--date` option works [ci skip] 2022-06-22 09:32:01 +09:00
Nobuyoshi Nakada 0dcd25b711
vcs.rb: show diagnostic/progressing messages when debugging [ci skip] 2022-06-22 09:31:19 +09:00
Nobuyoshi Nakada 983f2688db
Hack to avoid leak checker 2022-05-25 18:48:01 +09:00
Takashi Kokubun ead96e7b44
Rename test_jit to test_mjit
to avoid confusion with YJIT
2022-05-20 21:32:55 -07:00
Hiroshi SHIBATA c506ddac6c
Added assert_true and assert_false same as test-unit gem 2022-04-20 14:13:10 +09:00
Alan Wu 21c8b9eb99 Copyedit parallel test harness crash message
Mea culpa.

Co-authored-by: Kaíque Kandy Koga <kaiquekandykoga@gmail.com>
2022-04-06 18:39:27 -04:00
Alan Wu 399ef463f7 Copyedit parallel test harness crash message 2022-04-06 18:11:43 -04:00
Kazuhiro NISHIYAMA d9c6f8d45c
Try to fix NoMethodError on slow environments
```
  1) Failure:
TestParallel::TestParallel#test_hungup [/home/user/ruby/tool/test/testunit/test_parallel.rb:215]:
Expected /^Retrying hung up testcases\.+$/ to match "Run options: \n" +
"  --seed=43403\n" +
"  --ruby\n" +
"  \"./miniruby -I../lib -I. -I.ext/common ../tool/runruby.rb --extout=.ext -- --disable-gems\"\n" +
"  -j\n" +
"  t1\n" +
"  --worker-timeout=1\n" +
"\n" +
"# Running tests:\n" +
"\n" +
"/home/user/ruby/tool/lib/test/unit.rb:687:in `block in _run_parallel': undefined method `<' for nil:NilClass (NoMethodError)\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:538:in `block in quit_workers'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:537:in `reject!'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:537:in `quit_workers'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:687:in `_run_parallel'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:810:in `_run_suites'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:849:in `_run_suites'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:1479:in `_run_anything'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:1263:in `_run_anything'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:1654:in `run_tests'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:1641:in `block in _run'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:1640:in `each'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:1640:in `_run'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:1682:in `run'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:1034:in `run'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:882:in `run'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:154:in `run'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:1761:in `run'\n" +
"\tfrom /home/user/ruby/tool/lib/test/unit.rb:1765:in `run'\n" +
"\tfrom /home/user/ruby/tool/test/testunit/tests_for_parallel/runner.rb:14:in `<main>'\n".
```
2022-04-05 19:23:38 +09:00
Nobuyoshi Nakada 8780f15fd7 [ruby/date] Use `assert_deprecated_warn`
https://github.com/ruby/date/commit/c55004715a
2022-02-25 20:39:47 +09:00
Koichi Sasada 00c7a0d491 fix parallel test timeout retrying
On the parallel test, workers can be killed because of timeout
and the information for the retrying can be inconsistent.
This patch will skip if the inconsistency is found and report
as an error.

http://ci.rvm.jp/results/trunk-asserts@phosphorus-docker/3834082
2022-02-16 17:57:04 +09:00
Jesse Chavez 99d02caed3 [ruby/logger] Fix log rotation inter-process lock failed.
Issue only occurs in JRuby 9.3.0.0 and Windows and the full
console output is:

log rotation inter-process lock failed. D:\log.txt -> D:\log.txt.0: The process cannot access the file because it is being used by another process.
log writing failed. closed stream
log writing failed. closed stream
...

https://github.com/ruby/logger/commit/19fc734638
2022-01-27 12:33:06 +09:00
Koichi Sasada cac6fe9023 add `--stderr-on-failure` option to test-all
Now all failure messages are printed to stdout. This option
makes all failure messages printed into stderr.
2022-01-26 09:56:09 +09:00
David Rodríguez de678cd51e
[ruby/pathname] Officially drop support for ruby 2.6 or older
The gem doesn't even install on old rubies, but since the gemspec claims
it's supported, `gem install pathname` will try to install it and print
an error.

This commit doesn't fix the above issue. The only way to fix it would be
to restore support and release a new version that actually supports old
rubies. However, such a change has been proposed and ignored for a long
time.

So this issue proposes to leave that broken but at least bring the
gemspec manifest and the CI matrix in sync to hopefully avoid this issue
from happening again in the future.

https://github.com/ruby/pathname/commit/3ee010b538
2022-01-25 08:50:31 +09:00
Koichi Sasada 374904b25f remain `RUBY_ON_BUG` for child processes.
`RUBY_ON_BUG` is useful for child processes created by the test
process.
2022-01-19 23:17:14 +09:00
Hiroshi SHIBATA 3515867381 Removed skip alias in test suite 2022-01-17 10:39:24 +09:00
Takashi Kokubun 1a63468831
Prepare for removing RubyVM::JIT (#5262) 2021-12-13 23:07:46 -08:00
Nobuyoshi Nakada 438220f063
Let pretty_inspect work once at first
For older pp.rb which did not need io/console, and dealing with
`LoadError`.
2021-11-30 14:16:33 +09:00
Nobuyoshi Nakada d400c44a55
Load io/console earlier
Something goes wrong at loading libraries inside `mu_pp` in the
test overriding `Class.inherited`.
2021-11-30 13:15:22 +09:00
Nobuyoshi Nakada 4acc7563a1 Consider environment variable case-insensitiveness 2021-11-29 23:00:20 +09:00
Nobuyoshi Nakada 3ff0a0b40c
Filter method names only if filtering method name only
If sole `filter` option doesn't seem including test case name,
match with method name only.
And if the filter is a Regexp or String, it never matches method
name symbols.
2021-11-09 15:20:44 +09:00
Vít Ondruch 5086c25f60 Properly exclude test cases.
Lets consider the following scenario:

~~~
irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):001:0> p suite
OpenSSL::TestEC
=> OpenSSL::TestEC

irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):002:0> p all_test_methods
["test_ECPrivateKey", "test_ECPrivateKey_encrypted", "test_PUBKEY", "test_check_key", "test_derive_key", "test_dh_compute_key", "test_dsa_sign_asn1_FIPS186_3", "test_ec_group", "test_ec_key", "test_ec_point", "test_ec_point_add", "test_ec_point_mul", "test_generate", "test_marshal", "test_sign_verify", "test_sign_verify_raw"]
=>
["test_ECPrivateKey",
 "test_ECPrivateKey_encrypted",
 "test_PUBKEY",
 "test_check_key",
 "test_derive_key",
 "test_dh_compute_key",
 "test_dsa_sign_asn1_FIPS186_3",
 "test_ec_group",
 "test_ec_key",
 "test_ec_point",
 "test_ec_point_add",
 "test_ec_point_mul",
 "test_generate",
 "test_marshal",
 "test_sign_verify",
 "test_sign_verify_raw"]

irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):003:0> p filter
/\A(?=.*)(?!.*(?-mix:(?-mix:memory_leak)|(?-mix:OpenSSL::TestEC.test_check_key)))/
=> /\A(?=.*)(?!.*(?-mix:(?-mix:memory_leak)|(?-mix:OpenSSL::TestEC.test_check_key)))/

irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):004:0> method = "test_check_key"
=> "test_check_key"
~~~

The intention here is to exclude the `test_check_key` test case.
Unfortunately this does not work as expected, because the negative filter
is never checked:

~~~
irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):005:0> filter === method
=> true

irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):006:0> filter === "#{suite}##{method}"
=> false

irb(#<Test::Unit::AutoRunner::Runner:0x0000560f68afc3c8>):007:0> filter === method || filter === "#{suite}##{method}"
=> true
~~~

Therefore always filter against the fully qualified method name
`#{suite}##{method}`, which should provide the expected result.

However, if plain string filter is used, keep checking also only the
method name.

This resolves [Bug #16936].
2021-10-27 19:56:19 +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