请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

和老师的结果不一样,报allure-results does not exist

图片描述

E:\Virtual Machines\JenKins\.jenkins\workspace\trading_system_autotest>D:\IDE\Python\envs\spa\Scripts\python -m pytest ./fsauto/selenium/testcases/trade/test_jenkins.py -n auto --alluredir=E:\Virtual Machines\JenKins\.jenkins\workspace\trading_system_autotest\allure-results 
============================= test session starts =============================
platform win32 -- Python 3.7.6, pytest-7.1.2, pluggy-1.0.0
rootdir: E:\Virtual Machines\JenKins\.jenkins\workspace\trading_system_autotest, configfile: pytest.ini
plugins: allure-pytest-2.10.0, assume-2.4.3, forked-1.4.0, html-3.1.1, metadata-2.0.2, rerunfailures-10.2, xdist-2.5.0
gw0 I / gw1 I / gw2 I / gw3 I

[gw0] Python 3.7.6 (tags/v3.7.6:43364a7ae0, Dec 19 2019, 00:42:30) [MSC v.1916 64 bit (AMD64)]

[gw1] Python 3.7.6 (tags/v3.7.6:43364a7ae0, Dec 19 2019, 00:42:30) [MSC v.1916 64 bit (AMD64)]

[gw2] Python 3.7.6 (tags/v3.7.6:43364a7ae0, Dec 19 2019, 00:42:30) [MSC v.1916 64 bit (AMD64)]

[gw3] Python 3.7.6 (tags/v3.7.6:43364a7ae0, Dec 19 2019, 00:42:30) [MSC v.1916 64 bit (AMD64)]
gw0 [0] / gw1 [0] / gw2 [0] / gw3 [0]

scheduling tests via LoadScheduling

============================ no tests ran in 3.27s ============================

E:\Virtual Machines\JenKins\.jenkins\workspace\trading_system_autotest>exit 5 
Build step 'Execute Windows batch command' marked build as failure
[trading_system_autotest] $ "E:\Virtual Machines\JenKins\.jenkins\tools\ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation\Allure\bin\allure.bat" generate -c -o "E:\Virtual Machines\JenKins\.jenkins\workspace\trading_system_autotest\allure-report"
allure-results does not exist
Report successfully generated to E:\Virtual Machines\JenKins\.jenkins\workspace\trading_system_autotest\allure-report
Allure report was successfully generated.
Creating artifact for the build.
Artifact was added to the build.
Finished: FAILURE

正在回答 回答被采纳积分+3

1回答

william 2022-08-26 17:38:03

是不是pytest.ini里设置了allure报告的路径了?我看你给的日志里,报告是生成在

E:\Virtual Machines\JenKins\.jenkins\workspace\trading_system_autotest\allure-report

0 回复 有任何疑惑可以回复我~
  • 提问者 慕村1342571 #1
    确实是文件的路径设置问题,测试一下,总结以下几点:
    1、.ini中的addopts、python_files、python_classes、python_functions可以用,但是testpaths最好不用;
    2、--alluredir后面跟的路径里不要加空格,容易出问题;
    3、如果使用不一样的项目名称或者路径,要确认common.tools中的get_project_path返回的目录和jenkins设置的任务名、--alluredir后面跟的路径中下载到workspace中的项目名是一致的
    4、在构建的命令中,如果使用了虚拟环境可指定pytest.exe的全路径名后面跟alluredir参数,如
    D:\IDE\Python\envs\fsauto\Scripts\pytest.exe --alluredir=E:\JenKins\.jenkins\workspace\fsauto\allure-results
    回复 有任何疑惑可以回复我~ 2022-08-27 12:16:14
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号