Skip to content

Commit a49f7fe

Browse files
committed
✨ Introduce ENV["SIMPLECOV_PARALLEL"]
- explicit proxy for determining if running in parallel
1 parent f4822f0 commit a49f7fe

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/simplecov.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,12 @@ def make_parallel_tests_available
438438
end
439439

440440
def probably_running_parallel_tests?
441-
ENV.fetch("TEST_ENV_NUMBER", nil) && ENV.fetch("PARALLEL_TEST_GROUPS", nil)
441+
# As a result of the inherent difficulty of intelligently determining parallel testing,
442+
# and for scenarios where the normal ENV variables may not get set,
443+
# use an explicit trigger defined internally: SIMPLECOV_PARALLEL
444+
ENV.fetch("SIMPLECOV_PARALLEL", nil) || (
445+
ENV.fetch("TEST_ENV_NUMBER", nil) && ENV.fetch("PARALLEL_TEST_GROUPS", nil)
446+
)
442447
end
443448
end
444449
end

0 commit comments

Comments
 (0)