8000 phpunit-bridge does not take composer settings into account when downloading phpunit · Issue #27753 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

phpunit-bridge does not take composer settings into account when downloading phpunit #27753

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

Closed
guilhermednt opened this issue Jun 27, 2018 · 2 comments

Comments

@guilhermednt
Copy link

Symfony version(s) affected: 4

Description
phpunit-bridge/simple-phpunit seems to always download PHPUnit from github.com which is problematic if your build server does not have Internet access.

Our build server does not have Internet access, instead it uses a local Artifactory instance as a proxy/cache. Since phpunit-bridge always downloads from GitHub we can't run tests during our build.

How to reproduce
Configure composer to use a local repository, disable packagist and try to run phpunit in a server with no Internet access:

$ composer config repositories.my_local https://repository.example.com/api/composer/php-remote
$ composer config repo.packagist false
$ composer install
$ bin/phpunit

Possible Solution
Use composer to download phpunit.

Additional context

Jenkins log:

+ composer test
> bin/phpunit
#!/usr/bin/env php
PHP Fatal error:  Uncaught RuntimeException: Could not find https://github.com/sebastianbergmann/phpunit/archive/6.5.zip in .../jenkins/workspace/demo/vendor/symfony/phpunit-bridge/bin/simple-phpunit:99
Stack trace:
#0 .../jenkins/workspace/demo/bin/phpunit(18): require()
#1 {main}
  thrown in .../jenkins/workspace/demo/vendor/symfony/phpunit-bridge/bin/simple-phpunit on line 99
Script bin/phpunit handling the test event returned with error code 255
@nicolas-grekas
Copy link
Member

Hello thanks for the report. This is not supported and is far from being trivial to implement.
For now, I think in your situation you have to resort to using phpunit in you own dependencies, using the bridge as a listener (configured by default when using Flex).
You will need to do ./vendor/bin/phpunit to run your tests suite.

@linaori
Copy link
Contributor
linaori commented Jun 28, 2018

Would it be possible (as "quickfix") to provide a composer extra field that specifies where to find the phpunit version? This could either be an (un)document internal feature, or perhaps even a full-fledged feature. I think it's not something a lot of people will use, but it will also make it possible to define a custom download location without a big impact (I hope).

nicolas-grekas added a commit that referenced this issue Nov 20, 2018
…-grekas)

This PR was merged into the 3.4 branch.

Discussion
----------

[Bridge/PhpUnit] Use composer to download phpunit

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27753, #29263, #29264
| License       | MIT
| Doc PR        | -

Commits
-------

e823f1d [Bridge/PhpUnit] Use composer to download phpunit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0