Class: Evilution::Runner::MutationExecutor::Neutralizer::InfraError Private

Inherits:
Object
  • Object
show all
Defined in:
lib/evilution/runner/mutation_executor/neutralizer/infra_error.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Reclassify results as :neutral when the failure was caused by test infrastructure rather than by the mutation. Two independent paths:

  1. :error from a missing require / spec_helper / rails_helper / spec/support initialization — detected by error_class ∈ INFRA_ERROR_CLASSES and first backtrace frame matching INFRA_BACKTRACE_PATHS. Origin-only match (not any?): Ruby backtraces typically carry spec_helper frames below mutation-caused errors, so matching any frame would misclassify real mutation NameError/LoadError as :neutral.

  2. :killed from a CrashDetector test_crashed whose sole crash class is in INFRA_CRASH_CLASSES (ActiveRecord::StatementTimeout, Timeout::Error, etc.). These surface under parallel workers sharing a DB file or on a slow CI; fork.rb initially reports them as :killed, and without this demotion the kill count inflates with infra noise. No backtrace check: the single-class signal from CrashDetector already rules out mixed mutation-caused failures. See EV-toid / GH #814.

Instance Method Summary collapse

Instance Method Details

#call(result, **_ctx) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



36
37
38
39
40
41
42
43
# File 'lib/evilution/runner/mutation_executor/neutralizer/infra_error.rb', line 36

def call(result, **_ctx)
  return neutralize(result) if infra_crash?(result)
  return result unless result.error?
  return result unless INFRA_ERROR_CLASSES.include?(result.error_class)
  return result unless infra_origin?(result.error_backtrace)

  neutralize(result)
end