Skip to content

Commit

Permalink
add PYTEST_NUMPROCS option to define number of CPU threads for pytest
Browse files Browse the repository at this point in the history
where appropriate; defaults to a value of 1 but can be overwridden for
CI purposed

Signed-off-by: Karl W Schulz <karl.schulz@amd.com>
  • Loading branch information
koomie committed Feb 27, 2024
1 parent 85e9462 commit ec0e7ff
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ if(${ENABLE_COVERAGE})
endif()
message(STATUS "Code coverage: ${ENABLE_COVERAGE}")

# CPU threads available for testing
set(PYTEST_NUMPROCS
"1"
CACHE STRING "Number of parallel threads to use with CPU-oriented tests")
message(STATUS "Pytest CPU threadcount: ${PYTEST_NUMPROCS}")

# ---------------------------
# profile mode tests
# ---------------------------
Expand Down Expand Up @@ -339,7 +345,8 @@ set_tests_properties(

add_test(
NAME test_analyze_workloads
COMMAND pytest ${COV_OPTION} ${PROJECT_SOURCE_DIR}/tests/test_analyze_workloads.py
COMMAND pytest -n ${PYTEST_NUMPROCS} --junitxml=tests/test_analyze_workloads.xml
${COV_OPTION} ${PROJECT_SOURCE_DIR}/tests/test_analyze_workloads.py
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})

# ---------------------------
Expand Down

0 comments on commit ec0e7ff

Please sign in to comment.