如何使用PHPunit配置CI hudson以及如何使用hudson运行phpunit?

时间:2010-04-23 06:42:28

标签: hudson phpunit

我收到以下提到的错误。这需要帮助...... 请仔细检查错误。

由SCM变更启动

Updating https://suppliesguys.unfuddle.com/svn/suppliesguys_frontend2/Frontend-Texity/src
U         sites\all\modules\print\print_pdf\print_pdf.pages.inc
At revision 1134
[workspace] $ sh -xe C:\WINDOWS\TEMP\hudson6292587174545072503.sh
The system cannot find the file specified
FATAL: command execution failed
java.io.IOException: Cannot run program "sh" (in directory "E:\Projects\Hudson\.hudson\jobs\TSG\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:149)
 at hudson.Proc$LocalProc.<init>(Proc.java:121)
 at hudson.Launcher$LocalLauncher.launch(Launcher.java:636)
 at hudson.Launcher$ProcStarter.start(Launcher.java:271)
 at hudson.Launcher$ProcStarter.join(Launcher.java:278)
 at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:83)
 at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:58)
 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
 at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:584)
 at hudson.model.Build$RunnerImpl.build(Build.java:174)
 at hudson.model.Build$RunnerImpl.doRun(Build.java:138)
 at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:416)
 at hudson.model.Run.run(Run.java:1244)
 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
 at hudson.model.ResourceController.execute(ResourceController.java:88)
 at hudson.model.Executor.run(Executor.java:122)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
 at java.lang.ProcessImpl.create(Native Method)
 at java.lang.ProcessImpl.<init>(Unknown Source)
 at java.lang.ProcessImpl.start(Unknown Source)
 ... 17 more
Publishing Javadoc
Publishing Clover coverage report...
No Clover report will be published due to a Build Failure
[xUnit] Starting to record.
[xUnit] [PHPUnit] - Use the embedded style sheet.
[xUnit] [ERROR] - No test report file(s) were found with the pattern 'build/logs/phpunit.xml' relative to 'E:\Projects\Hudson\.hudson\jobs\TSG\workspace' for the testing framework 'PHPUnit'.  Did you enter a pattern relative to the correct directory?  Did you generate the result report(s) for 'PHPUnit'?
[xUnit] Stopping recording.
Finished: FAILURE

3 个答案:

答案 0 :(得分:1)

看起来你有几个问题:

FATAL: command execution failed java.io.IOException: Cannot run program "sh" (in directory "E:\Projects\Hudson.hudson\jobs\TSG\workspace"): 

运行Hudson作业的用户在其路径中没有“sh”命令,因此无法运行shell脚本。将/ bin添加到Hudson用户的$ PATH应该解决这个问题。

[xUnit] [ERROR] - No test report file(s) were found with the pattern 'build/logs/phpunit.xml' relative to 'E:\Projects\Hudson.hudson\jobs\TSG\workspace' for the testing framework 'PHPUnit'. 

这可能是之前错误的结果;构建只是没有达到运行PHPUnit测试的程度。

答案 1 :(得分:1)

看起来您正在使用Windows系统上的“执行shell”构建步骤而不是“执行Windows批处理命令”构建步骤。 Windows通常没有'sh',所以前者不起作用。

答案 2 :(得分:0)

'sh'用于linux实现。 '.exe'和'bat'文件都在windows中使用。您是否尝试在Windows或Linux上设置和运行Hudson?