Jenkins上allure报告清空上一次运行记录

问题:Allure报告的用例数量跟实际运行用例数量不一致

 

解决办法:

使用allure 生成报告的时候,当你的用例名称修改后,会发现保留了上一次的用例运行记录。
如果你想先清空之前的记录再生成新的报告,可以再运行用例的时候加上 --clean-alluredir 命令行参数。

使用 pytest -h 可以查看报告相关的三个参数

reporting:
  --alluredir=DIR       Generate Allure report in the specified directory (may
                        not exist)
  --clean-alluredir     Clean alluredir folder if it exists
  --allure-no-capture   Do not attach pytest captured logging/stdout/stderr to
                        report

reporting 报告相关参数
--alluredir=DIR 指定报告的目录路径
--clean-alluredir 如果已经存在报告,就先清空它
--allure-no-capture 不加载 logging/stdout/stderr 文件到报告

1、在main方法里输入第一个参数 --clean-alluredir

 2、去Jenkins里点立即构建

 3、查看结果,变回3条了

原文地址:https://www.cnblogs.com/gurenqi0705/p/14033727.html