Class: RSpec::FlakeClassifier::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/flake/classifier/configuration.rb,
sig/rspec/flake/classifier.rbs

Constant Summary collapse

DEFAULT_STORE =
".rspec_flake_store"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rspec/flake/classifier/configuration.rb', line 13

def initialize
  @store = DEFAULT_STORE
  @auto_rerun = false
  @deflaker = false
  @rspec_command = nil
  @same_order_runs = 3
  @skip_known_flakes = false
  @coverage_provider = nil
  @changed_lines_provider = nil
  @probe_provider = nil
  @run_sensitivity = false
  @sensitivity_factors = %i[time randomness network]
end

Instance Attribute Details

#auto_rerunbool, Hash[Symbol, untyped]

Returns the value of attribute auto_rerun.

Returns:

  • (bool, Hash[Symbol, untyped])


8
9
10
# File 'lib/rspec/flake/classifier/configuration.rb', line 8

def auto_rerun
  @auto_rerun
end

#changed_lines_providerObject

Returns the value of attribute changed_lines_provider.

Returns:

  • (Object)


8
9
10
# File 'lib/rspec/flake/classifier/configuration.rb', line 8

def changed_lines_provider
  @changed_lines_provider
end

#coverage_providerObject

Returns the value of attribute coverage_provider.

Returns:

  • (Object)


8
9
10
# File 'lib/rspec/flake/classifier/configuration.rb', line 8

def coverage_provider
  @coverage_provider
end

#deflakerBoolean

Returns the value of attribute deflaker.

Returns:

  • (Boolean)


8
9
10
# File 'lib/rspec/flake/classifier/configuration.rb', line 8

def deflaker
  @deflaker
end

#probe_providerObject

Returns the value of attribute probe_provider.

Returns:

  • (Object)


8
9
10
# File 'lib/rspec/flake/classifier/configuration.rb', line 8

def probe_provider
  @probe_provider
end

#rspec_commandArray[String]?

Returns the value of attribute rspec_command.

Returns:

  • (Array[String], nil)


8
9
10
# File 'lib/rspec/flake/classifier/configuration.rb', line 8

def rspec_command
  @rspec_command
end

#run_sensitivityBoolean

Returns the value of attribute run_sensitivity.

Returns:

  • (Boolean)


8
9
10
# File 'lib/rspec/flake/classifier/configuration.rb', line 8

def run_sensitivity
  @run_sensitivity
end

#same_order_runsInteger

Returns the value of attribute same_order_runs.

Returns:

  • (Integer)


8
9
10
# File 'lib/rspec/flake/classifier/configuration.rb', line 8

def same_order_runs
  @same_order_runs
end

#sensitivity_factorsArray[Symbol]

Returns the value of attribute sensitivity_factors.

Returns:

  • (Array[Symbol])


8
9
10
# File 'lib/rspec/flake/classifier/configuration.rb', line 8

def sensitivity_factors
  @sensitivity_factors
end

#skip_known_flakesBoolean

Returns the value of attribute skip_known_flakes.

Returns:

  • (Boolean)


8
9
10
# File 'lib/rspec/flake/classifier/configuration.rb', line 8

def skip_known_flakes
  @skip_known_flakes
end

#storeString

Returns the value of attribute store.

Returns:

  • (String)


8
9
10
# File 'lib/rspec/flake/classifier/configuration.rb', line 8

def store
  @store
end

Instance Method Details

#auto_rerun_attemptsInteger

Returns:

  • (Integer)


27
28
29
30
31
32
33
# File 'lib/rspec/flake/classifier/configuration.rb', line 27

def auto_rerun_attempts
  return same_order_runs unless auto_rerun.is_a?(Hash)

  Integer(auto_rerun.fetch(:failures, same_order_runs))
rescue ArgumentError, TypeError
  same_order_runs
end

#store_pathString

Returns:

  • (String)


35
36
37
# File 'lib/rspec/flake/classifier/configuration.rb', line 35

def store_path
  store.to_s.empty? ? DEFAULT_STORE : store.to_s
end