Jenkins - Windows命令行任务失败

时间:2014-11-06 09:10:09

标签: windows cakephp jenkins cmd code-coverage

我在运行jenkins时遇到麻烦,我正在使用cakephp测试函数来获取覆盖XML。麻烦的是,当它完成分析时,它只是说构建步骤出现故障,它会使构建停止并失败。

C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\app>Console\cake.bat test app AllTests --stderr --log-junit junit.xml --coverage-clover clover.xml 


Welcome to CakePHP v2.5.5 Console
---------------------------------------------------------------
App : app
Path: C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\app\
---------------------------------------------------------------
CakePHP Test Shell
---------------------------------------------------------------
IIIIIIIIII.
'El nombre de password1'

'El nombre de password3'

'El nombre de wrongPass'
IIIIIIIIII.
'El nombre de password1'

'El nombre de password3'
.FFFFFFF

Time: 1.36 minutes, Memory: 10.75Mb

There were 7 failures:

1) Warning
No tests found in class "CityTest".

C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\TestSuite\CakeTestRunner.php:60
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\TestSuite\CakeTestSuiteCommand.php:96
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\Command\TestShell.php:274
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\Command\TestShell.php:259
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\Shell.php:440
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\ShellDispatcher.php:209
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\ShellDispatcher.php:66

2) Warning
No tests found in class "CountryTest".

C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\TestSuite\CakeTestRunner.php:60
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\TestSuite\CakeTestSuiteCommand.php:96
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\Command\TestShell.php:274
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\Command\TestShell.php:259
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\Shell.php:440
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\ShellDispatcher.php:209
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\ShellDispatcher.php:66

3) Warning
No tests found in class "CurriculumTest".

C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\TestSuite\CakeTestRunner.php:60
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\TestSuite\CakeTestSuiteCommand.php:96
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\Command\TestShell.php:274
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\Command\TestShell.php:259
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\Shell.php:440
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\ShellDispatcher.php:209
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\ShellDispatcher.php:66

4) Warning
No tests found in class "DepartamentTest".

C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\TestSuite\CakeTestRunner.php:60
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\TestSuite\CakeTestSuiteCommand.php:96
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\Command\TestShell.php:274
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\Command\TestShell.php:259
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\Shell.php:440
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\ShellDispatcher.php:209
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\ShellDispatcher.php:66

5) Warning
No tests found in class "LegalRepresentativeTest".

C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\TestSuite\CakeTestRunner.php:60
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\TestSuite\CakeTestSuiteCommand.php:96
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\Command\TestShell.php:274
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\Command\TestShell.php:259
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\Shell.php:440
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\ShellDispatcher.php:209
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\ShellDispatcher.php:66

6) Warning
No tests found in class "OrganizationTest".

C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\TestSuite\CakeTestRunner.php:60
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\TestSuite\CakeTestSuiteCommand.php:96
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\Command\TestShell.php:274
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\Command\TestShell.php:259
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\Shell.php:440
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\ShellDispatcher.php:209
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\ShellDispatcher.php:66

7) Warning
No tests found in class "UserTest".

C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\TestSuite\CakeTestRunner.php:60
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\TestSuite\CakeTestSuiteCommand.php:96
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\Command\TestShell.php:274
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\Command\TestShell.php:259
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\Shell.php:440
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\ShellDispatcher.php:209
C:\Program Files (x86)\Jenkins\jobs\Proyecto Software\workspace\source\lib\Cake\Console\ShellDispatcher.php:66

FAILURES!
Tests: 30, Assertions: 12, Failures: 7, Incomplete: 20.

Generating code coverage report in Clover XML format ... done
Build step 'Ejecutar un comando de Windows' marked build as failure
Finished: FAILURE

我不知道应该做什么,我尝试更改jenkins服务的登录属性,因为我认为它可能与jenkins没有特权编写XML文件有关。

注意: 这就是我在jenkins任务中写下脚本的方式:

cd source
cd app
Console\cake.bat test app AllTests --stderr --log-junit junit.xml --coverage-clover clover.xml

1 个答案:

答案 0 :(得分:0)

问题在于当发生故障(不是失败的断言)时,即使shell完成其任务并且一切都以预期的方式结束,它也会返回一个不同于零的错误代码。解决问题并再次建设解决了这个问题。