Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Jenkins freestyle build run with allure报告_Python_Jenkins_Pytest - Fatal编程技术网

Python Jenkins freestyle build run with allure报告

Python Jenkins freestyle build run with allure报告,python,jenkins,pytest,Python,Jenkins,Pytest,我正在为所有包含pytest标记“jenkins_run”的测试运行jenkins freestyle构建,在构建运行之后,我希望为我的测试提供诱惑报告。 我尝试的是: cd C:\Users\Administrator\Perforce\depot2\Cloud\TestAutomation\framework python -m pytest --alluredir="reportpath" -rf -m jenkins_run 发生的情况是,测试运行正常,但allure无法从指定路径中

我正在为所有包含pytest标记“jenkins_run”的测试运行jenkins freestyle构建,在构建运行之后,我希望为我的测试提供诱惑报告。 我尝试的是:

cd C:\Users\Administrator\Perforce\depot2\Cloud\TestAutomation\framework

python -m pytest --alluredir="reportpath" -rf -m jenkins_run
发生的情况是,测试运行正常,但allure无法从指定路径中选择测试结果 (附上屏幕截图以供参考)

生成命令:

诱惑后构建操作


我也一直在努力解决这个问题。对我来说,问题在于“-alluredir”参数中的路径与allure插件中的一个不匹配

确保--alluredir的路径为:

  • 必须是名为“allure result”的文件夹(至少在我的版本中,allure jenkins插件的配置是一个谎言)
  • 相对于jenkins workspace,并相对于 工作空间
  • 因此,它应该看起来像:

    --alluredir "path/of/jenkins/workspace/build_name/target/allure-result"