-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
PHPUnit test suite fails on Windows #1354
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c1bf461
Fixed XML::load() does not report libxml errors on Windows.
sun b93090b
Fixed XML::load() fails to load relative XInclude paths on Windows.
sun de80d07
Exclude system temp directory in stack traces on Windows.
sun 6c1e0cb
Fixed PHPT file path expectations fail on Windows.
sun 59a3263
Include process isolation file prefix to avoid false-positive matches.
sun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 might be the only debatable change.
Technically, it not only hides the process isolation script from stack traces, but any PHP code that happens to be executed through a temporary file in the temporary directory.
However, even on the assumption that such an edge case exists in the wild in the first place, then additional stack frames like the following are not exactly helpful anyway:
That's why I added the system's temporary directory to the blacklist instead.
Before doing this change, I considered two alternatives:
%A
where stack traces are asserted in the output, so as to account for the two additional frames on Windows.(2) would be cumbersome to maintain + tests would be guaranteed to break on Windows in the future again. (1) sounds nice, but requires relatively complex code to introspect each stack trace.
Therefore, I went with this KISS solution.
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.
Seems like you could also add the following to
PHPUnit_Util_Blacklist::isBlacklisted()
: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.
To quote the PHP manual:
The temporary file names are still compatible with filesystems that only support 8.3 filenames.
We can minimally adjust it and append
'PHP'
to the blacklisted pathname (which are checked viastrpos()
anyway), although the likelihood of a prefix-clash would be relatively high, because'PHP'
is a fairly generic prefix for PHP software. 😉But yeah, let me do that, so as to do the maximum to avoid false-positives.
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.
Hard to say what the likelihood of a clash would be without some sort of empirical data. If we really believe it's an issue, we could always add an interface for supplying the exact filenames to blacklist.
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've included the prefix now.