mirror of https://github.com/rails/rails
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.
This commit is contained in:
parent
f12bbb61d1
commit
6ec2384e07
|
@ -41,23 +41,23 @@ class Rails::Command::TestTest < ActiveSupport::TestCase
|
|||
|
||||
test "test command with name option skips test:prepare task" do
|
||||
assert_skips_prepare_task do
|
||||
run_test_command("test", "-n", "test_some_code")
|
||||
run_test_command("test", "-n", "test_some_code", allow_failure: true)
|
||||
end
|
||||
|
||||
assert_skips_prepare_task do
|
||||
run_test_command("test", "-n", "/some_code/")
|
||||
run_test_command("test", "-n", "/some_code/", allow_failure: true)
|
||||
end
|
||||
|
||||
assert_skips_prepare_task do
|
||||
run_test_command("test", "-n", "some code")
|
||||
run_test_command("test", "-n", "some code", allow_failure: true)
|
||||
end
|
||||
|
||||
assert_skips_prepare_task do
|
||||
run_test_command("test", "--name", "test_some_code")
|
||||
run_test_command("test", "--name", "test_some_code", allow_failure: true)
|
||||
end
|
||||
|
||||
assert_skips_prepare_task do
|
||||
run_test_command("test", "--name=test_some_code")
|
||||
run_test_command("test", "--name=test_some_code", allow_failure: true)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -74,7 +74,7 @@ class Rails::Command::TestTest < ActiveSupport::TestCase
|
|||
|
||||
test "test:all with name option skips test:prepare task" do
|
||||
assert_skips_prepare_task do
|
||||
run_test_command("test:all", "-n", "test_some_code")
|
||||
run_test_command("test:all", "-n", "test_some_code", allow_failure: true)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -86,7 +86,7 @@ class Rails::Command::TestTest < ActiveSupport::TestCase
|
|||
|
||||
test "test:* with name option skips test:prepare task" do
|
||||
assert_skips_prepare_task do
|
||||
run_test_command("test:models", "-n", "test_some_code")
|
||||
run_test_command("test:models", "-n", "test_some_code", allow_failure: true)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue