Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache on successful file processing #3614

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/e2e_with_cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
php_version: ['8.1']
directory:
- 'e2e/applied-rule-removed-node-with-cache'
- 'e2e/timeout-file-not-cached'

name: End to end test - ${{ matrix.directory }}

Expand Down
1 change: 1 addition & 0 deletions e2e/timeout-file-not-cached/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/vendor
7 changes: 7 additions & 0 deletions e2e/timeout-file-not-cached/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"require": {
"php": "^8.1"
},
"minimum-stability": "dev",
"prefer-stable": true
}
7 changes: 7 additions & 0 deletions e2e/timeout-file-not-cached/expected-output.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[ERROR] Could not process
"/home/runner/work/rector-src/rector-src/vendor/symplify/easy-parallel/
src/ValueObject/ParallelProcess.php" file, due to:
"Child process timed out after 1 seconds". On line: 105

[ERROR] Could not process some files, due to:
"Reached system errors count limit of 50, exiting...".
18 changes: 18 additions & 0 deletions e2e/timeout-file-not-cached/rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->cacheClass(FileCacheStorage::class);
$rectorConfig->parallel(1);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used 1 second timeout to maximize chances of timeout


$rectorConfig->paths([
__DIR__ . '/src',
]);

$rectorConfig->sets([LevelSetList::UP_TO_PHP_82]);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used a big rule set to maximize chances of timeout

};