Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2fd17e6
style(php-cs-fixer): fix coding standards
Oct 28, 2024
ed75242
Add architecture tests
roxblnfk Oct 28, 2024
38a2eb3
Remove forgotten `tr()`
roxblnfk Oct 28, 2024
a1d6236
Merge pull request #521: add arch tests
roxblnfk Oct 28, 2024
ca4f27d
style(php-cs-fixer): fix coding standards
Oct 28, 2024
3af5daf
Resolve all the deprecations in tests
roxblnfk Nov 5, 2024
76129b1
Fix deprecation on Service Client exception parsing
roxblnfk Nov 5, 2024
6fc1cb9
Deprecate `Schedule\Spec\ScheduleSpec::$excludeCalendarList` and stop…
roxblnfk Nov 5, 2024
8da10b0
Update psalm baseline
roxblnfk Nov 5, 2024
9d7225c
Deprecate `ScheduleSpec::withExcludeCalendarList()` and `ScheduleSpec…
roxblnfk Nov 5, 2024
3a564a9
CI: run windows tests with protobuf ext only
roxblnfk Nov 5, 2024
ca4a595
Update psalm baseline
roxblnfk Nov 5, 2024
9397729
Revert some changes in ScheduleSpec and its mapper
roxblnfk Nov 7, 2024
ee90e67
Fix intervals between retries in Client API calls (#525)
roxblnfk Nov 7, 2024
a271938
Merge pull request #523: Resolve deprecations, update CI
roxblnfk Nov 7, 2024
0dba125
Fix PHP8.4 nullable types deprecations
roxblnfk Dec 9, 2024
3d9737f
ci: add PHP 8.4 in tests pipeline
roxblnfk Dec 9, 2024
756e749
fix "Error when evaluating 'timeout-minutes' for job 'test'"
roxblnfk Dec 9, 2024
9b3feb4
Add composer command `get:binaries` and use it in CI
roxblnfk Dec 9, 2024
d77ad58
Ignore PHP dependencies constrain in CI when PHP 8.4 is used
roxblnfk Dec 9, 2024
40f6299
Use DLOAD util via CPX because it fails in lower deps with PHP 8.4
roxblnfk Dec 9, 2024
552c26f
Functional tests bootstrap: build RR start command based on the curre…
roxblnfk Dec 9, 2024
00c4108
Fix min symfony/http-client version to improve tests
roxblnfk Dec 9, 2024
5c86db5
Merge pull request #534: PHP 8.4 compatibility
roxblnfk Dec 9, 2024
ed4d291
Merge remote-tracking branch 'origin/2.11' into 2-11-x-fixes
roxblnfk Dec 9, 2024
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
47 changes: 31 additions & 16 deletions .github/workflows/run-test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,21 @@ jobs:
test:
name: PHP${{ matrix.php }}${{ matrix.extensions-suffix }}, ${{ matrix.os }}, ${{ matrix.dependencies }} deps
runs-on: ${{ matrix.os }}
timeout-minutes: ${{ matrix.timeout-minutes }}
timeout-minutes: ${{ inputs.test-timeout }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
fail-fast: ${{ inputs.fail-fast }}
matrix:
php: [ 8.1, 8.2, 8.3 ]
os: [ ubuntu-latest, windows-latest ]
php: [ 8.1, 8.2, 8.3, 8.4 ]
os: [ ubuntu-latest ]
extensions-suffix: [ '', ', protobuf' ]
dependencies: [ lowest , highest ]
timeout-minutes: [ '${{ inputs.test-timeout }}' ]
exclude:
- os: windows-latest
php: 8.2
include:
- os: windows-latest
extensions-suffix: ', protobuf'
- os: windows-latest
php: 8.3
php: 8.1
dependencies: highest
steps:
- name: Set Git To Use LF
run: |
Expand All @@ -82,6 +79,10 @@ jobs:
- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Download CPX (PHP 8.4)
if: inputs.download-binaries == true && matrix.php == '8.4'
run: composer global require cpx/cpx

- name: Get Composer Cache Directory
id: composer-cache
run: |
Expand All @@ -96,23 +97,37 @@ jobs:
php-${{ matrix.php }}-${{ matrix.os }}-composer-

- name: Install lowest dependencies from composer.json
if: matrix.dependencies == 'lowest'
if: matrix.dependencies == 'lowest' && matrix.php != '8.4'
run: composer update --no-interaction --no-progress --prefer-lowest

- name: Install lowest dependencies from composer.json ignoring ext-php constraint (PHP 8.4)
if: matrix.dependencies == 'lowest' && matrix.php == '8.4'
run: composer update --no-interaction --no-progress --prefer-lowest --ignore-platform-req php


- name: Validate lowest dependencies
if: matrix.dependencies == 'lowest'
if: matrix.dependencies == 'lowest' && matrix.php == '8.1'
env:
COMPOSER_POOL_OPTIMIZER: 0
run: vendor/bin/validate-prefer-lowest


- name: Install highest dependencies from composer.json
if: matrix.dependencies == 'highest'
if: matrix.dependencies == 'highest' && matrix.php != '8.4'
run: composer update --no-interaction --no-progress

- name: Download RoadRunner
if: inputs.download-binaries == true
run: |
vendor/bin/dload get --no-interaction -vv
- name: Install highest dependencies from composer.json ignoring ext-php constraint (PHP 8.4)
if: matrix.dependencies == 'highest' && matrix.php == '8.4'
run: composer update --no-interaction --no-progress --ignore-platform-req php


- name: Download binaries
if: inputs.download-binaries == true && matrix.php != '8.4'
run: composer get:binaries

- name: Download binaries (PHP 8.4)
if: inputs.download-binaries == true && matrix.php == '8.4'
run: cpx internal/dload get --no-interaction

- name: Run tests
run: ${{ inputs.test-command }}
40 changes: 39 additions & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,43 @@ jobs:
- name: Install Composer Dependencies
run: composer install --prefer-dist --no-interaction

- name: Run Tests
- name: 🔍 Run Tests
run: vendor/bin/psalm

arch:
name: Architecture tests
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
php: [8.3]
os: [ubuntu-latest]
steps:
- name: Set up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom

- name: Check Out Code
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache Dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: php-${{ matrix.php }}-${{ runner.os }}-composer-

- name: Install Composer Dependencies
run: composer install --prefer-dist --no-interaction

- name: 🔍 Run Tests
run: composer test:arch
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"spiral/roadrunner-kv": "^4.2",
"spiral/roadrunner-worker": "^3.5",
"symfony/filesystem": "^5.4 || ^6.0 || ^7.0",
"symfony/http-client": "^5.4 || ^6.0 || ^7.0",
"symfony/http-client": "^5.4.3 || ^6.0.3 || ^7.0",
"symfony/process": "^5.4 || ^6.0 || ^7.0"
},
"autoload": {
Expand All @@ -61,7 +61,7 @@
"phpunit/phpunit": "^10.5",
"spiral/code-style": "~2.1.2",
"spiral/core": "^3.13",
"symfony/var-dumper": "^6.0 || ^7.0",
"ta-tikoma/phpunit-architecture-test": "^0.8.4",
"vimeo/psalm": "^4.30 || ^5.4"
},
"autoload-dev": {
Expand All @@ -81,12 +81,14 @@
},
"scripts": {
"post-update-cmd": "Temporal\\Worker\\Transport\\RoadRunnerVersionChecker::postUpdate",
"get:binaries": "dload get --no-interaction -vv",
"cs:diff": "php-cs-fixer fix --dry-run -v --diff --show-progress dots",
"cs:fix": "php-cs-fixer fix -v",
"psalm": "psalm",
"psalm:baseline": "psalm --set-baseline=psalm-baseline.xml",
"test:unit": "phpunit --testsuite=Unit --color=always --testdox",
"test:func": "phpunit --testsuite=Functional --color=always --testdox",
"test:arch": "phpunit --testsuite=Arch --color=always --testdox",
"test:accept": "phpunit --testsuite=Acceptance --color=always --testdox"
},
"extra": {
Expand Down
9 changes: 9 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,20 @@
stopOnFailure="false"
stopOnError="false"
stderr="true"
displayDetailsOnIncompleteTests="true"
displayDetailsOnSkippedTests="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true"
>
<testsuites>
<testsuite name="Acceptance">
<directory suffix="Test.php">tests/Acceptance/Harness</directory>
</testsuite>
<testsuite name="Arch">
<directory suffix="Test.php">tests/Arch</directory>
</testsuite>
<testsuite name="Unit">
<directory suffix="TestCase.php">tests/Unit</directory>
</testsuite>
Expand Down
16 changes: 6 additions & 10 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@
<code><![CDATA[$workflowType]]></code>
</PropertyNotSetInConstructor>
</file>
<file src="src/Client/Schedule/Spec/ScheduleSpec.php">
<DeprecatedProperty>
<code><![CDATA[$this->excludeCalendarList]]></code>
<code><![CDATA[$this->excludeCalendarList]]></code>
</DeprecatedProperty>
</file>
<file src="src/Client/Update/UpdateHandle.php">
<PossiblyNullArgument>
<code><![CDATA[$result->getSuccess()]]></code>
Expand Down Expand Up @@ -508,7 +514,6 @@
</file>
<file src="src/Internal/Declaration/Reader/WorkflowReader.php">
<ArgumentTypeCoercion>
<code><![CDATA[$class]]></code>
<code><![CDATA[$contextualRetry]]></code>
<code><![CDATA[$method]]></code>
<code><![CDATA[$name]]></code>
Expand Down Expand Up @@ -1218,10 +1223,6 @@
<InvalidOperand>
<code><![CDATA[$promisesOrValues]]></code>
</InvalidOperand>
<MissingParamType>
<code><![CDATA[$promiseOrValue]]></code>
<code><![CDATA[$promiseOrValue]]></code>
</MissingParamType>
<TooManyArguments>
<code><![CDATA[$reduce($c, $value, $i++, $total)]]></code>
</TooManyArguments>
Expand Down Expand Up @@ -1367,11 +1368,6 @@
<code><![CDATA[$method]]></code>
</ArgumentTypeCoercion>
</file>
<file src="src/Worker/Transport/RPCConnectionInterface.php">
<MissingParamType>
<code><![CDATA[$payload]]></code>
</MissingParamType>
</file>
<file src="src/Worker/Transport/RoadRunner.php">
<ArgumentTypeCoercion>
<code><![CDATA[$env->getRelayAddress()]]></code>
Expand Down
3 changes: 0 additions & 3 deletions src/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ final class Activity extends Facade
/**
* Returns information about current activity execution.
*
* @return ActivityInfo
* @throws OutOfContextException in the absence of the activity execution context.
*/
public static function getInfo(): ActivityInfo
Expand All @@ -53,7 +52,6 @@ public static function getInfo(): ActivityInfo
* }
* ```
*
* @return ValuesInterface
* @throws OutOfContextException in the absence of the activity execution context.
*/
public static function getInput(): ValuesInterface
Expand All @@ -69,7 +67,6 @@ public static function getInput(): ValuesInterface
*
* This method returns **true** if the first argument has been passed to the {@see Activity::heartbeat()} method.
*
* @return bool
* @throws OutOfContextException in the absence of the activity execution context.
*/
public static function hasHeartbeatDetails(): bool
Expand Down
4 changes: 0 additions & 4 deletions src/Activity/ActivityContextInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ interface ActivityContextInterface
*
* @see Activity::getInfo()
*
* @return ActivityInfo
*/
public function getInfo(): ActivityInfo;

