1
0
mirror of https://github.com/danog/loop.git synced 2024-11-30 04:19:04 +01:00

Add mutation testing

This commit is contained in:
Daniil Gentili 2023-09-30 15:04:23 +02:00
parent 83c42b26c1
commit 770be58c29
3 changed files with 8 additions and 4 deletions

View File

@ -38,7 +38,10 @@ jobs:
restore-keys: ${{ matrix.os }}-composer-${{ matrix.php-versions }}-
- name: Install dependencies
run: composer install --prefer-dist
run: |
composer install --prefer-dist
wget https://github.com/infection/infection/releases/download/0.27.0/infection.phar -O /usr/local/bin/infection
chmod +x /usr/local/bin/infection
- name: Run tests
env:
@ -47,6 +50,7 @@ jobs:
vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml
vendor/bin/php-cs-fixer --diff --dry-run -v fix
vendor/bin/psalm.phar --shepherd
infection --show-mutations --threads=$(nproc)
- name: Upload coverage to Codecov
env:

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" backupGlobals="false" backupStaticAttributes="false" bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" backupGlobals="false" backupStaticAttributes="false" bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" resolveDependencies="true" executionOrder="random">
<coverage>
<include>
<directory suffix=".php">lib</directory>

View File

@ -290,8 +290,8 @@ class GenericTest extends Fixtures
$this->assertTrue($loop->isPaused());
$pauseTime = GenericLoop::STOP;
$this->assertTrue($loop->resume(false));
$this->assertTrue($loop->resume(false));
$this->assertTrue($loop->resume());
EventLoop::queue(fn () => $this->assertTrue($loop->resume()));
$expectedRunCount++;
self::waitTick();
$this->assertEquals($expectedRunCount, $runCount);