@@ -719,8 +719,8 @@ defmodule Mix.Tasks.TestTest do
719
719
describe "--dry-run" do
720
720
test "works with --stale" do
721
721
in_fixture ( "test_stale" , fn ->
722
- File . write! ( "test/dry_run_test_stale .exs" , """
723
- defmodule DryRunTest do
722
+ File . write! ( "test/dry_run_one_test_stale .exs" , """
723
+ defmodule DryRunOneTest do
724
724
use ExUnit.Case
725
725
726
726
test "new test" do
@@ -729,11 +729,29 @@ defmodule Mix.Tasks.TestTest do
729
729
end
730
730
""" )
731
731
732
+ File . write! ( "test/dry_run_two_test_stale.exs" , """
733
+ defmodule DryRunTwoTest do
734
+ use ExUnit.Case
735
+
736
+ @tag :skip
737
+ test "skipped test" do
738
+ assert true
739
+ end
740
+ end
741
+ """ )
742
+
732
743
output = mix ( [ "test" , "--dry-run" , "--stale" ] )
733
744
734
- assert output =~ "Test dry run:"
735
- assert output =~ "test/dry_run_test_stale.exs:4"
736
- assert output =~ "0 tests, 0 failures (dry run)"
745
+ assert output =~ "Tests that would be executed:"
746
+ assert output =~ "test/a_test_stale.exs:4"
747
+ assert output =~ "test/b_test_stale.exs:4"
748
+ assert output =~ "test/dry_run_one_test_stale.exs:4"
749
+ refute output =~ "test/dry_run_two_test_stale.exs:5"
750
+ assert output =~ "1 test, 0 failures, 1 skipped"
751
+
752
+ # Tests are still marked as stale
753
+ output = mix ( [ "test" , "--dry-run" , "--stale" ] )
754
+ assert output =~ "1 test, 0 failures, 1 skipped"
737
755
end )
738
756
end
739
757
@@ -742,9 +760,14 @@ defmodule Mix.Tasks.TestTest do
742
760
_initial_run = mix ( [ "test" ] )
743
761
output = mix ( [ "test" , "--dry-run" , "--failed" ] )
744
762
745
- assert output =~ "Test dry run:"
763
+ assert output =~ "Tests that would be executed:"
764
+ assert output =~ "test/only_failing_test_failed.exs:4"
746
765
assert output =~ "test/passing_and_failing_test_failed.exs:5"
747
- assert output =~ "0 tests, 0 failures (dry run)"
766
+ assert output =~ "0 tests, 0 failures"
767
+
768
+ # Tests are still marked as failed
769
+ output = mix ( [ "test" , "--dry-run" , "failed" ] )
770
+ assert output =~ "0 tests, 0 failures"
748
771
end )
749
772
end
750
773
end
0 commit comments