File tree Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -116,8 +116,7 @@ defmodule Mix.Tasks.Test do
116
116
* `--export-coverage` - the name of the file to export coverage results to.
117
117
Only has an effect when used with `--cover`
118
118
119
- * `--failed` - runs only tests that failed the last time they ran.
120
- If there are no pending --failed tests, `mix test` will run all available tests
119
+ * `--failed` - runs only tests that failed the last time they ran
121
120
122
121
* `--force` - forces compilation regardless of modification times
123
122
@@ -713,13 +712,7 @@ defmodule Mix.Tasks.Test do
713
712
end
714
713
715
714
{ allowed_files , failed_ids } = ExUnit.Filters . failure_info ( manifest_file )
716
-
717
- if MapSet . size ( failed_ids ) == 0 do
718
- Mix . shell ( ) . info ( "No pending --failed tests, re-running all available tests..." )
719
- { opts , nil }
720
- else
721
- { Keyword . put ( opts , :only_test_ids , failed_ids ) , allowed_files }
722
- end
715
+ { Keyword . put ( opts , :only_test_ids , failed_ids ) , allowed_files }
723
716
else
724
717
{ opts , nil }
725
718
end
Original file line number Diff line number Diff line change @@ -215,13 +215,8 @@ defmodule Mix.Tasks.TestTest do
215
215
System . put_env ( "PASS_FAILING_TESTS" , "true" )
216
216
assert mix ( [ "test" , "--failed" ] ) =~ "2 tests, 0 failures"
217
217
218
- # All tests should be run if we try it again with no failing tests.
219
- # This prevents `mix test --failed` from passing in cases where
220
- # `mix test` had a compilation error before having failing tests.
221
- # It also provides a better workflow as you can always run with --failed.
222
- output = mix ( [ "test" , "--failed" ] )
223
- assert output =~ "No pending --failed tests, re-running all available tests..."
224
- assert output =~ "4 tests, 0 failures"
218
+ # Nothing should get run if we try it again since everything is passing.
219
+ assert mix ( [ "test" , "--failed" ] ) =~ "There are no tests to run"
225
220
226
221
# `--failed` and `--stale` cannot be combined
227
222
output = mix ( [ "test" , "--failed" , "--stale" ] )
You can’t perform that action at this time.
0 commit comments