pestphp / pest

Pest is an elegant PHP testing Framework with a focus on simplicity, meticulously designed to bring back the joy of testing in PHP.
https://pestphp.com
MIT License
9.06k stars 313 forks source link

[Bug]: Misleading coverage error with read-only vendor #1152

Open alpha0010 opened 1 month ago

alpha0010 commented 1 month ago

What Happened

When the vendor directory is not writable by the user executing pest, coverage fails to generate with the confusing message:

WARN Unable to get coverage using Xdebug. Did you set Xdebug's coverage mode?

In my case, Xdebug was correctly configured, just vendor/pestphp/pest/.temp was not writable. So I spent a lot of time looking in the wrong location for the issue.

How to Reproduce

sudo chown -R root.root vendor
vendor/bin/pest --coverage

Sample Repository

No response

Pest Version

2.34.7

PHP Version

8.1.14

Operation System

Linux

Notes

I was executing tests within a docker container.