phpunit.xml is deleted when doing composer update

Created on 22 June 2021, over 3 years ago
Updated 11 July 2024, 6 months ago

Problem/Motivation

In a dev environment phpunit.xml is always deleted with doing a composer update

Steps to reproduce

Run composer update

Proposed resolution

Provide a magic incantation in the docs that adds phpunit.xml as a protected file in composer and is not deleted on update.

📌 Task
Status

Active

Version

11.0 🔥

Component
PHPUnit 

Last updated about 2 hours ago

Created by

🇬🇧United Kingdom naheemsays

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States mlncn Minneapolis, MN, USA

    Reopening as documentation cannot in itself replace a good developer UX.

    Is there a reason this critical file for running tests, including tests for contrib and custom modules, has to live in /core and not somewhere it can work like a standard scaffolding file?

    Having to do non-standard things just to keep your own tests running as you update Drupal core is surely holding back more widespread testing. (Or maybe this is documentation, if the other phpunit.xml file at project root can be used instead, but its phpunit.xml.dist has none of the needed info.)

  • 🇪🇪Estonia pjotr.savitski

    I've just had the of restoring the phpunit.xml file after updating the core and it seems that a better solution might be to just put the configuration file outside of web/core and then change the path to the bootstrap file (Example: bootstrap="web/core/tests/bootstrap.php"). Running the code from project root where configuration file is situated should work as expected ./vendor/bin/phpunit --stop-on-fail /path/to/direcotry/or/test/file.

    Using an IDE like PhpStorm allows setting location for both files, but just changing the path would do the trick.

Production build 0.71.5 2024