@@ -262,6 +262,11 @@ jobs:
262262 strategy :
263263 matrix :
264264 os : [ubuntu-20.04, ubuntu-22.04, macos-13]
265+ include :
266+ - xdist_n : auto
267+ # FIXME: test_color_tty fails with xdist
268+ - os : macos-13
269+ xdist_n : ' 1'
265270 fail-fast : false # Prefer quick result
266271
267272 runs-on : ${{ matrix.os }}
@@ -300,6 +305,7 @@ jobs:
300305 python3 -m pip install pip --upgrade
301306 python3 -m pip install pytest
302307 python3 -m pip install pytest-timeout
308+ python3 -m pip install pytest-xdist
303309 python3 -m pip install psutil
304310
305311 - name : Build cppcheck
@@ -323,7 +329,7 @@ jobs:
323329
324330 - name : Run test/cli
325331 run : |
326- python3 -m pytest -Werror --strict-markers -vv test/cli
332+ python3 -m pytest -Werror --strict-markers -vv -n ${{ matrix.xdist_n }} test/cli
327333
328334 # TODO: use the step below instead
329335 # do not use pushd in this step since we go below the working directory
@@ -332,26 +338,26 @@ jobs:
332338 cd ..
333339 ln -s cppcheck 'cpp check'
334340 cd 'cpp check/test/cli'
335- python3 -m pytest -Werror --strict-markers -vv
341+ python3 -m pytest -Werror --strict-markers -vv -n ${{ matrix.xdist_n }}
336342
337343 # FIXME: proj2_test.py fails because of the relative path cleanups in ImportProject::setRelativePaths()
338344 # It fails because the application path used as base path has its symlink resolved by getcwd().
339345 - name : Run test/cli (symlink)
340346 if : false
341347 run : |
342348 ln -s . 'cpp check'
343- python3 -m pytest -Werror --strict-markers -vv 'cpp check/test/cli'
349+ python3 -m pytest -Werror --strict-markers -vv -n ${{ matrix.xdist_n }} 'cpp check/test/cli'
344350
345351 - name : Run test/cli (-j2)
346352 run : |
347- python3 -m pytest -Werror --strict-markers -vv test/cli
353+ python3 -m pytest -Werror --strict-markers -vv -n ${{ matrix.xdist_n }} test/cli
348354 env :
349355 TEST_CPPCHECK_INJECT_J : 2
350356
351357 - name : Run test/cli (--clang)
352358 if : false
353359 run : |
354- python3 -m pytest -Werror --strict-markers -vv test/cli
360+ python3 -m pytest -Werror --strict-markers -vv -n ${{ matrix.xdist_n }} test/cli
355361 env :
356362 TEST_CPPCHECK_INJECT_CLANG : clang
357363
0 commit comments