@@ -741,34 +741,37 @@ defmodule Mix.Tasks.TestTest do
741741 """ )
742742
743743 output = mix ( [ "test" , "--dry-run" , "--stale" ] )
744-
745744 assert output =~ "Tests that would be executed:"
746745 assert output =~ "test/a_test_stale.exs:4"
747746 assert output =~ "test/b_test_stale.exs:4"
748747 assert output =~ "test/dry_run_one_test_stale.exs:4"
749748 refute output =~ "test/dry_run_two_test_stale.exs:5"
750749 assert output =~ "1 test, 0 failures, 1 skipped"
751750
752- # Tests are still marked as stale
751+ # Tests should still be marked as stale
753752 output = mix ( [ "test" , "--dry-run" , "--stale" ] )
754753 assert output =~ "1 test, 0 failures, 1 skipped"
755754 end )
756755 end
757756
758757 test "works with --failed" do
759758 in_fixture ( "test_failed" , fn ->
760- _initial_run = mix ( [ "test" ] )
761- output = mix ( [ "test" , "--dry-run" , "--failed" ] )
759+ output = mix ( [ "test" ] )
760+ assert output =~ "4 tests, 2 failures"
762761
762+ output = mix ( [ "test" , "--dry-run" , "--failed" ] )
763763 assert output =~ "Tests that would be executed:"
764764 assert output =~ "test/only_failing_test_failed.exs:4"
765765 assert output =~ "test/passing_and_failing_test_failed.exs:5"
766766 assert output =~ "0 tests, 0 failures"
767767
768- # Tests are still marked as failed
769- output = mix ( [ "test" , "--dry-run" , "failed" ] )
768+ # Force the tests to pass, verify dry-run doesn't actually run them
769+ System . put_env ( "PASS_FAILING_TESTS" , "true" )
770+ output = mix ( [ "test" , "--dry-run" , "--failed" ] )
770771 assert output =~ "0 tests, 0 failures"
771772 end )
773+ after
774+ System . delete_env ( "PASS_FAILING_TESTS" )
772775 end
773776 end
774777
0 commit comments