|
|
. |
|
|
\ No newline at end of file |
|
|
[[_TOC_]]
|
|
|
|
|
|
## Python Coverage
|
|
|
|
|
|
Pipelines in Jenkins use common groovy files adaptable to different projects through the use of build variables.
|
|
|
|
|
|
One exception is python coverage. "Coverage" pipelines run unit tests and/or integration tests and the result is adapted using not a build parameter ba but a file named **.coveragerc**.
|
|
|
|
|
|
If such a file is not in the project repository within the "test" directory it is created by the pipeline using a standard one whose contents are given below,
|
|
|
|
|
|
If this does not fit the needs of the project you may want to add your own to the repository
|
|
|
|
|
|
```
|
|
|
<repository>/test/.coveragerc
|
|
|
|
|
|
```
|
|
|
The standard file should possibly be modified only in the "omit" part to exclude part of the coverage.
|
|
|
|
|
|
Standard **.coveragerc** file content:
|
|
|
|
|
|
```
|
|
|
# .coveragerc to control coverage.py
|
|
|
[run]
|
|
|
|
|
|
# append the machine name, process id and random number to the data file name.
|
|
|
parallel = True
|
|
|
|
|
|
# a list of packages or directories, the source to measure during execution.
|
|
|
# ${COVERAGE_SOURCE}
|
|
|
# ${PREFIX}/lib/python${PYTHON_VERSION}/site-packages/
|
|
|
source =
|
|
|
${PREFIX}/lib/python${PYTHON_VERSION}/site-packages/
|
|
|
${PREFIX}/bin/
|
|
|
|
|
|
# a list of packages, the source to measure during execution.
|
|
|
#source_pkgs = acli
|
|
|
|
|
|
# whether to measure branch coverage in addition to statement coverage.
|
|
|
branch = True
|
|
|
|
|
|
# a list of file name patterns, the files to leave out of measurement or reporting.
|
|
|
omit =
|
|
|
${PREFIX}/bin/etr*
|
|
|
${PREFIX}/bin/rad*
|
|
|
${PREFIX}/lib/python${PYTHON_VERSION}/site-packages/etr*
|
|
|
${PREFIX}/lib/python${PYTHON_VERSION}/site-packages/rad*
|
|
|
${PREFIX}/lib/python${PYTHON_VERSION}/site-packages/scxml*
|
|
|
${PREFIX}/lib/python${PYTHON_VERSION}/site-packages/elt*
|
|
|
/opt/anaconda*
|
|
|
*wtools*
|
|
|
/usr/share/waf/*
|
|
|
*wscript
|
|
|
*sitecustomize.py
|
|
|
|
|
|
# the name of the data file to use for storing or reporting coverage.
|
|
|
data_file = ${COVERAGE_ROOT}/.coverage_integration_tests
|
|
|
|
|
|
``` |
|
|
\ No newline at end of file |