错误收集
Started by user 偷走晚霞的人 Running as SYSTEM Building in workspace C:\Users\Administrator\.jenkins\workspace\TestAAA [TestAAA] $ cmd /c call C:\Users\Administrator\AppData\Local\Temp\jenkins5821160869728612887.bat C:\Users\Administrator\.jenkins\workspace\TestAAA>cd C:\Users\Administrator\PycharmProjects\PyTest C:\Users\Administrator\PycharmProjects\PyTest>pytest --alluredir=report test_skip.py 'pytest' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 C:\Users\Administrator\PycharmProjects\PyTest>exit 9009 Build step 'Execute Windows batch command' marked build as failure Unpacking https://repo1.maven.org/maven2/io/qameta/allure/allure-commandline/2.34.1/allure-commandline-2.34.1.zip to C:\Users\Administrator\.jenkins\tools\ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation\Allure_Commandline on Jenkins
错误分析
'pytest' 不是内部或外部命令,也不是可运行的程序 或批处理文件。
可以看到,这个python的配置有一定的问题
情况1
检查环境变量
可以看到只配置了%PYTHON_HOME%
忘记配置bin目录了
添加配置项
情况2
是不是没有在全局中安装pytest
情况3
看看是不是自己的pip 出现了问题
解决方法
情况1
我们需要在系统环境变量中,配置python的bin目录的环境变量
情况2
在cmd窗口安装pip install test
情况3
如果pip出现问题,直接官网下载一版覆盖安装,勾选添加环境变量就可以解决了