diff options
author | Jade Lovelace <lix@jade.fyi> | 2024-10-04 21:17:25 -0700 |
---|---|---|
committer | Jade Lovelace <lix@jade.fyi> | 2024-10-09 14:47:39 -0700 |
commit | 4180b84a677c363ab9f5ce500f0e5fa822d6c133 (patch) | |
tree | 0a1c503fc46e0597e332dcf3cc68f0c9bfacbaf6 /tests/functional2 | |
parent | 3caf3e1e08220b59dee1dfe81549b3a0739f8565 (diff) |
testsuite: use xdist for parallel test running
This is capped at 12 because 3.7 seconds of startup is painful enough
and 5.5 seconds with 24 was more annoying.
Change-Id: I327db40fd98deaa5330cd9cf6de99fb07b2c1cb0
Diffstat (limited to 'tests/functional2')
-rw-r--r-- | tests/functional2/README.md | 2 | ||||
-rw-r--r-- | tests/functional2/meson.build | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/tests/functional2/README.md b/tests/functional2/README.md index 8d8aa244b..b0440fb3a 100644 --- a/tests/functional2/README.md +++ b/tests/functional2/README.md @@ -18,7 +18,7 @@ Its primary goal is to make tests more concise, more self-contained, easier to w - [ ] Web server fixture: we don't test our network functionality because background processes are hard and this is simply goofy. We could just test it. - [ ] Nix daemon fixture. -- [ ] Parallelism via pytest-xdist. +- [x] Parallelism via pytest-xdist. [pytest-expect-test]: https://pypi.org/project/pytest-expect-test/ [pytest-insta]: https://pypi.org/project/pytest-insta/ diff --git a/tests/functional2/meson.build b/tests/functional2/meson.build index 590f11dd9..b18d7035d 100644 --- a/tests/functional2/meson.build +++ b/tests/functional2/meson.build @@ -1,3 +1,10 @@ +xdist_opts = [ + # auto number of workers, max 12 jobs + '-n', 'auto', '--maxprocesses=12', + # group tests by module or class; ensures that any setup work occurs as little as possible + '--dist=loadscope', +] + # surprisingly, this actually works even if PATH is set to something before # meson gets hold of it. neat! functional2_env = environment() @@ -7,7 +14,10 @@ test( 'functional2', python, args : [ - '-m', 'pytest', meson.current_source_dir() + '-m', 'pytest', + '-v', + xdist_opts, + meson.current_source_dir() ], env : functional2_env, # FIXME: Although we can trivially use TAP here with pytest-tap, due to a meson bug, it is unusable. |