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

Measured time must include test setup/teardown #378

Closed
mvorisek opened this issue Nov 28, 2023 · 0 comments · Fixed by #380
Closed

Measured time must include test setup/teardown #378

mvorisek opened this issue Nov 28, 2023 · 0 comments · Fixed by #380

Comments

@mvorisek
Copy link
Contributor

Currently the measured time does not include test teardown.

The solution is to drop
https://github.com/ergebnis/phpunit-slow-test-detector/blob/2.4.0/src/Subscriber/TestPassedSubscriber.php
as it is called in
https://github.com/sebastianbergmann/phpunit/blob/10.4.2/src/Framework/TestCase.php#L723
and use
https://github.com/sebastianbergmann/phpunit/blob/10.4.2/src/Framework/TestRunner.php#L238
"test finished" hook solely instead.

In "test finished" hook TestCase->status()->isFailure() && TestCase->status()->isError() can be used to filter out non-passing tests, but probably even non-passing tests can/should be reported if slow.

@mvorisek mvorisek changed the title Measured time must include test teardown Measured time must include test setup/teardown Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant