summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-12-11 09:12:02 -0500
committerNed Batchelder <ned@nedbatchelder.com>2021-12-11 09:12:02 -0500
commitdff1ff4751e8b272457e5aba7934f69394c3382b (patch)
treea3ff192eaf1882ef0474e7559785d40a3d649857
parent157053d54c55ccf95d8911737bfa0a881e973e93 (diff)
downloadpython-coveragepy-git-dff1ff4751e8b272457e5aba7934f69394c3382b.tar.gz
docs: more description in balance_xdist_plugin.py
-rw-r--r--tests/balance_xdist_plugin.py22
1 files changed, 19 insertions, 3 deletions
diff --git a/tests/balance_xdist_plugin.py b/tests/balance_xdist_plugin.py
index 6786a342..e4db6f63 100644
--- a/tests/balance_xdist_plugin.py
+++ b/tests/balance_xdist_plugin.py
@@ -2,10 +2,26 @@
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""
-A pytest plugin to record test times and then balance xdist with them next time.
+A pytest plugin to record test times and then use those times to divide tests
+into evenly balanced workloads for each xdist worker.
+
+Two things are hard-coded here that shouldn't be:
+
+- The timing data is written to the tmp directory, but should use the pytest
+ cache (https://docs.pytest.org/en/latest/how-to/cache.html).
+
+- The number of xdist workers is hard-coded to 8 because I couldn't figure out
+ how to find the number. Would it be crazy to read the -n argument directly?
+
+You can force some tests to run on the same worker by setting the
+`balanced_clumps` setting in your pytest config file. Each line is a substring
+of a test name. All tests with that substring (like -k) will run on the
+worker:
+
+ balanced_clumps =
+ LongRunningFixture
+ some_other_test_substring
-The only thing in here particular to coverage.py is the use of the tmp directory
-for storing the data.
"""
import collections