-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Flag an error in drush when a SimpleTest fails. #189
Conversation
Looks like master itself is failing on two jobs with tests unrelated to my change? |
This looks good but it looks like we won't log any errors when user has requested --xml. Is there a reason we would not report errors and log proper exit code in this case? Perhaps it has own handling? If so, a code comment would be helpful. |
Well in 83f2d0b, the person who implemented the changes for the --xml option completely nuked it. I can definitely see the case to return the error codes with or without the flag. If we want to do it for both should just have to change that |
$args = array(':test_id' => $test_id); | ||
$result = db_query("SELECT * FROM {simpletest} WHERE test_id = :test_id AND status IN ('exception', 'fail') ORDER BY test_class, message_id", $args); | ||
foreach ($result as $record) { | ||
drush_set_error('DRUSH_TEST_FAIL', dt("Test !function failed: !message", array('!function' => $record->function, '!message' => $record->message))); |
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 see that we have line and file information in the simpletest table. It would be good to provide as much info as possible in case of failure.
Think this should be good now? |
Flag an error in drush when a SimpleTest fails.
Thanks - merged ... Does not apply cleanly to 6.x. Please post here if anyone backports this. |
Backported in #458 |
Fixes a regression outlined in #188.