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.7k stars 362 forks source link

[Bug]: All Feature tests are marked as WARNING when the `.env` file is missing #1276

Open josecl opened 2 months ago

josecl commented 2 months ago

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

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

OrbisK commented 1 month ago

might be related to: https://github.com/pestphp/pest/issues/1028

OrbisK commented 1 month ago

Workaround: touch .env as before_script