Merge pull request #808 from mbj/improve/isolation-reporting

Change to always report isolation errors
This commit is contained in:
Markus Schirp 2018-12-23 14:02:18 +00:00 committed by GitHub
commit bf41c47a31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 15 deletions

View file

@ -25,7 +25,6 @@ module Mutant
%s
Unparsed Source:
%s
Test Result:
MESSAGE
NO_DIFF_MESSAGE = <<~'MESSAGE'
@ -47,7 +46,6 @@ module Mutant
---- Noop failure -----
No code was inserted. And the test did NOT PASS.
This is typically a problem of your specs not passing unmutated.
Test Result:
MESSAGE
FOOTER = '-----------------------'
@ -68,6 +66,8 @@ module Mutant
# @return [undefined]
def print_details
__send__(MAP.fetch(mutation.class))
visit_isolation_result unless isolation_result.success?
end
# Evil mutation details
@ -101,7 +101,6 @@ module Mutant
# @return [String]
def noop_details
info(NOOP_MESSAGE)
visit_isolation_result
end
# Neutral details
@ -109,7 +108,6 @@ module Mutant
# @return [String]
def neutral_details
info(NEUTRAL_MESSAGE, original_node.inspect, mutation.source)
visit_isolation_result
end
# Visit failed test results

View file

@ -6,7 +6,27 @@ RSpec.describe Mutant::Reporter::CLI::Printer::MutationResult do
let(:reportable) { mutation_a_result }
describe '.call' do
context 'failed kill' do
context 'isolation problem' do
let(:status) do
instance_double(Process::Status)
end
let(:mutation_a_isolation_result) do
Mutant::Isolation::Fork::ChildError.new(status)
end
it_reports(<<~'REPORT')
evil:subject-a:d27d2
@@ -1,2 +1,2 @@
-true
+false
Killfork exited nonzero. Its result (if any) was ignored:
#<InstanceDouble(Process::Status) (anonymous)>
-----------------------
REPORT
end
context 'unsucessful result' do
with(:mutation_a_test_result) { { passed: true } }
context 'on evil mutation' do
@ -80,11 +100,6 @@ RSpec.describe Mutant::Reporter::CLI::Printer::MutationResult do
s(:true)
Unparsed Source:
true
Test Result:
- 1 @ runtime: 1.0
- test-a
Test Output:
mutation a test result output
-----------------------
REPORT
end
@ -101,11 +116,6 @@ RSpec.describe Mutant::Reporter::CLI::Printer::MutationResult do
---- Noop failure -----
No code was inserted. And the test did NOT PASS.
This is typically a problem of your specs not passing unmutated.
Test Result:
- 1 @ runtime: 1.0
- test-a
Test Output:
mutation a test result output
-----------------------
REPORT
end