Codecov:错误处理范围报告

问题描述 投票:0回答:1

我想将codecov添加到this project。但是,codecov说here,它无法处理使用以下命令在Travis CI脚本中创建的coverage.xml文件:pytest python/tests -v --junitxml=coverage.xml

之前提供我的令牌的所有操作似乎都按照TravisCI版本here中的建议运行。

我以为这可能是路径的问题,但是我在codecov.yml中包括了一个可能的解决方法,但没有任何改变。

因此,我认为脚本codecov.ymltravis.ymlutils/travis_runner.py不是问题的一部分。

pytest code-coverage travis-ci codecov
1个回答
0
投票

--junitxml选项用于生成JUnit格式的报告。使用选项--cov-report生成覆盖率报告。 pytest-cov允许多次传递--cov-report以生成不同格式的报告。示例:

$ pip install pytest pytest-cov
$ pytest --cov=mypkg --cov-report term --cov-report xml:coverage.xml

将打印coverage表并生成与CodeCov兼容的Cobertura XML报告。

© www.soinside.com 2019 - 2024. All rights reserved.