1. 23 5月, 2017 1 次提交
  2. 07 4月, 2017 1 次提交
  3. 05 3月, 2017 1 次提交
    • R
      Avoid running system tests by default · 4a77213e
      Robin Dupret 提交于
      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.
      4a77213e
  4. 03 3月, 2017 1 次提交
  5. 24 2月, 2017 1 次提交
  6. 21 2月, 2017 1 次提交
  7. 04 2月, 2017 1 次提交
  8. 24 1月, 2017 1 次提交
  9. 29 10月, 2016 1 次提交
  10. 07 8月, 2016 1 次提交
  11. 25 4月, 2016 1 次提交
  12. 24 2月, 2016 1 次提交
  13. 23 2月, 2016 1 次提交
  14. 15 2月, 2016 2 次提交
    • Y
      test runner, relay minitest information about the error location. · 07e422f5
      Yves Senn 提交于
      This is a follow-up to ea70c295 to bring back the assertion error
      location information provided by minitest.
      07e422f5
    • Y
      Revert "Prefer Minitest's location for test failures." · ea70c295
      Yves Senn 提交于
      This reverts commit 0db31058.
      
      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.
      ea70c295
  15. 06 2月, 2016 1 次提交
    • K
      Fix mixing line filters with Minitest's -n filter. · 84b72a81
      Kasper Timm Hansen 提交于
      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.
      84b72a81
  16. 04 2月, 2016 2 次提交
    • K
      Fix model test path typo uncovered in previous commit. · d10b48dd
      Kasper Timm Hansen 提交于
      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.
      d10b48dd
    • K
      Fix line filters running tests from multiple runnables. · e4f06081
      Kasper Timm Hansen 提交于
      `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.
      e4f06081
  17. 24 1月, 2016 1 次提交
  18. 19 1月, 2016 1 次提交
    • K
      Don't run all tests when files end in a colon. · 88881d2b
      Kasper Timm Hansen 提交于
      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 :)
      88881d2b
  19. 13 1月, 2016 1 次提交
  20. 11 1月, 2016 1 次提交
  21. 06 1月, 2016 1 次提交
    • Y
      make generated controller test work correctly · 229064cf
      yuuji.yaginuma 提交于
      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.
      229064cf
  22. 21 12月, 2015 1 次提交
    • Y
      display detailed information in inline reporting · 4f8c36ab
      yuuji.yaginuma 提交于
      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
      ```
      4f8c36ab
  23. 13 11月, 2015 1 次提交
    • K
      Prefer Minitest's location for test failures. · 0db31058
      Kasper Timm Hansen 提交于
      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
      
      ........
      ```
      0db31058
  24. 08 10月, 2015 2 次提交
    • K
      Refactor create_test_file to take a pass option. · 11a3e022
      Kasper Timm Hansen 提交于
      Lets us cut the verbose and straight up duplicated setup in 3 tests down to one line.
      11a3e022
    • K
      Hide Minitest's aggregated results if outputting inline. · da832016
      Kasper Timm Hansen 提交于
      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
      ```
      da832016
  25. 29 9月, 2015 2 次提交
    • K
      Add fail fast to test runner. · 2310fb9d
      Kasper Timm Hansen 提交于
      Passing `--fail-fast` to the test runner will now abort the test run
      on the first failure. The run continues on any unexpected errors.
      2310fb9d
    • K
      Add inline failure reporting to test runner. · 64a3b09b
      Kasper Timm Hansen 提交于
      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.
      64a3b09b
  26. 07 9月, 2015 1 次提交
  27. 03 8月, 2015 2 次提交
    • Y
      Revert "test runner should crash with non existing file argument." · bc3956c0
      Yves Senn 提交于
      This reverts commit 465f0fbc.
      
      This breaks some cases where non file / directory arguments are passed
      to the runner (for example db:migrate).
      
      I still think that we can get this to work. From what I can tell there
      is no reason why db:migrate is passed along to `Minitest.run`. I'll
      revert and investigate possible solutions.
      bc3956c0
    • Y
      test runner should crash with non existing file argument. · 465f0fbc
      Yves Senn 提交于
      Before this patch, using `bin/rails test` with a non existing
      file or directory argument would silently swallow the argument and
      run the whole test suite.
      
      After the patch the command fails with `cannot load such file --`.
      465f0fbc
  28. 30 6月, 2015 1 次提交
  29. 05 6月, 2015 1 次提交
    • K
      Improve test runner's Minitest integration. · b6fc8e25
      Kasper Timm Hansen 提交于
      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/
      b6fc8e25
  30. 18 3月, 2015 2 次提交
  31. 30 1月, 2015 1 次提交
  32. 15 9月, 2014 1 次提交
  33. 07 5月, 2013 1 次提交
    • R
      Updates to make rails 4 happy with minitest 5: · 3073c531
      Ryan Davis 提交于
      + 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.
      3073c531
  34. 06 4月, 2013 1 次提交