Expand All @@ -31,7 +30,6 @@ public function getInfo(): ActivityInfo;
*
* @see Activity::getInput()
*
* @return ValuesInterface
*/
public function getInput(): ValuesInterface;

Expand All @@ -40,7 +38,6 @@ public function getInput(): ValuesInterface;
*
* @see Activity::hasHeartbeatDetails()
*
* @return bool
*/
public function hasHeartbeatDetails(): bool;

Expand All @@ -59,7 +56,6 @@ public function getHeartbeatDetails($type = null);
*
* @see Activity::doNotCompleteOnReturn()
*
* @return void
*/
public function doNotCompleteOnReturn(): void;

Expand Down
20 changes: 0 additions & 20 deletions src/Activity/ActivityInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,16 @@ final class ActivityInfo
*
* @see ActivityCompletionClientInterface::complete()
*
* @var string
*/
#[Marshal(name: 'TaskToken')]
public string $taskToken;

/**
* @var WorkflowType|null
*/
#[Marshal(name: 'WorkflowType', type: NullableType::class, of: WorkflowType::class)]
public ?WorkflowType $workflowType = null;

/**
* @var string
*/
#[Marshal(name: 'WorkflowNamespace')]
public string $workflowNamespace = 'default';

/**
* @var WorkflowExecution|null
*/
#[Marshal(name: 'WorkflowExecution', type: NullableType::class, of: WorkflowExecution::class)]
public ?WorkflowExecution $workflowExecution = null;

