jenkins - 生成python单元测试生成的junit xml的html报告
问题描述
我有 junit 在 jenkins 的 xml fomrat 中生成的 python 单元测试报告。
<?xml version="1.0" encoding="utf-8"?>
<testsuites>
<testsuite name="pytest" errors="0" failures="0" skipped="1" tests="3" time="0.023" timestamp="2021-08-29T21:42:01.852698" hostname="infinity">
<testcase classname="tests.SimpleTest" name="test_fail" time="0.000" />
<testcase classname="tests.SimpleTest" name="test_pass" time="0.000" />
<testcase classname="tests.SimpleTest" name="test_skipped" time="0.000">
<skipped type="pytest.skip" message="demonstrating skipping">
/var/lib/jenkins/workspace/GithubExample/tests.py:10: demonstrating skipping
</skipped>
</testcase>
</testsuite>
</testsuites>
现在我想生成一个 html 报告,然后我可以使用 Publish HTML report 插件发布以从 confluence 访问。
现在在我的工作场所,我没有 junit 宏,也可能没有其他 html 生成插件,我拥有的是 xsltproc,
我尝试使用 xsltproc 生成 htmlreport,但它会引发错误
xsltproc test-result.xml stylesheet.xslt > index.html
warning: failed to load external entity "test-result.xml"
cannot parse test-result.xml
解决方案
推荐阅读
- android - 如何使垂直条颤动,如图所示
- android - 从 Sharesheet 接收所选应用程序选择的联系人
- python - ImportError:libmpi.so.12:无法打开共享对象文件:没有这样的文件或目录
- c++ - 是否允许通过指向另一个类的实例的指针发出信号?
- php - 我可以直接从谷歌云存储读取文件而无需使用 php 下载到本地服务器吗?
- php - 传递给 Illuminate\Database\Grammar::parameterize() 的参数 1 必须是数组类型,给定字符串 - 尝试通过 eloquent 插入 db 数据时
- python - 字符串列表中最短的重复项
- java - 即使我有 Chromedriver 和 Chrome 版本相同,ChromeBrowser 也没有打开。它启动以前的版本并抛出异常
- json - jq不是写变量的值而是变量名的实际文本
- c# - 如何在 C# 中调用报告服务器?