Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
josecl opened this issue Sep 25, 2024 · 2 comments
Open
Labels

Comments

@josecl
Copy link

josecl commented Sep 25, 2024

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.xml adding APP_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

@josecl josecl added the bug label Sep 25, 2024
@OrbisK
Copy link

OrbisK commented Oct 2, 2024

might be related to: #1028

@OrbisK
Copy link

OrbisK commented Oct 2, 2024

Workaround:
touch .env as before_script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants