mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 00:07:22 +01:00
feat: adds --retry option
This commit is contained in:
23
src/Subscribers/EnsureFailedTestsAreStoredForRetry.php
Normal file
23
src/Subscribers/EnsureFailedTestsAreStoredForRetry.php
Normal 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());
|
||||
}
|
||||
}
|
||||
23
src/Subscribers/EnsureRetryRepositoryExists.php
Normal file
23
src/Subscribers/EnsureRetryRepositoryExists.php
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user