Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ name: "Fast Forward Reports"

on:
push:
branches:
- main
branches: [main]
pull_request:
workflow_dispatch:

# Caller permissions cap the callee; only its isolated deploy job writes Pages.
permissions:
contents: write
contents: read
pages: write
id-token: write

jobs:
reports:
uses: php-fast-forward/dev-tools/.github/workflows/reports.yml@main
secrets: inherit
uses: php-fast-forward/dev-tools/.github/workflows/reports-native.yml@main
Comment thread
coisa marked this conversation as resolved.
9 changes: 5 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ on:
workflow_dispatch:

permissions:
contents: write
pages: write
id-token: write
contents: read # Read source; matrix jobs retain read-only tokens.
actions: read # Allow the checkout-free publisher to inspect matrix job results.
statuses: write # Caller ceiling; only isolated callee publishers request this permission.

jobs:
tests:
uses: php-fast-forward/dev-tools/.github/workflows/tests.yml@main
secrets: inherit
with:
publish-required-statuses: ${{ github.actor != 'dependabot[bot]' }}
3 changes: 1 addition & 2 deletions src/Worker/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
use FastForward\Fork\Signal\Signal;
use Psr\Log\LoggerInterface;
use Throwable;

use function error_reporting;
use function getmypid;
use function max;
Expand Down Expand Up @@ -446,6 +445,6 @@ private function isNoChildError(int $error): bool
*/
private function isNoSuchProcessError(int $error): bool
{
return (\defined('POSIX_ESRCH') ? \POSIX_ESRCH : self::NO_SUCH_PROCESS_ERROR) === $error;
return (\defined('POSIX_ESRCH') ? \constant('POSIX_ESRCH') : self::NO_SUCH_PROCESS_ERROR) === $error;
}
}
10 changes: 9 additions & 1 deletion tests/Manager/ForkManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,25 @@
use FastForward\Fork\Worker\Worker;
use FastForward\Fork\Worker\WorkerInterface;
use FastForward\Fork\Worker\WorkerState;
use FastForward\Fork\Worker\WorkerGroup;
use FastForward\Fork\Worker\WorkerOutputTransport;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;

use function getmypid;
use function pcntl_fork;
use function posix_getpid;
use function posix_kill;
use function usleep;

#[CoversClass(ForkManager::class)]
#[UsesClass(InvalidArgumentException::class)]
#[UsesClass(LogicException::class)]
#[UsesClass(Worker::class)]
#[UsesClass(WorkerGroup::class)]
#[UsesClass(WorkerState::class)]
#[UsesClass(WorkerOutputTransport::class)]
final class ForkManagerTest extends TestCase
{
use ReflectsNonPublicMembers;
Expand Down
4 changes: 3 additions & 1 deletion tests/Worker/WorkerStateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,18 @@
use FastForward\Fork\Tests\Support\ReflectsNonPublicMembers;
use FastForward\Fork\Tests\Support\SpyLogger;
use FastForward\Fork\Worker\WorkerState;
use FastForward\Fork\Worker\WorkerOutputTransport;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;

use function pcntl_fork;
use function pcntl_waitpid;
use function posix_kill;
use function usleep;

#[CoversClass(WorkerState::class)]
#[UsesClass(WorkerOutputTransport::class)]
final class WorkerStateTest extends TestCase
{
use ReflectsNonPublicMembers;
Expand Down
6 changes: 5 additions & 1 deletion tests/Worker/WorkerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@
use FastForward\Fork\Worker\WorkerGroupInterface;
use FastForward\Fork\Worker\WorkerInterface;
use FastForward\Fork\Worker\WorkerState;
use FastForward\Fork\Worker\WorkerOutputTransport;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use Psr\Log\LoggerInterface;

use function getmypid;
use function pcntl_fork;
use function pcntl_waitpid;
Expand All @@ -46,6 +47,9 @@
use function usleep;

#[CoversClass(Worker::class)]
#[UsesClass(LogicException::class)]
#[UsesClass(WorkerState::class)]
#[UsesClass(WorkerOutputTransport::class)]
final class WorkerTest extends TestCase
{
use ProphecyTrait;
Expand Down
Loading