无法构建Jenkins脚本

vwkv1x7d  于 2023-01-16  发布在  Jenkins
关注(0)|答案(1)|浏览(217)

我有 selenium /Python框架,我想推动和使用Jenkins。
然而,在尝试构建脚本时,我得到以下错误:

Started by user Dusan Kovacevic
Running as SYSTEM
Building in workspace /Users/dusandev/.jenkins/workspace/SeleniumBase
The recommended git tool is: NONE
using credential somecredentials
> git rev-parse --resolve-git-dir 
/Users/dusandev/.jenkins/workspace/SeleniumBase/.git # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/StreamFlow-Finance/automated-web- 
tests.git # timeout=10
Fetching upstream changes from https://github.com/StreamFlow-Finance/automated-web- 
tests.git
> git --version # timeout=10
> git --version # 'git version 2.34.1'
using GIT_ASKPASS to set credentials 
> git fetch --tags --force --progress -- https://github.com/StreamFlow- 
Finance/automated-web-tests.git +refs/heads/*:refs/remotes/origin/* # timeout=10
> git rev-parse refs/remotes/origin/main^{commit} # timeout=10
Checking out Revision 82fe529ff81267aebb97098fb92e4401abfe0462 
(refs/remotes/origin/main)
> git config core.sparsecheckout # timeout=10
> git checkout -f 82fe529ff81267aebb97098fb92e4401abfe0462 # timeout=10
Commit message: "Add files via upload"
> git rev-list --no-walk 82fe529ff81267aebb97098fb92e4401abfe0462 # timeout=10
[SeleniumBase] $ /bin/sh -xe 
/var/folders/nb/qbb9ctrn3rb68w54m_yyyqhh0000gn/T/shiningpanda17442261483823605080.sh
+ python -m venv env
+ call ./env/Scripts/activate.bat
/var/folders/nb/qbb9ctrn3rb68w54m_yyyqhh0000gn/T/shiningpanda17442261483823605080.sh: 
line 3: call: command not found
Build step 'Custom Python Builder' marked build as failure
Finished: FAILURE

下面是我在Jenkins中的构建命令:

python -m venv env
call ./env/Scripts/activate.bat
pip install -r requirements.txt
sbase install chromedriver latest
pytest --headless

我尝试做的是建立远程测试能力,其他的队友可以随时运行他们想要的测试。
任何帮助都是赞赏和感谢你提前。

xv8emn3q

xv8emn3q1#

也许为了从Jenkins脚本调用.bat文件,您需要编写如下代码。

start cmd.exe /c ./env/Scripts/activate.bat

相关问题