-
Notifications
You must be signed in to change notification settings - Fork 326
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
Tests should crash on non zero exit code #7342
Conversation
This is the expected behaviour of the runtests script. We run always all scripts and not exit directly when there is an error in one of the scripts. Else we don't have all errors in the CI for all bundles. |
Okay the problem I was encountering in this case is the test shouldn't run if the init step fails (see the jackalope 2 merge request). |
And the test cases in this case aren't affected because they are allowed to fail, their failure is recorded and just passed on. |
I see I would update the |
Something like: $process = exec_sf_cmd(
'doctrine:schema:update --force'
);
if (0 !== $process->getExitCode()) {
// error already outputted before via write_error
exit($process->getExitCode());
} |
That's also acceptable. |
We should target the 2.4 for this change. |
Changed the base. |
bin/runtests
Outdated
)); | ||
$process = exec_sf_cmd('doctrine:schema:update --force'); | ||
if ($process->getExitCode() !== 0) { | ||
exit($process->getExitCode()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should not exit when one bundle fails to init.
the other bundle tests should still be executed.
exec_cmd(sprintf( | ||
PHP_BINARY . ' %s %s', | ||
$console, | ||
' sulu:document:initialize --purge --force --ansi' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need to catch this. Aslong as the tests run as expected it is not required that a bundle uses the document manager bundle.
I wanted to catch this: https://github.com/sulu/sulu/actions/runs/8525431456/job/23352362111?pr=6834 The Init Task is successful although the update of the schema failed. Without this none of the tests will work. |
That error would still be catched we just don't should exit on the |
Looks good can you apply those and merge because the app doesn't support that. |
What's in this PR?
This adds the function that the tests crash when one of the steps exists with a non-zero exit code.
Why?
Currently the tests just ignore the exit code and continue running which then causes issues further down the suite. This should make the tests easier to debug as the errors are reported earlier and closer to the source.