我按照Push to deploy上的说明使用Jenkins测试和部署用python和Flask编写的Google App Engine应用程序。
测试位于应用程序的根文件夹中,名为tests.py
执行shell步骤中的命令是
nosetests tests.py
我收到以下错误,我不知道如何排除故障,因为我对Jenkins相当新。
Started by user User Name
Building remotely on cloud-dev-php in workspace /var/jenkins/workspace/CFC Melbourne production pipeline
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://source.developers.google.com/p/cfc-melbourne-website/ # timeout=10
Fetching upstream changes from https://source.developers.google.com/p/cfc-melbourne-website/
> git --version # timeout=10
using .gitcredentials to set credentials
> git config --local credential.helper store --file=/tmp/git7069316934747655973.credentials # timeout=10
> git -c core.askpass=true fetch --tags --progress https://source.developers.google.com/p/cfc-melbourne-website/ +refs/heads/*:refs/remotes/origin/*
> git config --local --remove-section credential # timeout=10
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 3a8caffa38303b3ae4741aac83e6ac807077b5be (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 3a8caffa38303b3ae4741aac83e6ac807077b5be
> git rev-list 3a8caffa38303b3ae4741aac83e6ac807077b5be # timeout=10
[CFC Melbourne production pipeline] $ /bin/sh -xe /tmp/hudson3364335209750264714.sh
+ nosetests tests.py
/tmp/hudson3364335209750264714.sh: 2: /tmp/hudson3364335209750264714.sh: nosetests: not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
答案 0 :(得分:1)
这不是真正的Jenkins问题 - 正如构建输出所示,您的shell脚本失败,因为它无法找到nosetests
可执行文件:
nosetests: not found
您确定cloud-dev-php
Jenkins构建计算机上的nose
is installed吗?
据说如果您使用的是推送部署映像,它应该already be installed - 但是当您的构建在 PHP 构建计算机而不是 Python <上运行时/ em>机器,也许情况并非如此 您应该仔细检查是否已遵循instructions以确保您的Python Jenkins作业在Python构建计算机上运行。
如果安装了 ,可能它不在默认PATH
上,在这种情况下,您可以将nosetests
的使用情况更改为/usr/local/bin/nosetests
(或其他路径是)。