1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

28 commits

Author SHA1 Message Date
yuuji.yaginuma
4f8c36ab70 display detailed information in inline reporting
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
```
2015-12-21 07:48:53 +09:00
Kasper Timm Hansen
0db310586a Prefer Minitest's location for test failures.
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

........
```
2015-11-12 21:39:58 +01:00
Kasper Timm Hansen
11a3e02237 Refactor create_test_file to take a pass option.
Lets us cut the verbose and straight up duplicated setup in 3 tests down to one line.
2015-10-07 22:49:41 +02:00
Kasper Timm Hansen
da832016bf Hide Minitest's aggregated results if outputting inline.
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
```
2015-10-07 22:49:41 +02:00
Kasper Timm Hansen
2310fb9d81 Add fail fast to test runner.
Passing `--fail-fast` to the test runner will now abort the test run
on the first failure. The run continues on any unexpected errors.
2015-09-29 08:37:33 +02:00
Kasper Timm Hansen
64a3b09b40 Add inline failure reporting to test runner.
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.
2015-09-28 20:30:03 +02:00
yuuji.yaginuma
084a3908fc raise LoadError when a non-existent file or directory is specified to the 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.
2015-09-07 08:13:50 +09:00
Yves Senn
a8f250a22c tests, railties tests should use bin/ executables when possible.
We recommend using the `bin/` executables in our docs and guides.
Let's make sure that our tests execute the same code path.
2015-06-30 11:19:01 +02:00
Kasper Timm Hansen
b6fc8e25a1 Improve test runner's Minitest integration.
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/
2015-06-04 20:57:08 +02:00
Yves Senn
ac5ead59ae -p, --pattern to run tests using a pattern. 2015-03-18 09:52:19 +01:00
Yves Senn
f78708c180 use bin/rails t runner in test_runner_test.rb. 2015-03-18 09:52:18 +01:00
Yves Senn
1fa7861bc9 tests, use capture instead of custom redirect_stderr helper. 2015-01-30 12:04:57 +01:00
yuuji.yaginuma
14f07fdc07 Add test:jobs task 2014-09-15 09:43:02 +09:00
Ryan Davis
3073c53198 Updates to make rails 4 happy with minitest 5:
+ Namespace changes, overhaul of runners.
+ Internal ivar name changes
- Removed a logger globally applied to tests that spew everywhere?!?
+ Override Minitest#__run to sort tests by name.
+ Reworked testing isolation to work with the new cleaner architecture.
- Removed a bunch of tests that just test minitest straight up. I think these changes were all merged to minitest 4 a long time ago.
- Minor report output differences.
2013-05-06 17:38:45 -07:00
Aaron Patterson
cc0c392c77 add integration test for shorthand rake tests 2013-04-05 17:12:23 -07:00
Aaron Patterson
88cf64a669 extract test info from the command line and set up the test task 2013-04-05 16:38:37 -07:00
Aaron Patterson
c7a148f389 removing rails test, updating docs to show how to use rake test 2013-04-05 15:44:41 -07:00
Aaron Patterson
c037659294 do not blow away the test database on every run 2013-04-05 14:22:29 -07:00
Aaron Patterson
328814b000 switch the testing tests to use rake 2013-04-03 12:16:19 -04:00
Aaron Patterson
62a080309b apps that depend on active record should load fixtures 2013-04-03 12:16:18 -04:00
Carlos Antonio da Silva
816e7d1449 Replace assert_(no_)match args from regexps to strings to remove warnings
Using regexps as arguments without parentheses end up raising:

    warning: ambiguous first argument; put parentheses or even spaces
2013-03-11 15:54:43 -03:00
Prem Sichanugrist
773425420f Make sure that the test case is run under test env
* Unset $RAILS_ENV that got set by abstract_unit to trigger the default.
* split out environment setting since Ruby 1.9.3 doesn't support inline
  ENV setting.
2013-03-11 14:31:27 -04:00
Prem Sichanugrist
1f8953382f Fix test failure introduced in 3ed41e57
I forgot to run the test suit after changing the task name. 💣
2013-03-11 11:58:36 -04:00
Prem Sichanugrist
3ed41e579e Make sure that rails test load test in test env 2013-03-09 17:38:39 -05:00
Dalibor Nasevic
df85dfa6fa Improve wording for rails test command 2013-03-09 16:03:55 -05:00
Prem Sichanugrist
1a0c58b298 Load fixtures only when running suites, or -f
* `rails test -f` will run the test suites with all fixtures loaded
* New application will now generated without `fixtures :all` line
  enabled by default.
2013-03-09 16:03:55 -05:00
Prem Sichanugrist
176b57c543 Add support for MiniTest flags in TestRunner
Any flags that got set will be passed through to MiniTest::Unit.runner,
such as `-n`, `-s-, and `-v`.
2013-03-09 16:03:55 -05:00
Prem Sichanugrist and Chris Toomey
b4df25366a Add rails test command to run the test suite
To run the whole test suite:

    $ rails test

To run the test file(s):

    $ rails test test/unit/foo_test.rb [test/unit/bar_test.rb ...]

To run the test suite

    $ rails test [models,helpers,units,controllers,mailers,...]

For more information, see `rails test --help`.

This command will eventually replacing `rake test:*`, and `rake test`
command will actually invoking `rails test` instead.
2013-03-09 16:03:54 -05:00