Fix tests count when tests were skipped in BeforeClass hook#6490
Conversation
src/Runner/TestResult/Collector.php
Outdated
| if ($this->prepared) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
not sure if this condition is needed, but I've mimicked what's done in testSkipped()
There was a problem hiding this comment.
codecov yells about it, and I don't know how to mave this condition true, so I'll remove the condition
2093629 to
1bc5d60
Compare
| SS 2 / 2 (100%) | ||
|
|
||
| Time: 00:00, Memory: 10.00 MB |
There was a problem hiding this comment.
is the impact on this case tolerable?
There was a problem hiding this comment.
I do not understand what impact you are refering to here. However: in the above, 00:00 and 10.00 MB must be replaced with %s.
There was a problem hiding this comment.
yeah, I've already fixed this.
I was just underlying that in this case (only one test class which is skipped), the output has changed
1bc5d60 to
9fac5ac
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 11.5 #6490 +/- ##
=========================================
Coverage 95.37% 95.38%
- Complexity 7151 7154 +3
=========================================
Files 737 738 +1
Lines 21853 21864 +11
=========================================
+ Hits 20843 20854 +11
Misses 1010 1010 ☔ View full report in Codecov by Sentry. |
9fac5ac to
fea3962
Compare
Hello,
when some tests are skipped in a "before class" hook, there is a problem in the output.
Let's say our test suite have:
#[RequiresPhp('^9.0')]here what its output looks like:
(BTW, the output is the same if the tests are skipped by calling
self::markTestSkipped()in a "before" hook)and now, the very same suite, but
self::markTestSkipped()is called in a "before class" hook:We can see several problems in the output, comparing to the previous one:
Here is a proposal to make this case coherent with any other mean to skip a full class of tests.