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

Run a class in separate process. #2591

Closed
ArturGoldyn opened this issue Mar 30, 2017 · 5 comments
Closed

Run a class in separate process. #2591

ArturGoldyn opened this issue Mar 30, 2017 · 5 comments
Assignees
Labels
type/enhancement A new idea that should be implemented
Milestone

Comments

@ArturGoldyn
Copy link
Contributor

Q A
PHPUnit version 4.0.2
PHP version 5.3.3
Installation Method PHAR

We can run individual tests in separate processes, but we cannot run a test class in a separate process.
It would be nice to have @runTestsClassInSeparateProcess, not only @runTestsInSeparateProcesses

The goal is to run setUpBeforeClass once (it takes a few seconds), then perform all tests in separate process, and then at the end lose all global variable changes that occured.
Unfortunately some of our objects collide and don't allow us to pass to the next test, but they work with --process-isolation parameter perfectly. Therefore we would like to have a @runTestsClassInSeparateProcess annotation to run just few classes in separate process, but use this one process for all tests in this class.

@sebastianbergmann sebastianbergmann added the type/enhancement A new idea that should be implemented label Mar 30, 2017
@ArturGoldyn
Copy link
Contributor Author

I've started working on it yesterday, will finish this week.

@ArturGoldyn
Copy link
Contributor Author

For now it fails in AppVeyor. #2664

@ArturGoldyn
Copy link
Contributor Author

@sebastianbergmann I did it, and fixed that failing merge request, do you consider merging my branch to some release? Or does it need any alterations?

sebastianbergmann pushed a commit that referenced this issue Jun 1, 2017
… all test methods running in the same process.
sebastianbergmann pushed a commit that referenced this issue Jun 1, 2017
@sebastianbergmann sebastianbergmann added this to the PHPUnit 6.2 milestone Jun 1, 2017
@sebastianbergmann sebastianbergmann self-assigned this Jun 1, 2017
mbeccati pushed a commit to mbeccati/phpunit that referenced this issue Sep 6, 2017
mbeccati added a commit to mbeccati/phpunit that referenced this issue Sep 6, 2017
@kaphert
Copy link

kaphert commented Oct 11, 2017

Am I correct that this feature is implemented since 6.2 but is missing in the documentation?

Search in repository on runClassInSeparateProcess https://github.com/sebastianbergmann/phpunit/search?q=runClassInSeparateProcess&type=Code&utf8=%E2%9C%93

mbeccati added a commit to mbeccati/phpunit that referenced this issue Oct 18, 2017
…ror settings

The log_errors and display_errors settings were interfering with the actual test output,
causing the tests to fail under some circumstances (i.e. default php.ini values).
mbeccati added a commit to mbeccati/phpunit that referenced this issue Oct 18, 2017
…ror settings

The log_errors and display_errors settings were interfering with the actual test output, causing the tests to fail under some circumstances (i.e. default php.ini values).
sebastianbergmann pushed a commit that referenced this issue Oct 18, 2017
The log_errors and display_errors settings were interfering with the actual test output, causing the tests to fail under some circumstances (i.e. default php.ini values).
@WalterWoshid
Copy link

#5233

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement A new idea that should be implemented
Projects
None yet
Development

No branches or pull requests

4 participants