如何配置Jenkins在Windows中将Nosetests作为构建操作运行

时间:2014-01-02 11:35:30

标签: python jenkins nosetests

我在Windows上安装了Python 3.3。当我从命令提示符运行nosetests给出python测试脚本文件夹的绝对路径时,它运行。但是,当我在Jenkins中将build shell配置为“nosetests path / to / tests --with-xunit”时,构建失败。我正在尝试安装构建监视器以查看构建失败的原因。构建shell有nosetests C:\seltests\RHIS_Tests\ --with-xunit。我没有将Postbuild设置为nosetests.xml,因为它拒绝该条目。

感谢。 对不起,我在这里添加控制台输出 Building in workspace C:\Program Files\Jenkins\jobs\P1\workspace Updating svn://godwin:3691/SVNRepo at revision '2014-01-02T18:28:06.781 +0530' U Allows SQL in text fields.html At revision 3 [workspace] $ sh -xe C:\WINDOWS\TEMP\hudson796644116462335904.sh The system cannot find the file specified FATAL: command execution failed java.io.IOException: Cannot run program "sh" (in directory "C:\Program Files\Jenkins\jobs\P1\workspace"): CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(Unknown Source) at hudson.Proc$LocalProc.<init>(Proc.java:244) at hudson.Proc$LocalProc.<init>(Proc.java:216) at hudson.Launcher$LocalLauncher.launch(Launcher.java:773) at hudson.Launcher$ProcStarter.start(Launcher.java:353) at hudson.Launcher$ProcStarter.join(Launcher.java:360) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:94) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:63) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:566) at hudson.model.Run.execute(Run.java:1678) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:231) Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessImpl.create(Native Method)

1 个答案:

答案 0 :(得分:1)

当您不提供更多信息时,很难帮助您。你得到的错误信息是什么?选中“控制台输出”并将其添加到您的问题中。

听起来你正在使用构建步骤“执行shell”。在Windows上,您应该使用“执行Windows批处理命令”。