Problem with phpunit test in TC

Good day. I have strange problem with one test. When i'm launching it from console - it works normal. But when it launched from teamcity I see an error:

[20:44:42][Step 1/1] Project Test Suite
[20:44:42][runPhpUnitPhar] fail
[20:44:42][fail] Unit test error.
[20:44:42][Project Test Suite] PROJECT\PushNotifyBundle\Tests\Service\IosPushServiceNotifyTest
[20:44:42][PROJECT\PushNotifyBundle\Tests\Service\IosPushServiceNotifyTest] testNotifyUser
[20:44:42][testNotifyUser] PHPUnit_Framework_OutputError
[20:44:42][testNotifyUser] PROJECT\PushNotifyBundle\Tests\Service\IosPushServiceNotifyTest::testNotifyUser This test printed output: Mon, 18 Aug 2014 17:44:19 +0100 ApnsPHP[56360]: INFO: Trying ssl://gateway.sandbox.push.apple.com:2195... Mon, 18 Aug 2014 17:44:20 +0100 ApnsPHP[56360]: INFO: Connected to ssl://gateway.sandbox.push.apple.com:2195. Mon, 18 Aug 2014 17:44:20 +0100 ApnsPHP[56360]: INFO: Sending messages queue, run #1: 1 message(s) left in queue. Mon, 18 Aug 2014 17:44:20 +0100 ApnsPHP[56360]: STATUS: Sending message ID 1 [custom identifier: unset] (1/3): 145 bytes. Mon, 18 Aug 2014 17:44:21 +0100 ApnsPHP[56360]: INFO: Disconnected.
[20:44:42][Step 1/1] Process exited with code 1
[20:44:42][Step 1/1] Ant output
[20:44:42][Ant output] [exec] 5) PROJECT\FrontendBundle\Tests\Controller\FrontendControllerTest::testGetListThrowsErrorIfDataIsFalse
[20:44:42][Ant output] [exec] This test did not perform any assertions
[20:44:42][Ant output] [exec]
[20:44:42][Ant output] [exec] 6) PROJECT\FrontendBundle\Tests\Controller\FrontendControllerTest::testGetListReturnsOkOnValidData
[20:44:42][Ant output] [exec] This test did not perform any assertions
[20:44:42][Ant output] [exec]
[20:44:42][Ant output] [exec] 7) PROJECT\FrontendBundle\Tests\Controller\SiteControllerTest::testSiteCreateWithValidParams
[20:44:42][Ant output] [exec] This test did not perform any assertions
[20:44:42][Ant output] [exec]
[20:44:42][Ant output] [exec] 8) PROJECT\FrontendBundle\Tests\Controller\SiteControllerTest::testSiteCreateWithInvalidParams
[20:44:42][Ant output] [exec] This test did not perform any assertions
[20:44:42][Ant output] [exec]
[20:44:42][Ant output] [exec] 9) PROJECT\LoginBundle\Tests\Controller\LoginTest::testLogoutWorks
[20:44:42][Ant output] [exec] This test did not perform any assertions
[20:44:42][Ant output] [exec]  [37;41m                                         [0m
[20:44:42][Ant output] [exec]  [37;41mFAILURES!                                [0m
[20:44:42][Ant output] [exec]  [37;41mTests: 89, Assertions: 244, Failures: 1. [0m
[20:44:42][Ant output] [exec]
[20:44:42][Ant output] [exec] Generating code coverage report in Clover XML format ... done
[20:44:42][Ant output] [exec]
[20:44:42][Ant output] [exec] Generating code coverage report in HTML format ... done
[20:44:42][Ant output] [exec] Result: 1
[20:44:42][Ant output] [zip] Building zip: /usr/src/TeamCity/buildAgent/work/510bc6c0ea46f8a6/coverage.zip
[20:44:42][Ant output] [echo]
[20:44:42][Ant output] ##teamcity[publishArtifacts '/usr/src/TeamCity/buildAgent/work/510bc6c0ea46f8a6/coverage.zip']
[20:44:42][Ant output] [echo]
[20:44:42][Ant output] ##teamcity[importData type='junit' path='/usr/src/TeamCity/buildAgent/temp/buildTmp/phpunit-log.xml']
[20:44:42][Ant output]
[20:44:42][Ant output] BUILD FAILED
[20:44:42][Ant output] /usr/src/TeamCity/buildAgent/work/510bc6c0ea46f8a6/build2465695295428571469.tmp:45: Unit test error.
[20:44:42][Ant output]
[20:44:42][Ant output] Total time: 2 minutes 5 seconds


How can i debug this problem and find why it's not working as it's should?
1 comment
Comment actions Permalink

Hi,

Did you launch build from console using the same command line as in TeamCity build step, on the same machine where agent runs, in the same working directory and under the same user that agent is running? For more details please see steps described here.
Could you try to add command line option depending on how you run build to print more logs (for example see http://phpunit.de/manual/4.1/en/textui.html)?

Also we have a related feature request, please watch/vote for it.

0

Please sign in to leave a comment.