1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
# This task produces the coverage reports and publishes them to codecov.
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.8'
- template: jdk.yml
parameters:
version: 11
- script: |
python setup.py test_java
pip install gcovr pytest-cov -r test-requirements.txt
pip install numpy setuptools
displayName: 'Install requirements'
- script: |
python setup.py develop --enable-coverage --enable-build-jar
displayName: 'Build'
- script: |
python -m pytest -v -s test/jpypetest --cov=jpype --cov-report=xml:coverage_py.xml --classpath="build/classes" --jacoco --checkjni
displayName: 'Test'
- script: |
gcovr -r . --xml -o coverage.xml --exclude-unreachable-branches --exclude-throw-branches
java -jar lib/org.jacoco.cli-0.8.5-nodeps.jar report build/coverage/jacoco.exec --classfiles build/classes/ --xml coverage_java.xml --sourcefiles native/java
bash <(curl -s https://codecov.io/bash) -f coverage.xml -f coverage_py.xml -f coverage_java.xml -X gcov
displayName: 'Report'
- task: PublishCodeCoverageResults@2
inputs:
codeCoverageTool: 'JaCoCo'
summaryFileLocation: coverage_java.xml
pathToSources: native/java
- task: PublishCodeCoverageResults@2
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: coverage.xml
- task: PublishCodeCoverageResults@2
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: coverage_py.xml
|