pest
pest copied to clipboard
[Bug]: All Feature tests are marked as WARNING when the `.env` file is missing
What Happened
In local enviroment is not a big deal, but in CI/CD is problematic because there are not FAILING tests and the problem is unnoticed.
PASS Tests\Unit\ExampleTest
✓ that true is true
WARN Tests\Feature\ExampleTest
! it returns a successful response → file_get_contents(/Users/jose/desa/laravel-11/.env): Failed to open stream: No such file or directory 0.07s
Tests: 1 warning, 1 passed (2 assertions)
Duration: 0.11s
How to Reproduce
- Install a fresh Laravel 11
- remove
.env - update
phpunit.xmladdingAPP_KEY, e.g.<env name="APP_KEY" value="base64:WYlqeJ/LNzXXke2rnMdo1cPWUk2yHAOPcz/qwJORJFM="/> - run
pest
Sample Repository
No response
Pest Version
2.34.8, 3.1.0 and 3.2.3
PHP Version
8.2 and 8.3
Operation System
macOS
Notes
No response
might be related to: https://github.com/pestphp/pest/issues/1028
Workaround:
touch .env as before_script