Skip to content

Commit

Permalink
Cache on successful file processing (#3614)
Browse files Browse the repository at this point in the history
  • Loading branch information
yguedidi committed May 1, 2023
1 parent 1e085a0 commit f6972de
Show file tree
Hide file tree
Showing 15 changed files with 750 additions and 41 deletions.
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);

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

$rectorConfig->sets([LevelSetList::UP_TO_PHP_82]);
};

0 comments on commit f6972de

Please sign in to comment.