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
Updated and simplified PHP testing structure #8558
Merged
Merged
Conversation
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
- Consolidated on a single autoloader, created by composer. - Consolidated on a single phpunit invocation strategy: we run phpunit on a directory, which will run all tests matching *Test.php in that directory. - We now rely on autoloading to import all test protos. require_once() calls for test protos are removed. - For now the valgrind tests are removed. A follow-up PR will re-enable them in a more robust way.
1. Replace custom PHPUnit-selection logic in test.sh with generic composer version selection. 2. Optimized both test proto generation and the custom extension build to avoid unnecessary work when the files are already up to date.
Also removed undefined_test.php and fixed Makefile.am.
TeBoring
reviewed
May 4, 2021
|
||
spl_autoload_register(function($class) { | ||
if (strpos($class, "Google\\Protobuf") === 0) { | ||
throw new Exception("When using the C extension, we should not load runtime class: " . $class); |
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.
well known types are bundled in c extension?
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.
Yes, they are as of #7944
TeBoring
approved these changes
May 4, 2021
perezd
approved these changes
May 4, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR simplifies a number of issues around the PHP testing setup:
test.sh
in favor of letting Composer pick the correct dependencies for each PHP version.phpunit.xml
file, while the C extension enumerated the list of testing files in a shell script. Now both use the same strategy: we run PHPUnit on a directory, which automatically tests all of the files matching*Test.php
in that directory.