Class: SimpleCov::ParallelAdapters::Base
- Inherits:
-
Object
- Object
- SimpleCov::ParallelAdapters::Base
- 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
Class Method Summary collapse
-
.active? ⇒ boolish
Should this adapter be selected for the current process? The first registered adapter whose
active?returns truthy wins. -
.expected_worker_count ⇒ Integer
How many parallel workers participate in this run.
-
.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.
-
.native_wait? ⇒ boolish
Does
wait_for_siblingsblock until every sibling process has exited? When true, a settled resultset count belowexpected_worker_countis accepted as final. -
.wait_for_siblings ⇒ void
Optional: block until sibling workers have finished writing their resultsets.
Class Method Details
.active? ⇒ boolish
Should this adapter be selected for the current process? The
first registered adapter whose active? returns truthy wins.
20 21 22 |
# File 'lib/simplecov/parallel_adapters/base.rb', line 20 def active? false end |
.expected_worker_count ⇒ Integer
How many parallel workers participate in this run. Defaults to 1.
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.
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.
48 49 50 |
# File 'lib/simplecov/parallel_adapters/base.rb', line 48 def native_wait? false end |
.wait_for_siblings ⇒ void
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 |