-
Notifications
You must be signed in to change notification settings - Fork 44
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
Stop reporting tests without assert as risky #72
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few questions:
- why this wasn't causing any issues in the past?
- is there any official way (except
$this->assertTrue(true);
approach) to mark those 2 tests so that they don't cause any harm?
If you look at any recent workflow run you'll see that many tests are marked as risky - it's only a warning, so it's not marking the tests as failed. When I started writing tests for the file matchers, I wasn't able to easily find the failures of my tests, because of the overwhelming number of reported risky tests. Unfortunately, it's not only caused by the This change will only clean the output of tests, but won't actually solve the underlying issue in test design. Honestly, I only wanted to fix the test environment so I'll be able to proceed with writing the file matchers without unnecessary hassle. I think the available options are:
Personally, I consider options 2 and 3 equivalent to setting Fixing the test design might not be always straightforward and might require much more effort. For example in |
Meaning of Turned out there are 97 more tests (not counting That was solved in the Mockery project via a test listener (used to work like this before, but not sure this works on recent PHPUnit version), that added performed assertion account via Theoretically:
Not sure if you can do that via PHPUnit hook or a trait is needed like it's done in Mockery these days. |
AbstractMatcherTest->testIsNullSafe()
andAbstractMatcherTest->testCopesWithUnknownTypes()
execute no assertion by design. Currently there are 195 tests marked as risky due to this. This change will stop reporting all these tests as risky.