aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/test_unit/minitest_plugin.rb
Commit message (Collapse)AuthorAgeFilesLines
* Allow to receive arbitrary arguments in `aggregated_results`yuuji.yaginuma2017-05-101-1/+1
| | | | | Argument was added to `aggregated_results` in minitest 5.10.2. Ref: https://github.com/seattlerb/minitest/commit/c6ba2afd90473b76d289562edd24f7d7ca8484f9
* Avoid running system tests by defaultRobin Dupret2017-03-051-3/+9
| | | | | | | | | | These tests may be expansive so let's only allow users to run them through `bin/rails test:system` or by passing a path to the `test` command. The same applies for `bin/rake test`. Refs #28109.
* Fix run_via[]= backwards compatibility.Kasper Timm Hansen2017-02-211-1/+3
| | | | | | | | | ``` Minitest.run_via[:rails] = true ``` 👆 would break because a simple alias won't catch the second true argument there.
* Prevent multiple values being set to `run_via`yuuji.yaginuma2017-02-181-5/+29
| | | | | When executing the test via rake, since `rake` is set for `run_via`, `ruby` should not be set. Related 2cb6c27310452da11b93d729c3b760ce988106e1
* Collect all file patterns when running multiple rake test tasksDominic Cleal2017-02-041-7/+7
| | | | | | | Replaces the rake_patterns instance variable with simple require, as `autorun` will run tests from all eagerly required test files. Fixes #27801
* add warnings option to test runneryuuji.yaginuma2017-01-241-0/+5
|
* Use autorun when running via Rake.Kasper Timm Hansen2016-09-251-3/+13
| | | | | | | Makes sure we get support for `Minitest.after_run` hooks and don't accidentally run tests twice. Requires overriding minitest `run` to respect the TESTOPTS variable.
* Revise setting of run_with_rails_extension.Kasper Timm Hansen2016-09-251-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | The Rails test runner supports three ways to run tests: directly, via rake, or ruby. When Running with Ruby ala `ruby -Itest test/models/post_test.rb` our test file would be evaluated first, requiring `test_helper` and then `active_support/testing/autorun` that would then require the test file (which it hadn't been before) thus reevaluating it. This caused exceptions if using Active Support's declarative syntax. Fix this by shifting around when we set the how we're run to closer mimick the require order. If we're running with `bin/rails test` the test command file is run first and we then set `run_with_rails_extension`, later we hit `active_support/testing/autorun` and do nothing — because we've been run elsewhere. If we at this point haven't set `run_with_rails_extension` we've been running with `ruby` this whole time and thus we set that. We should always trigger `Minitest.autorun` as it doesn't hurt to call it twice. Consolidate the two methods into a single one that better brings out the intent of why they're there.
* applies new string literal convention in railties/libXavier Noria2016-08-061-3/+3
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* remove unnessary option setting from test runneryuuji.yaginuma2016-04-251-5/+2
| | | | | | | If run the test over the `rake` command, because of the test patterns is passed via `rake_run` method, do not need to be obtained from the argv. This probably fixes #24372.
* [ci skip] Improve comment minitest plugin initialization.Kasper Timm Hansen2016-03-221-2/+4
| | | | | Didn't feel we were clear enough about our motivation for placing Rails first and why we needed to call `load_plugins`.
* Don't get ahead of ourselves.Kasper Timm Hansen2016-03-221-3/+3
| | | | The useless explicit self calls were driving me nuts.
* Set Rails as the first minitest initialized plugin.Kasper Timm Hansen2016-03-221-1/+3
| | | | | | | | | | | When calling `load_plugins` minitest would fill out its extensions, then we'd tackle ourselves on as the last plugin. Because minitest loads plugins in order we will ultimately have the last say on what reporters will be used. Invert that strategy by putting ourselves first and give other plugins plenty of leeway to override our default reporter setup. Fixes #24179.
* make sure `rake test` respects TESTOPTSAaron Patterson2016-02-221-1/+2
| | | | | We should be able to pass options to minitest via TESTOPTS environment variable
* [ci skip] Mention testing fore-runners.Kasper Timm Hansen2016-02-211-0/+2
| | | | Get it? ( ͡° ͜ʖ ͡°)
* modify to `error` also abort when specify fail fast optionyuuji.yaginuma2016-02-171-1/+1
|
* delete only unnecessary reporteryuuji.yaginuma2016-01-111-1/+2
| | | | | Reporter that defines its own users at the time of this process are also loaded, to avoid them from being deleted, to delete only the specified to unnecessary reporter.
* Rewrite aggregated results suppression.Kasper Timm Hansen2015-12-231-10/+4
| | | | | | | | I should have replaced the summary reporter with a subclass the first time I wrote this. For whatever reason, I didn't. Do it right and slim the methods added to Minitest in the process.
* [ci skip] Clarify why we're clearing reporters.Kasper Timm Hansen2015-12-231-1/+1
| | | | | | Minitest by default includes a summary reporter and a progress reporter. To print colored output, we have to replace the progress reporter.
* Add colored output to the new test reporter.Lucas Mazza2015-12-221-0/+8
|
* Fix #22232: rake test tasks exit status codeArkadiusz Fal2015-12-071-1/+3
| | | | | | | The exit status code was not set when tests were fired with `rake`. Now, it is being set and it matches behavior of running tests via `rails` command (`rails test`), so no matter if `rake test` or `rails test` command is used the exit code will be set.
* allow use of minitest-rails gem with test runnerChris Kottom2015-11-301-1/+1
|
* add `bin/test` script to rails pluginyuuji.yaginuma2015-11-281-3/+4
|
* Hide Minitest's aggregated results if outputting inline.Kasper Timm Hansen2015-10-071-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We'd see the failures and errors reported after the run, which is needless, when we've already reported them. Turns: ``` .......................................S....................F This failed bin/rails test test/models/bunny_test.rb:14 .... Finished in 0.100886s, 1020.9583 runs/s, 1001.1338 assertions/s. 2) Failure: BunnyTest#test_something_failing [/Users/kasperhansen/Documents/code/collection_caching_test/test/models/bunny_test.rb:15]: This failed 103 runs, 101 assertions, 1 failures, 0 errors, 1 skips You have skipped tests. Run with --verbose for details. ``` Into: ``` ...................S.......................................F This failed bin/rails test test/models/bunny_test.rb:14 ...................... Finished in 0.069910s, 1473.3225 runs/s, 1444.7143 assertions/s. 103 runs, 101 assertions, 1 failures, 0 errors, 1 skips ```
* Add fail fast to test runner.Kasper Timm Hansen2015-09-291-0/+5
| | | | | Passing `--fail-fast` to the test runner will now abort the test run on the first failure. The run continues on any unexpected errors.
* Add inline failure reporting to test runner.Kasper Timm Hansen2015-09-281-0/+7
| | | | | | | | | Any failures or errors will be reported inline during the run by default. Skipped tests will be reported if run in verbose mode. Any result is output with failure messages and a rerun snippet for that test. Rerun snippets won't be output after a run, unless `--defer-output` is passed.
* check if @rake_patterns is definedyuuji.yaginuma2015-09-281-1/+2
| | | | | | | This removes the following warning. ``` railties/lib/rails/test_unit/minitest_plugin.rb:45: warning: instance variable @rake_patterns not initialize ```
* modify to pass the correct argument to the test runner from rakeyuuji.yaginuma2015-09-081-1/+10
| | | | | | | | test runner sets file to be tested in plugin_rails_options, but in plugin_rails_options, processing has been made to the argument of the actual command rather than the argument of Minitest.run. For example, if you run `./bin rake db:migrate test`, the options[:patterns], `db:migrate test` was incorrectly set.
* make `ENV` a required argumentyuuji.yaginuma2015-08-291-1/+1
|
* Allow Minitest to load plugins. Fixes #21102Oleg Sukhodolsky2015-08-031-0/+1
|
* Avoid crashing when minitest-rails is loaded.Victor Costan2015-07-011-3/+3
| | | | | | | | The improvments to the test runner's integration with minitest in commit b6fc8e25a10cc4abdd03018798b180270d6c5d7f add methods to the Minitest module that refer to the Rails module. Unfortunately, when the minitest-rails gem is loaded, the reference is incorrectly resolved to the Minitest::Rails module.
* Improve test runner's Minitest integration.Kasper Timm Hansen2015-06-041-7/+44
| | | | | | | | | | | This also adds free mix and matching of directories, files and lines filters. Like so: bin/rails test models/post_test.rb test/integration models/person_test.rb:26 You can also mix in a traditional Minitest filter: bin/rails test test/integration -n /check_it_out/
* move `ENV["BACKTRACE"]` support into the TestRunner.Yves Senn2015-03-181-2/+1
|
* Move minitest pluginArthur Neves2015-03-181-0/+15
Minitest Rails plugin should be loaded on test_help, so we report errors even when not running from the runner. Also fix the backtrace