Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
phpunit/php-file-iterator (a dependency of PHPUnit) 1.3.4 adds the possibility to follow symlinks when searching for test cases. Many Drupal developers symlink their contributed modules into a single Drupal install they use as a testbed, and upgrading to 1.3.4 will allow them to run all PHPUnit tests in that installation at once.
Comment | File | Size | Author |
---|---|---|---|
#11 | drupal_2110153_11.patch | 28.01 KB | Xano |
#4 | php-file-iterator_2110153_4.patch | 18.05 KB | Mile23 |
#4 | php-file-iterator_composer-only_2110153_4_do-not-test.patch | 381 bytes | Mile23 |
#1 | drupal_2110153_1.patch | 17.45 KB | Xano |
Comments
Comment #1
XanoComment #2
moshe weitzman CreditAttribution: moshe weitzman commentedI'll agree that this is vital. symlinks are quite common and making them invisible when running tests is a bit surprise.
Comment #3
webchickHm. Why are we referencing a specific commit hash here and not a version?
Comment #4
Mile23Changed the php-file-iterator version in composer.json, did
composer update phpunit/php-file-iterator
, and here's the patch.A maintainer might only add the composer.json change and then do a full update themselves.
Also, you can see the latest available versions of stuff on packagist: https://packagist.org/packages/phpunit/php-file-iterator
Comment #5
XanoThat patch has the same hash problem. I'm also not sure adding the dependency to core is a good idea, as core itself does not directly depend on it.
Comment #6
Mile23The .lock file is supposed to be generated by composer. It'll be obliterated the next time you run
composer update
. This version of php-file-iterator is, actually, a dependency of Drupal, so therefore we write that down in composer.json.Comment #7
Xano#1: drupal_2110153_1.patch queued for re-testing.
Comment #8
XanoCan you explain what you mean with this?
It is not. Core does not use php-file-iterator. Only PHPUnit does. We just want to pull in the latest version, because it will benefit contrib. It's technically a feature to make development easier.
Comment #9
Mile23The .lock file is generated by composer. It's purpose in life is to store the dependency information generated when you type
composer update
. If it's present, typingcomposer install
will cause composer to read the lock file and not have to work out the dependencies, which can be time-consuming. It gets over-written when you do another update. http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-fileWhether the dependency is satisfied by a git hash or a file download or whatever is determined by the package. We don't care about that, which is why we don't care about the .lock file, other than it being there.
If the project requires a certain version of a package, it should go in the composer.json file. That way it's explicit that for things to work, you need this version of the package. We want contrib to be able to use PHPUnit, so therefore we need this version of php-file-iterator or later.
If Drupal decides it doesn't want to use PHPUnit any more, then it's a matter of deleting two lines in composer.json instead of one. Ideally, all this would be documented in the composer.json file, but json doesn't like comments.
Also: php-file-iterator is pretty cool. It's not like Drupal ever needs to recursively find files based on suffixes. :-) We could be using php-file-iterator, since it's already there.
Comment #10
dawehnerThis looks fine everywhere, but this does not apply anymore as you basically have to rerole composer changes everytime any dependency is updated.
Comment #11
XanoComment #12
XanoIn light of the upcoming alpha 4 release the code sprints at BADCamp, in Edinburgh, and in Manchester next week, I'm temporarily bumping this to critical, so we can hopefully get this in alpha 4 and contrib developers can use PHPUnit when porting their code.
Also, seeing as this is a regression compared to Simpletest, I'm making this a bug report, rather than a feature request.
Comment #13
dawehnerHave a quick look at #2105821-8: Updated Symfony CMF's Routing Component to v1.1.0
Your patch basically reverts all the changes done in that composer files, so I am wondering whether you have a recent composer version.
Comment #14
dawehnerYour description sounds really a lot like major, to be honest:
but yeah actually I just wanted to look up the definition of critical/major, so I don't change it.
Comment #15
XanoI have the very latest Composer and all I did to create the patch was
composer update phpunit/php-file-iterator
.Comment #16
XanoI had a short conversation with @seldaek in #composer-dev on IRC. He confirmed that the changes in PHP logic are as planned:
Comment #17
dawehnerThank you, so the changes made by cosmicdreams was actually wrong.
Comment #18
alexpottI reran the process of updating to the new php-file-iterator and can confirm that the patch only contains expected changes.
Committed 6a89adc and pushed to 8.x. Thanks!