Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use number of processors provided by system instead of auto for pytest-xdist in CI #7265

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/CI-unixish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ jobs:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-13]
include:
- xdist_n: auto
- xdist_n: $(nproc)
# FIXME: test_color_tty fails with xdist
- os: macos-13
xdist_n: '1'
Expand Down Expand Up @@ -453,15 +453,15 @@ jobs:
../../cppcheck --dump naming_test.cpp
python3 ../naming.py --var='[a-z].*' --function='[a-z].*' naming_test.cpp.dump

# TODO: run with "-n auto" when misra_test.py can be run in parallel
# TODO: run with "-n $(nproc)" when misra_test.py can be run in parallel
- name: test addons (Python)
if: matrix.os != 'ubuntu-22.04'
run: |
python3 -m pytest -Werror --strict-markers -vv -n 1 addons/test
env:
PYTHONPATH: ./addons

# TODO: run with "-n auto" when misra_test.py can be run in parallel
# TODO: run with "-n $(nproc)" when misra_test.py can be run in parallel
# we cannot specify -Werror since xml/etree/ElementTree.py in Python 3.10 contains an unclosed file
- name: test addons (Python)
if: matrix.os == 'ubuntu-22.04'
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/CI-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,27 +183,27 @@ jobs:
- name: Run test/cli
if: matrix.config == 'release'
run: |
python -m pytest -Werror --strict-markers -vv -n auto test/cli || exit /b !errorlevel!
python -m pytest -Werror --strict-markers -vv -n %NUMBER_OF_PROCESSORS% test/cli || exit /b !errorlevel!

- name: Run test/cli (-j2)
if: matrix.config == 'release'
run: |
python -m pytest -Werror --strict-markers -vv -n auto test/cli || exit /b !errorlevel!
python -m pytest -Werror --strict-markers -vv -n %NUMBER_OF_PROCESSORS% test/cli || exit /b !errorlevel!
env:
TEST_CPPCHECK_INJECT_J: 2

# TODO: install clang
- name: Run test/cli (--clang)
if: false # matrix.config == 'release'
run: |
python -m pytest -Werror --strict-markers -vv -n auto test/cli || exit /b !errorlevel!
python -m pytest -Werror --strict-markers -vv -n %NUMBER_OF_PROCESSORS% test/cli || exit /b !errorlevel!
env:
TEST_CPPCHECK_INJECT_CLANG: clang

- name: Run test/cli (--cppcheck-build-dir)
if: matrix.config == 'release'
run: |
python -m pytest -Werror --strict-markers -vv -n auto test/cli || exit /b !errorlevel!
python -m pytest -Werror --strict-markers -vv -n %NUMBER_OF_PROCESSORS% test/cli || exit /b !errorlevel!
env:
TEST_CPPCHECK_INJECT_BUILDDIR: injected

Expand Down Expand Up @@ -249,7 +249,7 @@ jobs:
..\..\cppcheck --dump naming_test.cpp || exit /b !errorlevel!
python3 ..\naming.py --var='[a-z].*' --function='[a-z].*' naming_test.cpp.dump || exit /b !errorlevel!

# TODO: run with "-n auto" when misra_test.py can be run in parallel
# TODO: run with "-n %NUMBER_OF_PROCESSORS%" when misra_test.py can be run in parallel
- name: test addons (Python)
if: matrix.config == 'release'
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/asan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,27 +104,27 @@ jobs:
- name: Run test/cli
run: |
pwd=$(pwd)
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n $(proc) test/cli

- name: Run test/cli (-j2)
run: |
pwd=$(pwd)
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n $(proc) test/cli
env:
TEST_CPPCHECK_INJECT_J: 2

- name: Run test/cli (--clang)
if: false
run: |
pwd=$(pwd)
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n $(proc) test/cli
env:
TEST_CPPCHECK_INJECT_CLANG: clang

- name: Run test/cli (--cppcheck-build-dir)
run: |
pwd=$(pwd)
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n $(proc) test/cli
env:
TEST_CPPCHECK_INJECT_BUILDDIR: injected

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scriptcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
run: |
python tools/test_matchcompiler.py

# TODO: run with "-n auto" when misra_test.py can be run in parallel
# TODO: run with "-n $(nproc)" when misra_test.py can be run in parallel
# we cannot specify -Werror since xml/etree/ElementTree.py in Python 3.9/3.10 contains an unclosed file
- name: test addons
if: matrix.python-version == '3.9' || matrix.python-version == '3.10'
Expand All @@ -145,7 +145,7 @@ jobs:
env:
PYTHONPATH: ./addons

# TODO: run with "-n auto" when misra_test.py can be run in parallel
# TODO: run with "-n $(nproc)" when misra_test.py can be run in parallel
- name: test addons
if: matrix.python-version != '3.9' && matrix.python-version != '3.10'
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tsan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,29 +104,29 @@ jobs:
- name: Run test/cli
run: |
pwd=$(pwd)
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n $(nproc) test/cli
env:
TEST_CPPCHECK_INJECT_EXECUTOR: thread

- name: Run test/cli (-j2)
run: |
pwd=$(pwd)
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n $(nproc) test/cli
env:
TEST_CPPCHECK_INJECT_J: 2

- name: Run test/cli (--clang)
if: false
run: |
pwd=$(pwd)
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n $(nproc) test/cli
env:
TEST_CPPCHECK_INJECT_CLANG: clang

- name: Run test/cli (--cppcheck-build-dir)
run: |
pwd=$(pwd)
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n $(nproc) test/cli
env:
TEST_CPPCHECK_INJECT_BUILDDIR: injected

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ubsan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,27 +104,27 @@ jobs:
- name: Run test/cli
run: |
pwd=$(pwd)
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n $(nproc) test/cli

- name: Run test/cli (-j2)
run: |
pwd=$(pwd)
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n $(nproc) test/cli
env:
TEST_CPPCHECK_INJECT_J: 2

- name: Run test/cli (--clang)
if: false
run: |
pwd=$(pwd)
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n $(nproc) test/cli
env:
TEST_CPPCHECK_INJECT_CLANG: clang

- name: Run test/cli (--cppcheck-build-dir)
run: |
pwd=$(pwd)
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n $(nproc) test/cli
env:
TEST_CPPCHECK_INJECT_BUILDDIR: injected

Expand Down
Loading