Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Add support for env, server and ini settings in parallel test runs#28995
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
aaf5916 to80298a9Comparealexander-schranz commentedOct 26, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Any hint? /cc@nicolas-grekas |
697ac35 tof52ec82Comparenicolas-grekas commentedOct 27, 2018
Thats' a pretty big change. Shouldn't we consider it as a new feature? |
alexander-schranz commentedOct 27, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@nicolas-grekas did change it to anonymous functions. from my case we can consider it as a new feature, but not sure what to add/change at the documentation because think most people think that the phpunit config variables would also be used in parallel test runs? Could now reproduce and fix the travis ci bug locally by changing the diff --git a/phpunit b/phpunitindex f4b80ed064..e88c75c331 100755--- a/phpunit+++ b/phpunit@@ -11,4 +11,5 @@ if (\PHP_VERSION_ID >= 70000 && !getenv('SYMFONY_PHPUNIT_VERSION')) { putenv('SYMFONY_PHPUNIT_VERSION=6.5'); } putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');-require __DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit';+require __DIR__.'/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit'; Should we maybe use always the simple-phpunit from repository not from vendor to avoid this kind of problems for contributors?
|
b95c00c to0a205e8Comparenicolas-grekas commentedOct 29, 2018
nope, the reason being that we want to use the latest version of the bridge to test the lowest maintained Symfony versions (2.8 for now, so PHP 5.3.3 should still be supported). |
| if (false !==$value =getenv($name)) { | ||
| return$value; | ||
| } | ||
| global$argv,$argc,$PHP,$getEnvVar; |
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.
How about passing them as contexts for functions rather than using aglobal ?
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.
@Taluu followed your suggestion and did avoid any usage of global
Taluu commentedOct 29, 2018
@nicolas-grekas Using anonymous functions like that and globalizing their containers (variables) like this, I wonder if using the global function scope wouldn't be better... Or maybe adding a namespace in the simple-phpunit file, to restrict these functions in said namespace could be better ? |
bee7bf8 toa36e29fCompare17c4180 tode5eaf2Compared0bb431 tofe4e2baCompare7de6e17 tofe9b089Comparefe9b089 toef60bdbComparealexander-schranz commentedJan 16, 2019
@nicolas-grekas any news to this? |
nicolas-grekas commentedJan 27, 2019
Please rebase. |
cd48c3d to1cebd48Comparealexander-schranz commentedJan 28, 2019
@nicolas-grekas done. |
1cebd48 tofb08ec5Comparefabpot commentedMar 4, 2019
@nicolas-grekas I think we're waiting for you here :) |
fb08ec5 to8a90931Comparealexander-schranz commentedApr 2, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@nicolas-grekas if you have time we could have also a look at this at the |
nicolas-grekas commentedApr 2, 2019
Sure, please rebase meanwhile ;) |
8a90931 tode43901Comparede43901 to07674a4Comparefabpot commentedApr 8, 2019
@nicolas-grekas Rebase done ;) |
nicolas-grekas commentedApr 11, 2019
I feel like the expectations implemented by this PR are wrong, here is why: Try running e.g. Running |
alexander-schranz commentedApr 11, 2019
@nicolas-grekas didn't know that the original phpunit allows to give a folder 🙈 thought that was a symfony only feature. Yeah it definitly make sense that the result then is the same as using the original phpunit file. |
nicolas-grekas commentedApr 12, 2019
Closing as discussed, thanks. |
Uh oh!
There was an error while loading.Please reload this page.
This fixes problems with $_SERVER and ENV Variables inparallel test runs and that the bootstrap script was not called in parallel test runs.
Currently was most of the logic based on the main phpunit.xml.dist file. This did require me to rewrite the logic based that there are multiple phpunit.xml.dist files. As passing the configuration file via
--configurationflag phpunit seems correctly read the env and server configuration and use the correct bootstrap file.See with the following test setup which does not work and how this script fixes the errors
https://github.com/alexander-schranz/symfony-phpunit-test.
Checklist: