-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Broken tests in master: Could not scan for classes inside "tests/" #20032
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
Comments
where does this |
Any backtrace? |
I can't summon a back-trace, I think it's invoked by a sub-process of the phpunit bash file that runs an include. I can't find |
@iltar do you have a |
No, I have everything stock, I was reproducing this issue for @stampycode |
I can get the test suite to run (though with a lot of failures) by modifying the following binary: vendor/symfony/phpunit-bridge/bin/simple-phpunit diff --git i/bin/simple-phpunit w/bin/simple-phpunit
index 14a9d1c..a8c1581 100755
--- i/bin/simple-phpunit
+++ w/bin/simple-phpunit
@@ -53,8 +53,8 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
if (5.1 <= $PHPUNIT_VERSION && $PHPUNIT_VERSION < 5.4) {
passthru("$COMPOSER require --no-update phpunit/phpunit-mock-objects \"~3.1.0\"");
}
- passthru("$COMPOSER require --dev --no-update symfony/phpunit-bridge \">=3.2@dev\"");
- passthru("$COMPOSER install --prefer-dist --no-progress --ansi", $exit);
+ passthru("$COMPOSER require --no-update symfony/phpunit-bridge \">=3.2@dev\"");
+ passthru("$COMPOSER install --no-dev --prefer-dist --no-progress --ansi", $exit);
if ($exit) {
exit($exit);
} The zipfile downloaded by this binary does not contain the |
autoload-dev is taken into account only for the root project (which is not downloaded by composer, except when using |
Did you try deleting the |
@stof you are wrong. The |
My version: Composer version 1.2.1 2016-09-12 11:27:19 |
See https://github.com/symfony/phpunit-bridge/blob/master/bin/simple-phpunit#L46-L57 for relevant code that causes this issue. |
So, composer is throwing the exception? Can you add |
I already explained why. See this comment. Symfony attempts to install the dependencies for the phpunit version it downloaded (using composer). However, the github zipball does not contain the |
Probably relevant: sebastianbergmann/phpunit#2300 |
certainly relevant, that's the trigger of all of this :) |
My guess is a simply mkdir for /tests would be the easiest |
Sure. On what branch should this be applied? |
the lowest impacted :) |
I suppose that is debatable. Composer has always failed on this. This is not new. We could attempt to handle it more gracefully, but the problem is that a lot of users rarely read the warnings we output. And as this could effectively lead to a completely broken state of your environment, I feel a warning is inadequate. |
I think the proper fix would be that composer doesn't crash on this during the construction of the class-map autoloading and give an understandable error. Composer could give a neat warning in yellow though (just like the out-of-date) so that you are at least hinted of it. |
Going to install deps and generally mess around inside the vendor dir definitely voids the composer warranty as far as I am concerned. And besides yes as @alcohol mentioned above, people don't read warnings and then complain, that's why we fail hard on this because it is a clear misconfiguration of the package. Either make sure you create the tests dir, or install with --no-dev so that the autoload-dev is ignored, which really would be the correct option IMO as you are trying to run phpunit as far as I understand, and not develop it. |
The latter was my solution also ( |
Only applies to the master branch, none of the previous branches had this binary yet. |
This fix doesn't work for me, do I need to clear anything after I've pulled in this change? I'm running |
@stampycode try deleting the |
@nicolas-grekas ... no dice. |
That's because it hasn't been merged yet. |
OK, that's because the simple-phpunit that is used is the one in |
@alcohol I applied the fix manually. |
Yes but to what? ;-) |
To which file? Did you read the comment from @nicolas-grekas above? |
Yeah I did - but as far as I'm concerned, I'm running the unit tests as described in the documentation - if that doesn't work, then that means either the documentation is wrong, or the tests are still broken... And yes, I've deleted the |
Urgh. Ok it just started working... fml. |
This PR was merged into the 3.2-dev branch. Discussion ---------- fix composer install process, resolves #20032 | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #20032 | License | MIT | Doc PR | reference to the documentation PR, if any Commits ------- f418cb8 fix composer install process, resolves #20032
Thanks |
It seems like some commit broke at least the master. If I run
./phpunit
it crashes after installing the packages with:I did a bit of digging and the only reference I found was a classmap option in composer.json from the zip file in the
.phpunit
directory. Sadly I was unable to fix it myself as it keeps overwriting everything.ping @nicolas-grekas
The text was updated successfully, but these errors were encountered: