aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/test_unit
Commit message (Collapse)AuthorAgeFilesLines
* Extract line filtering to Railties.Kasper Timm Hansen2016-01-092-0/+69
| | | | | | | | | | | | The line filter parsing added to ActiveSupport::TestCase is only half the story to enable line filtering. The other half, of adding the patterns to the options, is done in the Minitest plugin that Railties has. Thus it makes more sense to have the filter in Railties with the other half and all the line filtering tests. Move the filter and extend Active Support in an initializer, so that when users or `rails/all.rb` require `rails/test_unit/railtie` we can still filter by line.
* Move test coloring closer to where it's used.Kasper Timm Hansen2015-12-231-15/+9
| | | | | | | | | | | Didn't like the constant being at the top of the file, gave it overdue importance. Now that `color_output` expects a result we can shorten some of the flexibility from earlier: * Inline COLOR_CODES constant (keep local variable for readability, but don't need names of colors at run time). * Inline color variable in `color_output`. Looks just as clear without it.
* Remove local variable color.Kasper Timm Hansen2015-12-231-5/+5
| | | | | Focus `color_output`'s intent on coloring output by a result. We aren't meant to pass it arbitrary codes to color output.
* Rename color to color_output.Kasper Timm Hansen2015-12-231-6/+5
| | | | | | The word color is being thrown all around with slightly different meanings. Right now, I understand it. But I'd like to be more immediately clear.
* Remove unused blue color.Kasper Timm Hansen2015-12-231-2/+1
| | | | I got the blues because we aren't coloring any lines blue.
* Color failure line by result code.Kasper Timm Hansen2015-12-231-1/+1
| | | | | | | The static red color wouldn't paint skips in their designated yellow. Use the color name we got from the result label earlier, which marks skips as yellow.
* 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-222-1/+47
|
* display detailed information in inline reportingyuuji.yaginuma2015-12-211-1/+7
| | | | | | | | | | | | | | | | | | | | | The errors message only was not displayed, as if it did not use the inline reporting, modified to also information the method name and the like in error are displayed. ``` # before Failed assertion, no message given. bin/rails test test/models/user_test.rb:5 ``` ``` # after Failure: UserTest#test_the_truth: Failed assertion, no message given. bin/rails test test/models/user_test.rb:5 ```
* show relative path the rerun snippet of test runner in rails engineyuuji.yaginuma2015-12-101-1/+5
| | | | | | | | | | | | | Since the absolute path is not required to re-run the test, modified so that unnecessary information is not displayed. ```ruby # before bin/rails test /path/to/blorgh/test/integration/navigation_test.rb:5 # after bin/rails test test/integration/navigation_test.rb:5 ```
* 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
|
* Prefer Minitest's location for test failures.Kasper Timm Hansen2015-11-121-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When running tests, the Rails test runner would report the start of the test method as the test failure. For this test: ```ruby 1 require 'test_helper 2 3 class BunnyTest < ActiveSupport::TestCase 4 test "something failing" do 5 assert false, 'This failed' 6 end 7 end ``` The runner outputs 5 instead of 4: ``` ............................................F This failed bin/rails test test/models/bunny_test.rb:5 ........ ```
* Output inline is set to true in the plugin.Kasper Timm Hansen2015-10-071-1/+1
| | | | | | Change the reporter to just read the option. Pass output_inline where needed in tests.
* 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-292-0/+13
| | | | | 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-282-5/+32
| | | | | | | | | 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-082-6/+15
| | | | | | | | 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.
* raise LoadError when a non-existent file or directory is specified to the ↵yuuji.yaginuma2015-09-071-1/+1
| | | | | | | | test runner Currently, if a file or directory that does not exist was specified in the test runner, that argument is ignored. This commit has been modified to cause an error if there is no file or directory.
* 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.
* do not show "Failed tests" message when a failed test is notyuuji.yaginuma2015-06-231-3/+9
|
* make it possible to customize the executable inside rereun snippets.Yves Senn2015-06-131-1/+5
| | | | | | | | | | | | | | | | | | | In the Rails repository we use a `bin/test` executable to run our tests. However the rerun snippets still included `bin/rails test`: BEFORE: ``` Failed tests: bin/rails test test/cases/adapters/postgresql/schema_test.rb:91 ``` AFTER: ``` Failed tests: bin/test test/cases/adapters/postgresql/schema_test.rb:91 ```
* Improve test runner's Minitest integration.Kasper Timm Hansen2015-06-045-152/+85
| | | | | | | | | | | 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/
* Remove unused private classesRafael Mendonça França2015-05-031-126/+0
| | | | | | | The usage of these classes where removed at 8017e6af31caa58a58787274ff0ca01397219e49. cc @arthurnn @senny
* Merge pull request #19441 from y-yagi/use_existArthur Nogueira Neves2015-03-211-1/+1
|\ | | | | use `Dir.exist?` instead of deprecated `Dir.exists?`
| * use `Dir.exist?` instead of deprecated `Dir.exists?`yuuji.yaginuma2015-03-211-1/+1
| |
* | Merge pull request #19445 from prathamesh-sonpatki/rm-ostructArthur Nogueira Neves2015-03-211-1/+0
|\ \ | | | | | | Removed requiring ostruct because its unused
| * | Removed requiring ostruct because its unusedPrathamesh Sonpatki2015-03-211-1/+0
| |/
* / Fix typos in test runner's help outputPrathamesh Sonpatki2015-03-211-2/+2
|/
* Use absolute path on find_method location for the runnerArthur Neves2015-03-191-1/+1
|
* Fix test rake when passing multiple argumentsArthur Neves2015-03-191-2/+2
| | | | bundle exec db:migrate rake was not working, with the new runner, before this commit
* Use Rails::TestRunner on rake testArthur Neves2015-03-181-16/+17
|
* Fix reporter test and verbose modeArthur Neves2015-03-181-1/+1
|
* move `ENV["BACKTRACE"]` support into the TestRunner.Yves Senn2015-03-182-3/+2
|
* `-p`, `--pattern` to run tests using a pattern.Yves Senn2015-03-181-0/+4
|
* use `bin/rails t` runner in `test_runner_test.rb`.Yves Senn2015-03-181-2/+2
|
* Fix relative dir call on test runnerArthur Neves2015-03-181-5/+10
|
* Add tests for runner#test_files methodArthur Neves2015-03-181-7/+7
|
* Run multiple files on runnerArthur Neves2015-03-181-4/+5
|
* `-e` / `--environment` for the test runner.Yves Senn2015-03-181-1/+7
|
* move argument parsing into the `Runner`.Yves Senn2015-03-181-0/+5
|
* get rid of NAMED_PATTERNS in favor of running a whole directoryYves Senn2015-03-181-7/+4
|
* document running a test by line number.Yves Senn2015-03-181-0/+7
|
* pluralize rerun snippet heading.Yves Senn2015-03-181-1/+1
|
* Show the right file when test raisesArthur Neves2015-03-181-4/+3
|