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

Silent failures (when ini_set('display_errors', 0)) #879

Open
trasher opened this issue Oct 30, 2021 · 2 comments
Open

Silent failures (when ini_set('display_errors', 0)) #879

trasher opened this issue Oct 30, 2021 · 2 comments

Comments

@trasher
Copy link
Contributor

trasher commented Oct 30, 2021

It's unfortunately a quite common case: running tests fails without any error, causes can be multiple:

  • a syntax error in a php file
  • inheritance issue (try for example to override a protected method with a private one),
  • ...

That's annoying, but syntax errors can be checked with php -l, and looking deep at the code permit to solve several other ones.

This time, I'm trying to run my test suite with php 8.1 on github actions and it fails silently. I have absolutely no idea what goes wrong. Tests are just running fine locally :/
See for example:
https://github.com/galette/galette/runs/4053979832?check_suite_focus=true

Any idea how to get more info on that fail? Thanks!

@cedric-anne
Copy link
Member

This is due to ini_set('display_errors', 0); (see https://github.com/galette/galette/blob/develop/galette/includes/galette.inc.php#L131).

Same behaviour was experienced in GLPI (see glpi-project/glpi#9744).

IMHO, atoum should register a proper error handler as soon as possible in the code to be able to exit with understandable error, even when display_errors and/or error_reporting settings says that error should not be shown.

trasher added a commit to galette/galette that referenced this issue Nov 2, 2021
@trasher
Copy link
Contributor Author

trasher commented Nov 2, 2021

Indeed, that is much more explcit; thank you very much @cedric-anne; I forget about that explicit ini_set!

trasher added a commit to galette/galette that referenced this issue Nov 3, 2021
trasher added a commit to galette/galette that referenced this issue Nov 3, 2021
trasher added a commit to galette/galette that referenced this issue Nov 6, 2021
trasher added a commit to galette/galette that referenced this issue Nov 6, 2021
@Grummfy Grummfy changed the title Silent failures Silent failures (when ini_set('display_errors', 0)) Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants