Class: SimpleCov::ParallelAdapters::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/simplecov/parallel_adapters/base.rb,
sig/simplecov.rbs

Overview

Default no-op implementations for a parallel-test-runner adapter. Everything not overridden falls back to behaving like a single-process run. Adapters are classes, used as singletons and never instantiated.

Direct Known Subclasses

GenericAdapter, ParallelTestsAdapter

Class Method Summary collapse

Class Method Details

.active?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/simplecov/parallel_adapters/base.rb', line 10

def active?
  false
end

.expected_worker_countInteger

Returns:

  • (Integer)


29
30
31
# File 'lib/simplecov/parallel_adapters/base.rb', line 29

def expected_worker_count
  1
end

.first_worker?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/simplecov/parallel_adapters/base.rb', line 14

def first_worker?
  true
end

.forced_off?Boolean

mutant:disable — false is a singleton, so comparing against it answers the same through ==, eql? and equal?, and no example can tell the three apart.

Returns:

  • (Boolean)


36
37
38
# File 'lib/simplecov/parallel_adapters/base.rb', line 36

def forced_off?
  SimpleCov.parallel_tests == false
end

.native_wait?Boolean

Whether wait_for_siblings blocks until every sibling process has exited, so no further resultset can appear. When true, the reporting worker can accept a settled resultset count below expected_worker_count as final instead of waiting out the whole parallel_wait_timeout.

Returns:

  • (Boolean)


25
26
27
# File 'lib/simplecov/parallel_adapters/base.rb', line 25

def native_wait?
  false
end

.parallel_test_groups_countInteger

Unset, empty, non-numeric, and non-positive values all mean 1: an unparseable value must not yield 0 workers, which would end the sibling wait before it started.

Returns:

  • (Integer)


43
44
45
46
# File 'lib/simplecov/parallel_adapters/base.rb', line 43

def parallel_test_groups_count
  count = Integer(ENV.fetch("PARALLEL_TEST_GROUPS", nil), exception: false)
  count&.positive? ? count : 1
end

.wait_for_siblingsvoid

This method returns an undefined value.



18
19
# File 'lib/simplecov/parallel_adapters/base.rb', line 18

def wait_for_siblings
end