Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report noise reduction #1117

Merged
merged 3 commits into from
Nov 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions lib/mutant.rb
Original file line number Diff line number Diff line change
@@ -183,12 +183,9 @@ module Mutant
require 'mutant/reporter/cli/printer/env_progress'
require 'mutant/reporter/cli/printer/env_result'
require 'mutant/reporter/cli/printer/isolation_result'
require 'mutant/reporter/cli/printer/mutation_progress_result'
require 'mutant/reporter/cli/printer/mutation_result'
require 'mutant/reporter/cli/printer/status_progressive'
require 'mutant/reporter/cli/printer/subject_progress'
require 'mutant/reporter/cli/printer/subject_result'
require 'mutant/reporter/cli/printer/test_result'
require 'mutant/reporter/cli/format'
require 'mutant/repository'
require 'mutant/repository/diff'
37 changes: 5 additions & 32 deletions lib/mutant/reporter/cli/printer/isolation_result.rb
Original file line number Diff line number Diff line change
@@ -36,18 +36,8 @@ class IsolationResult < self
```
MESSAGE

FORK_ERROR_MESSAGE = <<~'MESSAGE'
Forking the child process to isolate the mutation in failed.
This meant that either the RubyVM or your OS was under too much
pressure to add another child process.

Possible solutions are:
* Reduce concurrency
* Reduce locks
MESSAGE

TIMEOUT_ERROR_MESSAGE =<<~'MESSAGE'
Mutation analysis ran into the configured timeout of %02.9<timeout>g seconds.
Mutation analysis ran into the configured timeout of %0.9<timeout>g seconds.
MESSAGE

private_constant(*constants(false))
@@ -57,19 +47,13 @@ class IsolationResult < self
# @return [undefined]
def run
print_timeout
print_tests
print_process_status
print_log_messages
print_exception
end

private

def print_tests
value = object.value or return
visit(TestResult, value)
end

def print_log_messages
log = object.log

@@ -82,19 +66,15 @@ def print_log_messages
end
end

# rubocop:disable Style/GuardClause
def print_process_status
process_status = object.process_status or return

unless process_status.success?
puts(PROCESS_ERROR_MESSAGE % object.process_status.inspect)
if process_status.success?
puts("Killfork: #{process_status.inspect}")
else
puts(PROCESS_ERROR_MESSAGE % process_status.inspect)
end
end
# rubocop:enable Style/GuardClause

def visit_fork_error
puts(FORK_ERROR_MESSAGE)
end

def print_timeout
timeout = object.timeout or return
@@ -111,13 +91,6 @@ def print_exception
]
)
end

def visit_chain
printer = self.class

visit(printer, object.value)
visit(printer, object.next)
end
end # IsolationResult
end # Printer
end # CLI
28 changes: 0 additions & 28 deletions lib/mutant/reporter/cli/printer/mutation_progress_result.rb

This file was deleted.

7 changes: 1 addition & 6 deletions lib/mutant/reporter/cli/printer/mutation_result.rb
Original file line number Diff line number Diff line change
@@ -61,8 +61,7 @@ def run
private

def print_details
visit_isolation_result
puts(SEPARATOR)
visit(IsolationResult, isolation_result)
__send__(MAP.fetch(mutation.class))
end

@@ -94,10 +93,6 @@ def neutral_details
info(NEUTRAL_MESSAGE, original_node.inspect, mutation.source)
end

def visit_isolation_result
visit(IsolationResult, isolation_result)
end

def original_node
mutation.subject.node
end
58 changes: 0 additions & 58 deletions lib/mutant/reporter/cli/printer/subject_progress.rb

This file was deleted.

29 changes: 0 additions & 29 deletions lib/mutant/reporter/cli/printer/test_result.rb

This file was deleted.

3 changes: 0 additions & 3 deletions spec/unit/mutant/reporter/cli/printer/env_result_spec.rb
Original file line number Diff line number Diff line change
@@ -13,9 +13,6 @@
- test-a
evil:subject-a:d27d2
-----------------------
- 1 @ runtime: 1.0
- test-a
-----------------------
@@ -1 +1 @@
-true
+false
23 changes: 6 additions & 17 deletions spec/unit/mutant/reporter/cli/printer/isolation_result_spec.rb
Original file line number Diff line number Diff line change
@@ -21,10 +21,7 @@

describe '.call' do
context 'on successful isolation' do
it_reports <<~'STR'
- 1 @ runtime: 1.0
- test-a
STR
it_reports ''
end

context 'on exception isolation error' do
@@ -41,8 +38,6 @@ def backtrace
end

it_reports <<~'STR'
- 1 @ runtime: 1.0
- test-a
Killing the mutation resulted in an integration error.
This is the case when the tests selected for the current mutation
did not produce a test result, but instead an exception was raised.
@@ -67,8 +62,6 @@ def backtrace
let(:log) { 'log message' }

it_reports <<~'STR'
- 1 @ runtime: 1.0
- test-a
Log messages (combined stderr and stdout):
[killfork] log message
STR
@@ -80,8 +73,6 @@ def backtrace
end

it_reports <<~'STR'
- 1 @ runtime: 1.0
- test-a
Killfork exited nonzero. Its result (if any) was ignored.
Process status:
#<InstanceDouble(Process::Status) "unsuccessful status">
@@ -90,26 +81,24 @@ def backtrace

context 'on successful process status' do
let(:process_status) do
instance_double(Process::Status, 'unsuccessful status', success?: true)
instance_double(Process::Status, 'successful status', success?: true)
end

it_reports <<~'STR'
- 1 @ runtime: 1.0
- test-a
Killfork: #<InstanceDouble(Process::Status) "successful status">
STR
end

context 'on timeout while process exits successful' do
let(:process_status) do
instance_double(Process::Status, 'unsuccessful status', success?: true)
instance_double(Process::Status, 'successful status', success?: true)
end

let(:timeout) { 2.0 }

it_reports <<~'STR'
Mutation analysis ran into the configured timeout of 02 seconds.
- 1 @ runtime: 1.0
- test-a
Mutation analysis ran into the configured timeout of 2 seconds.
Killfork: #<InstanceDouble(Process::Status) "successful status">
STR
end

This file was deleted.

Loading