Class: Pbt::Check::Configuration

Inherits:
Struct
  • Object
show all
Defined in:
lib/pbt/check/configuration.rb

Overview

Configuration for Pbt.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(verbose: false, worker: :ractor, num_runs: 100, seed: Random.new.seed, thread_report_on_exception: false) ⇒ Configuration

Returns a new instance of Configuration.

Parameters:

  • verbose (Boolean) (defaults to: false)

    Whether to print verbose output. Default is ‘false`.

  • worker (Symbol) (defaults to: :ractor)

    The concurrency method to use. :ractor`, ‘:thread`, `:process` and `:none` are supported. Default is `:ractor`.

  • num_runs (Integer) (defaults to: 100)

    The number of runs to perform. Default is ‘100`.

  • seed (Integer) (defaults to: Random.new.seed)

    The seed to use for random number generation. It’s useful to reproduce failed test with the seed you’d pick up from failure messages. Default is a random seed.

  • thread_report_on_exception (Boolean) (defaults to: false)

    Whether to report exceptions in threads. It’s useful to suppress error logs on Ractor that reports many errors. Default is ‘false`.



19
20
21
22
23
24
25
26
27
# File 'lib/pbt/check/configuration.rb', line 19

def initialize(
  verbose: false,
  worker: :ractor,
  num_runs: 100,
  seed: Random.new.seed,
  thread_report_on_exception: false
)
  super
end

Instance Attribute Details

#num_runsObject

Returns the value of attribute num_runs

Returns:

  • (Object)

    the current value of num_runs



6
7
8
# File 'lib/pbt/check/configuration.rb', line 6

def num_runs
  @num_runs
end

#seedObject

Returns the value of attribute seed

Returns:

  • (Object)

    the current value of seed



6
7
8
# File 'lib/pbt/check/configuration.rb', line 6

def seed
  @seed
end

#thread_report_on_exceptionObject

Returns the value of attribute thread_report_on_exception

Returns:

  • (Object)

    the current value of thread_report_on_exception



6
7
8
# File 'lib/pbt/check/configuration.rb', line 6

def thread_report_on_exception
  @thread_report_on_exception
end

#verboseObject

Returns the value of attribute verbose

Returns:

  • (Object)

    the current value of verbose



6
7
8
# File 'lib/pbt/check/configuration.rb', line 6

def verbose
  @verbose
end

#workerObject

Returns the value of attribute worker

Returns:

  • (Object)

    the current value of worker



6
7
8
# File 'lib/pbt/check/configuration.rb', line 6

def worker
  @worker
end