mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Merge pull request #5109 from appwrite/feat-slow-tests-hook
Feature slow test
This commit is contained in:
@@ -3,9 +3,11 @@
|
||||
namespace Appwrite\Tests;
|
||||
|
||||
use PHPUnit\Runner\AfterTestHook;
|
||||
use Exception;
|
||||
|
||||
class TestHook implements AfterTestHook
|
||||
{
|
||||
protected const MAX_SECONDS_ALLOWED = 15;
|
||||
public function executeAfterTest(string $test, float $time): void
|
||||
{
|
||||
printf(
|
||||
@@ -13,5 +15,9 @@ class TestHook implements AfterTestHook
|
||||
$test,
|
||||
$time * 1000
|
||||
);
|
||||
|
||||
if ($time > self::MAX_SECONDS_ALLOWED) {
|
||||
fwrite(STDOUT, sprintf("\e[31mThe %s test is slow, it took %s seconds!\n\e[0m", $test, $time));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user