Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test is marked as green, when there is some php error #286

Open
waliwdenko opened this issue Feb 22, 2025 · 5 comments
Open

test is marked as green, when there is some php error #286

waliwdenko opened this issue Feb 22, 2025 · 5 comments

Comments

@waliwdenko
Copy link

When in test is some error, phpunit will output:

Time: 00:00.102, Memory: 10.00 MB
Tests: 1, Assertions: 0, Errors: 1.

PHPUnit Test Explorer will mark as green in that case, should mark as not passed.

@recca0120
Copy link
Owner

need more information, run phpunit --teamcity and paste the output to here

@waliwdenko
Copy link
Author

need more information, run phpunit --teamcity and paste the output to here

/srv/app # php vendor/bin/phpunit --teamcity
PHPUnit 10.5.45 by Sebastian Bergmann and contributors.

Runtime: PHP 8.3.15
Configuration: /srv/app/phpunit.xml

##teamcity[testCount count='40' flowId='5161']
##teamcity[testSuiteStarted name='/srv/app/phpunit.xml' flowId='5161']
##teamcity[testSuiteStarted name='Project Test Suite' flowId='5161']
##teamcity[testSuiteStarted name='App\Tests\Ecommerce\Offer\Synchronizer\PriceSynchronizerTest' locationHint='php_qn:///srv/app/tests/Ecommerce/Offer/Synchronizer/PriceSynchronizerTest.php::\App\Tests\Ecommerce\Offer\Synchronizer\PriceSynchronizerTest' flowId='5161']
##teamcity[testFailed name='testProductNeedUpdateReturnsFalseWhenPriceSyncNotEnabled' message='Error: Class "App\Ecommerce\Offer\Synchronizer\PriceSynchronizer" not found' details='/srv/app/tests/Ecommerce/Offer/Synchronizer/PriceSynchronizerTest.php:28|n' duration='0' flowId='5161']
##teamcity[testSuiteFinished name='App\Tests\Ecommerce\Offer\Synchronizer\PriceSynchronizerTest' flowId='5161']
##teamcity[testSuiteFinished name='Project Test Suite' flowId='5161']
##teamcity[testSuiteFinished name='/srv/app/phpunit.xml' flowId='5161']
Time: 00:00.119, Memory: 10.00 MB

There was 1 error:

  1. App\Tests\Ecommerce\Offer\Synchronizer\PriceSynchronizerTest::testProductNeedUpdateReturnsFalseWhenPriceSyncNotEnabled
    Error: Class "App\Ecommerce\Offer\Synchronizer\PriceSynchronizer" not found

/srv/app/tests/Ecommerce/Offer/Synchronizer/PriceSynchronizerTest.php:28

ERRORS!
Tests: 1, Assertions: 0, Errors: 1.

@recca0120
Copy link
Owner

it's wired, test falied teamcity should have there lines

[testStarted name='test case name' locationHint="php_qn://file:test_case_name"]
[testFailed name='test_case_name' message="xxx" details="xxx"]
[testFinished name='test case name']

but your teamcity log only has testFailed. so this extension can't find the error location.

if you can create a repository and upload to github. I can get more information for this issue

@waliwdenko
Copy link
Author

Hello,

during creating clean repo to reproduce for you i found some hint - when i have test and it passed ok (green icon), but after that when test have syntax error and i will run it again - test still have green icon.

When i clean all result and run test again - test with syntax error will have only grey circle (no green or red icon).

Maybe i will help to check the problem. If not - i can publish some clean symfony repo with one test.

@waliwdenko
Copy link
Author

P.S. when test have syntax error and is marked with grey circle then on top in tree it will not indicate any problems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants