summaryrefslogtreecommitdiff
path: root/tool/test
AgeCommit message (Collapse)Author
2024-10-29Fix TestParallel#test_hungup when RUBY_TEST_TIMEOUT_SCALE is setPeter Zhu
When RUBY_TEST_TIMEOUT_SCALE is set, the timeout increases by the multiple specified. However, the test in test4test_hungup.rb does not scale, so if RUBY_TEST_TIMEOUT_SCALE is a large number like 10, then the test will not time out causing the tests test to fail. Notes: Merged: https://github.com/ruby/ruby/pull/11959
2024-09-12Accept version rangeNobuyoshi Nakada
Single `Integer` argument means an exact match to the major version. Notes: Merged: https://github.com/ruby/ruby/pull/11604
2024-08-06Dump all-thread backtraces when test parallel worker exceeds time limitYusuke Endoh
Notes: Merged: https://github.com/ruby/ruby/pull/11315
2024-07-11Removed WEBrick and that testsHiroshi SHIBATA
We can handle uri, time and others without `make test-all` dependencies now.
2024-07-08Move the file location of launchable.rbNaoto Ono
2024-07-08Integrate Launchable into make btestNaoto Ono
2024-05-08Show the caller location of assertion methodsNobuyoshi Nakada
Not only defined in `Test::Unit` or `CoreAssertions`, also show the caller location of assertion methods defined in the current class or ancestors.
2024-04-15show warning for unused blockKoichi Sasada
With verbopse mode (-w), the interpreter shows a warning if a block is passed to a method which does not use the given block. Warning on: * the invoked method is written in C * the invoked method is not `initialize` * not invoked with `super` * the first time on the call-site with the invoked method (`obj.foo{}` will be warned once if `foo` is same method) [Feature #15554] `Primitive.attr! :use_block` is introduced to declare that primitive functions (written in C) will use passed block. For minitest, test needs some tweak, so use https://github.com/minitest/minitest/commit/ea9caafc0754b1d6236a490d59e624b53209734a for `test-bundled-gems`.
2024-04-03Launchable: Add lineNumber fieldNaoto Ono
2024-04-02Launchable: Refactor the logic of JsonStreamWriterNaoto Ono
2024-03-28Make TestParallel#test_retry_workers consider RUBY_TEST_TIMEOUT_SCALEKJ Tsanaktsidis
This test currently fails if RUBY_TEST_TIMEOUT_SCALE is set, because the worker timeout is scaled out but the duration of the sleep does not; thus, the test-test-case does not timeout when it should.
2024-03-14Ensure test suite is compatible with --frozen-string-literalJean Boussier
As preparation for https://bugs.ruby-lang.org/issues/20205 making sure the test suite is compatible with frozen string literals is making things easier.
2023-12-27Fix WEBrick::TestFileHandler#test_short_filename test not workingKJ Tsanaktsidis
The test is currently skipped and can't possibly work on windows at the moment. It fails because $LOAD_PATH is not set up properly in the forked CGI process, so `require 'uri'` fails. This works properly in the test_cgi.rb tests, because it sets up a :RequestCallback to fix things up. Let's move the setup there into util.rb, so it can be shared with test_filehandler.rb as well.
2023-12-26Test_SyncDefaultGems: Fail when editor run (#9365)Sorah Fukumori
When something went wrong and git launches editor, and a editor chosen was terminal-based, a test run unnoticeably hangs. As we intend editors not to be ran with --no-edit, GIT_EDITOR should be defaulted to `false` so let Git command fails when it attempts to start a editor. This allows catching such unintentional behaviour in test suite. (Note: Prior to Git v2.32.0, git cherry-pick --no-edit doesn't work for conflict resolution so currently the test hangs when older Git is in use. https://github.com/git/git/commit/39edfd5cbc4d168db19ec1bc867d78ec7211ec39 i.e. Ubuntu 20.04, Debian Bullseye doesn't satisfy this prerequisite.)
2023-12-15Follow removed conflict filesNobuyoshi Nakada
After editing a conflict, continue without removed files.
2023-11-15Refactor the settings of test-all outYusuke Endoh
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-07Remove files which are newly added but to be ignoredNobuyoshi Nakada
2023-10-26Fix test failure with __runner_options__ renamingHiroshi SHIBATA
2023-10-26tool test/unit/testcase: rename vars @passed, @@currentlukeg
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-18Handle `Timeout::Error` reported from workersNobuyoshi Nakada
2023-10-18Manage parallel test workers after timeoutNobuyoshi Nakada
2023-10-18Add `jobs` optional keyword argumentNobuyoshi Nakada
2023-10-04Special treat when the first line ends with a dot [ci skip]Nobuyoshi Nakada
2023-09-20Fix the case of file to be ignored with to be removedNobuyoshi Nakada
The case of 7fc73ab5f6fbe46655855079954b26dcc14576b3, which modified `.gitignore` and `.github/workflows/main.yml`. Both files need to be rejected and restored, but since the latter file was not there before, `git checkout` failed and the former file could not be restored along with it. To fix this failure, restore the ignored files one by one.
2023-09-20Add a successful sync test caseNobuyoshi Nakada
2023-09-18Fix `git cat-file` conditionNobuyoshi Nakada
When multiple files changed in the same directory to be removed, the first file only was removed from changed set.
2023-09-18Refactor test_sync_default_gems.rbNobuyoshi Nakada
2023-08-28sync_default_gems.rb: convert keys of REPOSITORIES to stringsNobuyoshi Nakada
Referencing always after conversion to a symbol, and yielded gem name is always converted to a string.
2023-08-13Prohibit copying to `fixtures` and dot-direcotry just under `test`Nobuyoshi Nakada
Do not add directories which would let chkbuild fires accidentally, to just under `test`. The "fixtures" directory is often used to place test stuffs. Notes: Merged: https://github.com/ruby/ruby/pull/8214
2023-08-06Exclude files added to the toplevelNobuyoshi Nakada
2023-07-29Change `HOME` too when testing sync_default_gems.rbNobuyoshi Nakada
As well as `GIT_CONFIG_GLOBAL`, which is supported since git 2.32.
2023-07-29Revert "Test sync_default_gems.rb only when git 2.32 is available"Nobuyoshi Nakada
This reverts commit b0f44cfa5da53b90817732cb25b4d3a1cddecb89.
2023-07-29Test sync_default_gems.rb only when git 2.32 is availableNobuyoshi Nakada
With older git, as `GIT_CONFIG_GLOBAL` environment variable is not supported, these tests clobber user's configurations.
2023-06-03Exit with a failure if any test files failed to loadNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7897
2023-04-28Support older gitNobuyoshi Nakada
The -b flag is available since 2.28, but Ubuntu 20.04 uses 2.25. Notes: Merged: https://github.com/ruby/ruby/pull/7770
2023-03-28Skip commits only for toolsNobuyoshi Nakada
Get rid of accidents like 67feb782f947046f65951303893713052a19a546. Notes: Merged: https://github.com/ruby/ruby/pull/7601
2023-03-06s/MJIT/RJIT/Takashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/7462
2023-03-03Expand the test directory to real pathNobuyoshi Nakada
When the test source directory path contains symbolic links, that directory might be placed earlier in the result of `IRB::InputCompletor.retrieve_gem_and_system_load_path`, than other directories in the source tree that are expanded to the real path. In that case, the test file in "csv" under the test directory of csv gem instead of the library path will be the first candidate, in `TestIRB::TestCompletion#test_complete_require_library_name_first`. ``` <"'csv"> expected but was <"'csv/helper">. ``` Notes: Merged: https://github.com/ruby/ruby/pull/7432
2022-12-22Fix the case trailer without newlineNobuyoshi Nakada
cf0b413ef8b794ef6e7436f22fd5a998050dada9
2022-12-01Use class methods of `File` over `Kernel.open` and `IO.read`Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6834
2022-11-28Fix the case of multiple trailersNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6820
2022-11-28Add tests for sync_default_gems.rbNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6820
2022-08-19Allow strings in assert_pattern_listNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6252
2022-08-18Add tests for assert_pattern_listNobuyoshi Nakada
2022-01-16Let testunit use omit or pend instead of skipNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5453
2021-12-13Prepare for removing RubyVM::JIT (#5262)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2021-11-10Disable experimental warnings in test/runner.rbNobuyoshi Nakada
2021-11-10Mark IO::Buffer as experimental.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/4621
2021-10-17Retry hung up tests verboselyNobuyoshi Nakada
2021-10-17Retry hung tests after parallel runsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4976