Jenkins-推送部署测试步骤失败 [英] Jenkins - push to deploy test step fails

查看:256
本文介绍了Jenkins-推送部署测试步骤失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在按照推送中的说明进行操作,以使用Jenkins测试和部署以python和Flask编写的Google App Engine应用.

测试位于应用程序的根文件夹中,文件名为tests.py

execute 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

解决方案

这实际上不是Jenkins问题-正如构建输出所指示的那样,您的shell脚本失败了,因为它找不到nosetests可执行文件:

nosetests: not found

您确保已安装 nose cloud-dev-php Jenkins构建机器上?

假定您应该已安装使用该即按即用映像-但由于您的构建是在 PHP 构建计算机而不是 Python 计算机上运行的,因此可能并非如此.
您应仔细检查您是否已遵循说明确保您的Python Jenkins作业在Python构建机器上运行.

如果已安装 ,则可能不在默认的PATH上,在这种情况下,您可以将nosetests的用法更改为/usr/local/bin/nosetests(或任何路径). /p>

I am following the instructions on Push to deploy to use Jenkins to test and deploy a Google App Engine app written in python and Flask.

the test is located in the root folder of the app in a file called tests.py

The command in the execute shell step is

nosetests tests.py

I get the following error and I am not sure how to troubleshoot this as I am fairly new to 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

解决方案

This isn't really a Jenkins problem — as the build output indicates, your shell script is failing because it cannot find the nosetests executable:

nosetests: not found

Have you made sure that nose is installed on the cloud-dev-php Jenkins build machine?

Supposedly it should already be installed if you're using that push-to-deploy image — but as your build is running on the PHP build machine rather than the Python machine, perhaps that's not the case.
You should double-check that you've followed the instructions to ensure that your Python Jenkins job runs on a Python build machine.

If it is installed, perhaps it's not on the default PATH, in which case you can change the usage of nosetests to /usr/local/bin/nosetests (or whatever the path is).

这篇关于Jenkins-推送部署测试步骤失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