-
-
Notifications
You must be signed in to change notification settings - Fork 349
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
How to run tests in separate process? #270
Comments
I am afraid Pest don't support that feature. |
Are there plans for implementing that in the future? |
You can try to pull request this. It may be a little bit complicated tho. |
@nunomaduro what would be the best way to start working on implementing testing in a separate process? My idea was to first set unit tests. they would go something like this: Add three tests, two of those will meddle with set globals:
Running these would fail in the first pass ofc because the third won't be run in a separate process. Once the feature is implemented, the third test should pass. I was thinking of adding /**
* Run the current test in a separate process.
*/
public function runInSeparateProcess(): TestCall
{
$this->testCaseFactory->separateProcess = true;
return $this;
} The /**
* Identifier whether the test should be run in a separate process.
*
* @readonly
*
* @var bool
*/
public $separateProcess = false; Based on which we could trigger running a test in a separate process. This could (maybe) be extended to include preserving globals like in PHPUnit. We could mark the test which should be run in a separate process like: test('This should be run in a separate process', function(){
// Test body.
})->runInSeparateProcess(); I've seen that Any pointers on what should I look at when trying to work on this? Thanks! |
Is it possible to mention this discrepancy (and any others you can think of) on https://pestphp.com/docs/migrating-from-phpunit-guide ? |
I have looked in the documentation and here in the issues, but couldn't find any info about running the test in a separate process. The
annotation doesn't seem to be working.
The text was updated successfully, but these errors were encountered: