@@ -268,6 +268,11 @@ jobs:
268268 strategy :
269269 matrix :
270270 os : [ubuntu-20.04, ubuntu-22.04, macos-13]
271+ include :
272+ - xdist_n : auto
273+ # FIXME: test_color_tty fails with xdist
274+ - os : macos-13
275+ xdist_n : ' 1'
271276 fail-fast : false # Prefer quick result
272277
273278 runs-on : ${{ matrix.os }}
@@ -306,6 +311,7 @@ jobs:
306311 python3 -m pip install pip --upgrade
307312 python3 -m pip install pytest
308313 python3 -m pip install pytest-timeout
314+ python3 -m pip install pytest-xdist
309315 python3 -m pip install psutil
310316
311317 - name : Build cppcheck
@@ -329,7 +335,7 @@ jobs:
329335
330336 - name : Run test/cli
331337 run : |
332- python3 -m pytest -Werror --strict-markers -vv test/cli
338+ python3 -m pytest -Werror --strict-markers -vv -n ${{ matrix.xdist_n }} test/cli
333339
334340 # TODO: use the step below instead
335341 # do not use pushd in this step since we go below the working directory
@@ -338,26 +344,26 @@ jobs:
338344 cd ..
339345 ln -s cppcheck 'cpp check'
340346 cd 'cpp check/test/cli'
341- python3 -m pytest -Werror --strict-markers -vv
347+ python3 -m pytest -Werror --strict-markers -vv -n ${{ matrix.xdist_n }}
342348
343349 # FIXME: proj2_test.py fails because of the relative path cleanups in ImportProject::setRelativePaths()
344350 # It fails because the application path used as base path has its symlink resolved by getcwd().
345351 - name : Run test/cli (symlink)
346352 if : false
347353 run : |
348354 ln -s . 'cpp check'
349- python3 -m pytest -Werror --strict-markers -vv 'cpp check/test/cli'
355+ python3 -m pytest -Werror --strict-markers -vv -n ${{ matrix.xdist_n }} 'cpp check/test/cli'
350356
351357 - name : Run test/cli (-j2)
352358 run : |
353- python3 -m pytest -Werror --strict-markers -vv test/cli
359+ python3 -m pytest -Werror --strict-markers -vv -n ${{ matrix.xdist_n }} test/cli
354360 env :
355361 TEST_CPPCHECK_INJECT_J : 2
356362
357363 - name : Run test/cli (--clang)
358364 if : false
359365 run : |
360- python3 -m pytest -Werror --strict-markers -vv test/cli
366+ python3 -m pytest -Werror --strict-markers -vv -n ${{ matrix.xdist_n }} test/cli
361367 env :
362368 TEST_CPPCHECK_INJECT_CLANG : clang
363369
0 commit comments