-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
Add e2e tests for dry run #3616
Conversation
@samsonasik this is the easiest way I found to test that dry run works properly, what do you think? |
@samsonasik not ready yet, missed that the 2nd run must use the cache.. |
1d110f2
to
8244f88
Compare
@samsonasik now it works! 🎉 See it makes a broken version of #3614 (same code as #3604) fail that test: https://github.com/rectorphp/rector-src/actions/runs/4704720583/jobs/8344596305?pr=3614 |
use Rector\DeadCode\Rector\If_\RemoveAlwaysTrueIfConditionRector; | ||
|
||
return static function (RectorConfig $rectorConfig): void { | ||
$rectorConfig->cacheClass(FileCacheStorage::class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the added line to the config from the original e2e/applied-rule-removed-node folder.
It makes the cache persistent between job steps
// so we can use helper classes here | ||
require_once __DIR__ . '/../vendor/autoload.php'; | ||
|
||
$e2eCommand = 'php '. $rectorBin .' process --dry-run --no-ansi -a '. $autoloadFile; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This runner is a lighter version of the original one, removing the --clear-cache
here, and support for custom parameters because they are not needed for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
Thank you @yguedidi |
see #3614 (comment)