【问题标题】:How to configure Jenkins to run Nosetests as build action in Windows如何配置 Jenkins 以在 Windows 中运行 Nosetests 作为构建操作
【发布时间】:2014-01-02 11:35:30
【问题描述】:

我已经在 Windows 上安装了 Python 3.3。当我从命令提示符运行提供 python 测试脚本文件夹的绝对路径的nosetests 时,它运行。但是,当我在 Jenkins 中将构建 shell 配置为“nosetests path/to/tests --with-xunit”时,构建失败。我正在尝试安装构建监视器以查看构建失败的原因。构建外壳有 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)

【问题讨论】:

  • 您收到的错误信息是什么?勾选“控制台输出”并在此处添加。

标签: python jenkins nosetests


【解决方案1】:

如果您不提供更多信息,就很难为您提供帮助。您收到的错误信息是什么?检查“控制台输出”并将其添加到您的问题中。

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

【讨论】:

  • 好的,谢谢。 4 个测试中有 3 个通过了,所以现在问题一定出在我的测试上。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-06-30
  • 2014-01-11
  • 2014-07-19
  • 2016-06-14
  • 1970-01-01
  • 2013-04-03
  • 2018-07-27
相关资源
最近更新 更多