Expand All @@ -67,53 +57,44 @@ final class ActivityInfo
*
* @see ActivityCompletionClientInterface::complete()
*
* @var string
*/
#[Marshal(name: 'ActivityID')]
public string $id;

/**
* Type (name) of the activity.
*
* @var ActivityType
*/
#[Marshal(name: 'ActivityType', type: ObjectType::class, of: ActivityType::class)]
public ActivityType $type;

/**
* @var string
*/
#[Marshal(name: 'TaskQueue')]
public string $taskQueue = WorkerFactoryInterface::DEFAULT_TASK_QUEUE;

/**
* Maximum time between heartbeats. 0 means no heartbeat needed.
*
* @var \DateInterval
*/
#[Marshal(name: 'HeartbeatTimeout', type: DateIntervalType::class)]
public \DateInterval $heartbeatTimeout;

/**
* Time of activity scheduled by a workflow
*
* @var \DateTimeInterface
*/
#[Marshal(name: 'ScheduledTime', type: DateTimeType::class)]
public \DateTimeInterface $scheduledTime;

/**
* Time of activity start
*
* @var \DateTimeInterface
*/
#[Marshal(name: 'StartedTime', type: DateTimeType::class)]
public \DateTimeInterface $startedTime;

/**
* Time of activity timeout
*
* @var \DateTimeInterface
*/
#[Marshal(name: 'Deadline', type: DateTimeType::class)]
public \DateTimeInterface $deadline;
Expand All @@ -122,7 +103,6 @@ final class ActivityInfo
* Attempt starts from 1, and increased by 1 for every retry if
* retry policy is specified.
*
* @var int
*/
#[Marshal(name: 'Attempt')]
public int $attempt = 1;
Expand Down
3 changes: 0 additions & 3 deletions src/Activity/ActivityInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ class ActivityInterface
#[Immutable]
public string $prefix = '';

/**
* @param string $prefix
*/
public function __construct(string $prefix = '')
{
$this->prefix = $prefix;
Expand Down
5 changes: 1 addition & 4 deletions src/Activity/ActivityMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ final class ActivityMethod
#[Immutable]
public ?string $name = null;

/**
* @param string|null $name
*/
public function __construct(string $name = null)
public function __construct(?string $name = null)
{
$this->name = $name;
}
Expand Down
Loading
Loading