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
Always use a template file for in process tests for much better DX #2548
Always use a template file for in process tests for much better DX #2548
Conversation
A lot of tests fail. Can you have a look? Thanks. |
Sure, I just didn't thought about running them :) |
I was able to fix a good amount of the failures. Let's see I can figure out the others. |
src/Util/PHP.php
Outdated
@@ -63,7 +66,7 @@ public function __construct() | |||
$this->runtime = new Runtime(); | |||
} | |||
|
|||
/** | |||
/** |
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.
Why?
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.
Thank you for the pointer! No reason of course. I fixed that.
@dawehner Any progress on those remaining test failures? Thanks! |
@sebastianbergmann Not yet sadly. I'll try to work on it maybe tonight or more realistic on the weekend. To be honest some of them at least seem to be non trivial for me. |
@dawehner Thank you for the update. |
Sorry to bother you again: any progress? Thanks! |
Sorry :( I hope I have some time tomorrow or tonight to debug what is going on. I had hopes to pull some data out of sun when I saw him recently, but you know, sometimes that's hard. |
Any update? |
Nope, sorry :(
Sebastian Bergmann <notifications@github.com> schrieb am Di., 4. Juli 2017
um 10:08 Uhr:
… Any update?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2548 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABz7o8X7iusuwcK-L9WDC20v4VFk6Ckks5sKgEWgaJpZM4MSaGB>
.
|
@dawehner Damn! I totally forgot to talk to you about this in Vienna. |
*/ | ||
abstract class AbstractPhpProcess | ||
class PHP |
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.
Name is too generic, when you give only a name to someone, he will have on idea what to expect.
for logic in this class - maybe replace most of it with symfony/process ?
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.
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.
👍 for switching to process component in separated PR/issue.
Yet, still, PHP
is way too generic and meaningless name, it shall be modified
@@ -66,7 +66,7 @@ class PhptTestCase implements Test, SelfDescribing | |||
* Constructs a test case with the given filename. | |||
* | |||
* @param string $filename | |||
* @param AbstractPhpProcess $phpUtil | |||
* @param \PHPUnit\Util\PHP $phpUtil |
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.
changing param type for regular method is BC breaker.
@sebastianbergmann , do you treat changing __construct
params as BC breaker ? I know some do, some don;t
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 a good question!
* | ||
* @see https://bugs.php.net/bug.php?id=51800 | ||
*/ | ||
class WindowsPhpProcess extends DefaultPhpProcess |
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.
now my code depending on this public class will stop working :(
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.
Just because a class is public
does not mean that is part of the public API of a package.
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.
damn, without any indicator that it's not part of public API, it's hard to know that :(
so one could rely on it
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.
True. But should I really have to add @internal
to almost all classes?
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.
There are 2 ways, either add @internal
to non-public, or @api
to public.
Without this info, user cannot know that it's internal, so he assumes it's open to use and follows SEMVER.
note: Usually, I mark most classes with @internal
and I'm making most classes final (so non-internal got final), leaving only few of them open to extend via inheritance.
@sebastianbergmann |
This branch has conflicts that must be resolved, please send a new pull request when you're ready. |
When you have test failures in subprocess tests, they can be hard to debug, as phpunit
uses a piped in php file by default. This makes it impossible for xdebug to inspect the file
and also requires phpunit to ship with a php-eval.php file.
As suggested by @sebastianbergmann in #2008 (comment)
we can drop some subclassing, when we require the file parameter.
Note: I removed the windows class, as the php bug mentioned in it got solved in 2014, so it should be part of php7.
As suggested by sebastian this also moves the class, removes the factory etc.