Skip to content

Commit 6ec2384

Browse files
committed
Allow test command invocations to exit failure
Minitest will now exit 1 when a `-n` type test filter is used and no test cases end up being run. However, these tests are not really concerned with the exit code, just that `test:prepare` doesn't run. This commit adds `allow_failure: true` to the test command invocations so that we can continue to test whether `test:prepare` is run without caring about the exit status of the test command.
1 parent f12bbb6 commit 6ec2384

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

railties/test/commands/test_test.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,23 @@ class Rails::Command::TestTest < ActiveSupport::TestCase
4141

4242
test "test command with name option skips test:prepare task" do
4343
assert_skips_prepare_task do
44-
run_test_command("test", "-n", "test_some_code")
44+
run_test_command("test", "-n", "test_some_code", allow_failure: true)
4545
end
4646

4747
assert_skips_prepare_task do
48-
run_test_command("test", "-n", "/some_code/")
48+
run_test_command("test", "-n", "/some_code/", allow_failure: true)
4949
end
5050

5151
assert_skips_prepare_task do
52-
run_test_command("test", "-n", "some code")
52+
run_test_command("test", "-n", "some code", allow_failure: true)
5353
end
5454

5555
assert_skips_prepare_task do
56-
run_test_command("test", "--name", "test_some_code")
56+
run_test_command("test", "--name", "test_some_code", allow_failure: true)
5757
end
5858

5959
assert_skips_prepare_task do
60-
run_test_command("test", "--name=test_some_code")
60+
run_test_command("test", "--name=test_some_code", allow_failure: true)
6161
end
6262
end
6363

@@ -74,7 +74,7 @@ class Rails::Command::TestTest < ActiveSupport::TestCase
7474

7575
test "test:all with name option skips test:prepare task" do
7676
assert_skips_prepare_task do
77-
run_test_command("test:all", "-n", "test_some_code")
77+
run_test_command("test:all", "-n", "test_some_code", allow_failure: true)
7878
end
7979
end
8080

@@ -86,7 +86,7 @@ class Rails::Command::TestTest < ActiveSupport::TestCase
8686

8787
test "test:* with name option skips test:prepare task" do
8888
assert_skips_prepare_task do
89-
run_test_command("test:models", "-n", "test_some_code")
89+
run_test_command("test:models", "-n", "test_some_code", allow_failure: true)
9090
end
9191
end
9292

0 commit comments

Comments
 (0)