Class: ActiveSupport::Testing::Parallelization::TestDistributor
- Defined in:
- activesupport/lib/active_support/testing/parallelization/test_distributor.rb
Overview
Abstract base class for test distribution strategies. Subclasses implement different ways of assigning tests to workers.
Direct Known Subclasses
Instance Method Summary collapse
-
#add_test(test) ⇒ Object
Add a test to be distributed to workers.
-
#close ⇒ Object
Close the distributor.
-
#interrupt ⇒ Object
Clear all pending work (called on interrupt).
-
#pending? ⇒ Boolean
Check if there is pending work.
-
#take(worker_id:) ⇒ Array?
Retrieve the next test for a specific worker.
Instance Method Details
#add_test(test) ⇒ Object
Add a test to be distributed to workers.
11 12 13 |
# File 'activesupport/lib/active_support/testing/parallelization/test_distributor.rb', line 11 def add_test(test) raise NotImplementedError end |
#close ⇒ Object
Close the distributor. No more work will be accepted.
34 35 36 |
# File 'activesupport/lib/active_support/testing/parallelization/test_distributor.rb', line 34 def close # Optional end |
#interrupt ⇒ Object
Clear all pending work (called on interrupt).
23 24 25 |
# File 'activesupport/lib/active_support/testing/parallelization/test_distributor.rb', line 23 def interrupt # Optional end |
#pending? ⇒ Boolean
Check if there is pending work.
29 30 31 |
# File 'activesupport/lib/active_support/testing/parallelization/test_distributor.rb', line 29 def pending? raise NotImplementedError end |
#take(worker_id:) ⇒ Array?
Retrieve the next test for a specific worker.
18 19 20 |
# File 'activesupport/lib/active_support/testing/parallelization/test_distributor.rb', line 18 def take(worker_id:) raise NotImplementedError end |