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

Symfony 5.4 phpunit 9.5 with forceCoversAnnotation and beStrictAboutCoversAnnotation giving random failures #178

Open
rbaarsma opened this issue Dec 7, 2021 · 2 comments

Comments

@rbaarsma
Copy link

rbaarsma commented Dec 7, 2021

We just started a new project with Symfony 5.4 and phpunit 9.5. We've only implemented standard authetnication and some basic entities and cruds, but already see strange random issues in the tests.

We are executing:

find tests/ -name \"*Test.php\" | vendor/liuggio/fastest/fastest \"XDEBUG_MODE=coverage bin/phpunit {} --coverage-php cov/fastest/{n}.cov;\"
XDEBUG_MODE=coverage tools/phpcov merge cov/fastest/ --text cov/text.txt --html public/test.html

The errors we are getting are all warnings about Risky tests, ex:

There was 1 risky test:

1) Tests\Repository\OrganizationRepositoryTest::test
This test executed code that is not listed as code to be covered or used:
- /var/www/app/src/Entity/User.php:17

/var/www/app/vendor/phpunit/phpunit/src/Framework/TestResult.php:859
/var/www/app/vendor/phpunit/phpunit/src/Framework/TestSuite.php:678
/var/www/app/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:670

In every case the risky message is simply not true. If we execute the test solo (with coverage) or execute the suite without fastest, it works without any risky tests.

For now I've disabled beStrictAboutCoversAnnotation and it works fine.

@DonCallisto
Copy link
Collaborator

Hi, could you spin up a project in order to reproduce this behaviour?
After that I'll look for the issue.
The best would be for you to produce a PR as I'm the only active developer working on fastest at the moment, but if you don't know where to start, just spin up a simple POC for me or other willing to work on this.
Thank you.

DonCallisto added a commit that referenced this issue Dec 17, 2021
$_SERVER and $_ENV superglobals arguments keys case are now left untouched
@DonCallisto
Copy link
Collaborator

Sorry, I've closed this by mistake.

@DonCallisto DonCallisto reopened this Dec 17, 2021
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