Class: SimpleCov::ParallelAdapters::Base
- Inherits:
-
Object
- Object
- SimpleCov::ParallelAdapters::Base
- 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
Class Method Summary collapse
- .active? ⇒ Boolean
- .expected_worker_count ⇒ Integer
- .first_worker? ⇒ Boolean
-
.forced_off? ⇒ Boolean
mutant:disable —
falseis a singleton, so comparing against it answers the same through ==, eql? and equal?, and no example can tell the three apart. -
.native_wait? ⇒ Boolean
Whether
wait_for_siblingsblocks until every sibling process has exited, so no further resultset can appear. -
.parallel_test_groups_count ⇒ Integer
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.
- .wait_for_siblings ⇒ void
Class Method Details
.active? ⇒ Boolean
10 11 12 |
# File 'lib/simplecov/parallel_adapters/base.rb', line 10 def active? false end |
.expected_worker_count ⇒ Integer
29 30 31 |
# File 'lib/simplecov/parallel_adapters/base.rb', line 29 def expected_worker_count 1 end |
.first_worker? ⇒ 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.
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.
25 26 27 |
# File 'lib/simplecov/parallel_adapters/base.rb', line 25 def native_wait? false end |
.parallel_test_groups_count ⇒ Integer
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.
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_siblings ⇒ void
This method returns an undefined value.
18 19 |
# File 'lib/simplecov/parallel_adapters/base.rb', line 18 def wait_for_siblings end |