Class: SimpleCov::ParallelAdapters::Base

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

Overview

No-op defaults for a parallel-test-runner adapter: behave like a single-process run. Real adapters subclass and override what they need. The contract methods are class methods; adapters are never instantiated.

Direct Known Subclasses

GenericAdapter, ParallelTestsAdapter

Class Method Summary collapse

Class Method Details

.active?boolish

Should this adapter be selected for the current process? The first registered adapter whose active? returns truthy wins.

Returns:

  • (boolish)


20
21
22
# File 'lib/simplecov/parallel_adapters/base.rb', line 20

def active?
  false
end

.expected_worker_countInteger

How many parallel workers participate in this run. Defaults to 1.

Returns:

  • (Integer)


55
56
57
# File 'lib/simplecov/parallel_adapters/base.rb', line 55

def expected_worker_count
  1
end

.first_worker?Boolean

Should THIS worker do the final-result work (wait for siblings, merge resultsets, run threshold checks, format the report)? Defaults to true for the single-process case.

Returns:

  • (Boolean)


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

def first_worker?
  true
end

.native_wait?boolish

Does wait_for_siblings block until every sibling process has exited? When true, a settled resultset count below expected_worker_count is accepted as final.

Returns:

  • (boolish)


48
49
50
# File 'lib/simplecov/parallel_adapters/base.rb', line 48

def native_wait?
  false
end

.wait_for_siblingsvoid

This method returns an undefined value.

Optional: block until sibling workers have finished writing their resultsets. The no-op default leaves synchronization to SimpleCov's resultset polling fallback.



38
39
40
# File 'lib/simplecov/parallel_adapters/base.rb', line 38

def wait_for_siblings
  # No-op default; polling fallback handles correctness.
end