“allure”不是内部或外部命令,也不是可运行的程序或批处理文件。

发表时间:2020-09-14

背景

os:window10

allure:2.13.1

在与job相同的虚拟环境下,在cmd中执行allure --version 是成功的;

在这里插入图片描述

执行操作:

使用jenkins运行job 操作,job中的详情配置如下:

执行的命令:
cd iInterface_python
tutorial-env\Scripts\activate.bat && allure --version && pytest -vs test/weather_test.py --alluredir=allure_reports  

日志

iinterface] $ cmd /c call C:\Users\lnz\AppData\Local\Temp\jenkins1585194114695025673.bat

D:\jekins_slave_home\workspace\iinterface>cd iInterface_python 

D:\jekins_slave_home\workspace\iinterface\iInterface_python>tutorial-env\Scripts\activate.bat   && allure --version   && pytest -vs test/weather_test.py --alluredir=allure_reports    
'allure' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
Build step 'Execute Windows batch command' marked build as failure
[iinterface] $ D:\jar\allure-commandline-2.13.1\allure-2.13.1\bin\allure.bat generate D:\jekins_slave_home\workspace\iinterface\iInterface_python\allure_reports -c -o D:\jekins_slave_home\workspace\iinterface\allure-report
Report successfully generated to D:\jekins_slave_home\workspace\iinterface\allure-report
Allure report was successfully generated.
Creating artifact for the build.
Artifact was added to the build.
Finished: FAILURE

定位问题过程

1、在jenkins命令行中输入path,检查allure 的环境变量配置是否正确

PATH=D:\jekins_slave_home\workspace\iinterface\iInterface_python\tutorial-env\Scripts;C:\Java\jre1.8.0_202/bin;C:\Java\jre1.8.0_202/bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;D:\Program Files (x86)\appium\python\Scripts\;D:\Program Files (x86)\appium\python\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;D:\Program Files (x86)\appium\;C:\Java\jdk1.8.0_202\bin\;D:\Program Files (x86)\appium\sdk\platform-tools\;D:\Program Files (x86)\appium\sdk\platform-tools;D:\Program Files (x86)\appium\sdk\tools;D:\Program Files (x86)\appium\sdk\platforms;D:\Program Files (x86)\appium\sdk\tools\;C:\Program Files (x86)\Google\Chrome\Application;C:\Program Files (x86)\Tesseract-OCR;C:\Users\lnz\Downloads\allure-commandline-2.13.1\allure-2.13.1\bin;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;d:\Program Files\Git\cmd;D:\我的重要文件\sonar-scanner-cli-4.2.0.1873-windows\sonar-scanner-4.2.0.1873-windows\bin;D:\Program Files (x86)\appium\scrcpy-win64-v1.14;C:\Program Files (x86)\Google\Chrome\Application;D:\Program Files (x86)\appium\ffmpeg\bin;D:\Program Files (x86)\appium\go\bin;https://goproxy.io;auto;C:\Python27;C:\Program Files\Pandoc\;C:\Java\jre1.8.0_202;C:\Users\lnz\AppData\Local\Microsoft\WindowsApps;C:\Users\lnz\AppData\Roaming\npm;D:\Program Files (x86)\appium\pycharm\PyCharm Community Edition 2019.2.5\bin;D:\Program Files (x86)\appium\sdk\build-tools\29.0.2;C:\Users\lnz\AppData\Local\Microsoft\WindowsApps;C:\Users\lnz\AppData\Local\GitHubDesktop\bin;C:\Users\lnz\go\bin

发现allure 中关联的环境变量是之前配置的老环境变量;未获取到新的环境变量

解决方法

重启电脑


文章来源互联网,如有侵权,请联系管理员删除。邮箱:417803890@qq.com / QQ:417803890

微配音

Python Free

邮箱:417803890@qq.com
QQ:417803890

皖ICP备19001818号
© 2019 copyright www.pythonf.cn - All rights reserved

微信扫一扫关注公众号:

联系方式

Python Free