-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Issue#2591no2 #2664
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
Issue#2591no2 #2664
Conversation
… all test methods running in the same process.
…a separate process.
Codecov Report
@@ Coverage Diff @@
## master #2664 +/- ##
===========================================
+ Coverage 53.85% 55.4% +1.54%
- Complexity 2745 2756 +11
===========================================
Files 102 102
Lines 7193 7218 +25
===========================================
+ Hits 3874 3999 +125
+ Misses 3319 3219 -100
Continue to review full report at Codecov.
|
@@ -47,7 +47,12 @@ function __phpunit_run_isolated_test() | |||
$result->beStrictAboutTodoAnnotatedTests({isStrictAboutTodoAnnotatedTests}); | |||
$result->beStrictAboutResourceUsageDuringSmallTests({isStrictAboutResourceUsageDuringSmallTests}); | |||
|
|||
$test = new {className}('{methodName}', unserialize('{data}'), '{dataName}'); |
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.
Would it make sense to use a new, separate template here? Maybe TestCaseClass.tpl.dist
.
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.
Of course, I think so, especially that I've just made changes to TestCaseMethod file.
src/Framework/TestCase.php
Outdated
* | ||
* @var bool | ||
*/ | ||
protected $runClassInSeparateProcess; |
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.
Following the minimal visibility principle, this should be private
.
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.
I'll try that.
This fails now, probably due to change in sebastian/diff package from 1.4.1 to 1.4.2 https://github.com/sebastianbergmann/diff/ |
src/Framework/TestCase.php
Outdated
__DIR__ . '/../Util/PHP/Template/TestCaseMethod.tpl' | ||
); | ||
if ($runEntireClass) { | ||
$template = new Text_Template( |
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.
Spaces must be used to indent lines; tabs are not allowed
src/Framework/TestCase.php
Outdated
); | ||
if ($runEntireClass) { | ||
$template = new Text_Template( | ||
__DIR__ . '/../Util/PHP/Template/TestCaseClass.tpl' |
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.
Spaces must be used to indent lines; tabs are not allowed
src/Framework/TestCase.php
Outdated
if ($runEntireClass) { | ||
$template = new Text_Template( | ||
__DIR__ . '/../Util/PHP/Template/TestCaseClass.tpl' | ||
); |
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.
Spaces must be used to indent lines; tabs are not allowed
@sebastianbergmann template added, variable access changed, and all tests passing. |
Thanks! |
In the current 6.2 release the method TestSuite::createTest() only calls $_test->setRunClassInSeparateProcess() for tests with a data provider. |
And the @beforeClass, @afterclass, setUp() and tearDown() methods maybe should be called only in the isolated environment running the class. |
@KintradimCrux Can you please open tickets for these bugs? Thanks! |
Use @runClassInSeparateProcess annotation on test class to allow running a test class with process isolation.