diff mbox series

[RESEND,v2,4/4] doc: test: Explain how to run pytests in parallel

Message ID 20210919151448.RESEND.v2.4.I4b868f615036d4b8bc4d9f6a8555db49be9f6009@changeid
State Accepted
Commit 5f8cefb7b1f3c1ba3d3f698345bf173038da2b0c
Delegated to: Tom Rini
Headers show
Series test: Try to deal with some co-dependent tests | expand

Commit Message

Simon Glass Sept. 19, 2021, 9:14 p.m. UTC
Add documentation for this so people can try it out. At present it does
not fully work.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2:
- Add documentation for how to run parallel tests

 doc/develop/py_testing.rst | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

Comments

Tom Rini Oct. 5, 2021, 10:03 p.m. UTC | #1
On Sun, Sep 19, 2021 at 03:14:51PM -0600, Simon Glass wrote:

> Add documentation for this so people can try it out. At present it does
> not fully work.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/doc/develop/py_testing.rst b/doc/develop/py_testing.rst
index c4cecc0a01b..4f1e1f66e76 100644
--- a/doc/develop/py_testing.rst
+++ b/doc/develop/py_testing.rst
@@ -103,6 +103,36 @@  will be written to `${build_dir}/test-log.html`. This is best viewed in a web
 browser, but may be read directly as plain text, perhaps with the aid of the
 `html2text` utility.
 
+Running tests in parallel
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Note: This does not fully work yet and is documented only so you can try to
+fix the problems.
+
+First install support for parallel tests::
+
+    pip3 install pytest-xdist
+
+Then build sandbox in a suitable build directory. It is not possible to use
+the --build flag with xdist.
+
+Finally, run the tests in parallel using the -n flag::
+
+    # build sandbox first, in a suitable build directory. It is not possible
+    # to use the --build flag with -n
+    test/py/test.py -B sandbox --build-dir /tmp/b/sandbox -q -k 'not slow' -n32
+
+At least the following non-slow tests are known to fail:
+
+- test_fit_ecdsa
+- test_bind_unbind_with_uclass
+- ut_dm_spi_flash
+- test_gpt_rename_partition
+- test_gpt_swap_partitions
+- test_pinmux_status
+- test_sqfs_load
+
+
 Testing under a debugger
 ~~~~~~~~~~~~~~~~~~~~~~~~