feat: adds --retry option

This commit is contained in:
Nuno Maduro
2021-12-04 21:18:55 +00:00
parent 8047ae570d
commit 106b279ed0
17 changed files with 237 additions and 113 deletions

View File

@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace Pest\Subscribers;
use Pest\TestSuite;
use PHPUnit\Event\Test\Failed;
use PHPUnit\Event\Test\FailedSubscriber;
/**
* @internal
*/
final class EnsureFailedTestsAreStoredForRetry implements FailedSubscriber
{
/**
* Runs the subscriber.
*/
public function notify(Failed $event): void
{
TestSuite::getInstance()->retryTempRepository->add($event->test()->id());
}
}

View File

@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace Pest\Subscribers;
use Pest\TestSuite;
use PHPUnit\Event\TestRunner\Started;
use PHPUnit\Event\TestRunner\StartedSubscriber;
/**
* @internal
*/
final class EnsureRetryRepositoryExists implements StartedSubscriber
{
/**
* Runs the subscriber.
*/
public function notify(Started $event): void
{
TestSuite::getInstance()->retryTempRepository->boot();
}
}