| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
```
Minitest.run_via[:rails] = true
```
👆 would break because a simple alias won't catch the second
true argument there.
|
|
|
|
|
|
|
| |
Replaces the rake_patterns instance variable with simple require, as
`autorun` will run tests from all eagerly required test files.
Fixes #27801
|
| |
|
| |
|
|
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
creating all databases mutates the connection pool. This patch restores
the connection pool to the connection spec established before creating
all databases. Fixes #23279
|
|
|
|
|
| |
We should be able to pass options to minitest via TESTOPTS environment
variable
|
|
|
|
|
| |
This is a follow-up to ea70c29 to bring back the assertion error
location information provided by minitest.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 0db310586ac3e15be95d2ef27ff40cfa24c05c10.
Closes #23686.
Conflicts:
railties/test/application/test_runner_test.rb
It's possible that the `result.location` returned by minitest is outside
the test file itself. For example in the case of mocha. This resulted in
bad rerun snipptets:
```
bin/rails test app/models/deliveries/delivery.rb:103
```
Let's always use the first line of the failed test-case in our rerun
snippet. We can display the line number of the assertion error elsewhere.
|
|
|
|
|
|
|
|
|
|
|
| |
Previous commit accidentally broke mixing line filters with string -n filter.
Fix by checking if it is a string and returning it.
We also need to ensure the -n filter carry forward into any other composite filters.
Fix by letting the named filter be extractable, so we'll keep this for the next runnable's
run.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Because of the expanding whitelist for test filters, this test ended up
running the tests on lines 4 and 9 in the post test even though the path
wasn't right.
Happened incidentally because the same line numbers were used in both
account and post test.
Add the .rb line so the file is required correctly and the filters are
applied.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`derive_regexp` was written with the assumption that we were run from a
blank slate — that if the filter didn't match we might as well return it
because it was nil.
This isn't the case because minitest calls `run` on every runnable. Which
is any subclass of Minitest::Runnable, such as ActiveSupport::TestCase,
ActionDispatch::IntegrationTest as well as any inheriting from those.
Thus after the first `run` we'd have put in a composite filter in
`options[:filter]` making the next `run` create a linked list when it
failed to match the regexp and put the composite filter as the head.
Every runnable would accumulate more and more of the same filters,
which effectively acted like an expanding whitelist and we ran tests
from other runnables.
Clog the accumulation by returning nil if there's no filter to derive
a regexp from.
Note: we pass a seed in the tests because Minitest shuffles the runnables
to ensure the whitelist is expanded enough that the failure is triggered.
|
|
|
|
|
|
| |
everywhere(the default behaviour now) instead of mix of /bin/rake /bin/rails everywhere
[Ryo Hashimoto & Vipul A M]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If running `bin/rails t test/models/bunny_test.rb:` we'd implicitly run all the
tests in the bunny test. I now highly doubt that people would ever put in a line
filter without a line *and* want that to mean run all tests in that file.
Instead, change regex to require a line digit after the colon, so runs without a
line at the end would fail to require the test file.
This also has the side benefit of breaking requiring a file with many colons:
`bin/rails t test/models/bunny_test.rb:::::::::::::4`
Think this means I've had enough colonoscopy to last me through the year :)
|
|
|
|
|
|
|
| |
Closes #23027.
This does not restore complete backwards compatibility. It simply passes
the contets of the `TEST` env to the new runner.
|
| |
|
|
|
|
|
|
|
| |
Since the `#file_name` that not consideration for the namespace, if generate a controller with a namespace,
not the correct url helper generation, it had become an error to run the test.
Modified to generate the correct url helper, even if it is produced a namespace with controller.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
........
```
|
|
|
|
| |
Lets us cut the verbose and straight up duplicated setup in 3 tests down to one line.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
```
|
|
|
|
|
| |
Passing `--fail-fast` to the test runner will now abort the test run
on the first failure. The run continues on any unexpected errors.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
We recommend using the `bin/` executables in our docs and guides.
Let's make sure that our tests execute the same code path.
|
|
|
|
|
|
|
|
|
|
|
| |
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/
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
+ 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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Using regexps as arguments without parentheses end up raising:
warning: ambiguous first argument; put parentheses or even spaces
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
I forgot to run the test suit after changing the task name. :bomb:
|
| |
|
| |
|
|
|
|
|
|
| |
* `rails test -f` will run the test suites with all fixtures loaded
* New application will now generated without `fixtures :all` line
enabled by default.
|
|
|
|
|
| |
Any flags that got set will be passed through to MiniTest::Unit.runner,
such as `-n`, `-s-, and `-v`.
|
|
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.
|