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

Flag an error in drush when a SimpleTest fails. #189

Merged
merged 3 commits into from
Oct 27, 2013

Conversation

jordandukart
Copy link
Contributor

Fixes a regression outlined in #188.

@jordandukart
Copy link
Contributor Author

Looks like master itself is failing on two jobs with tests unrelated to my change?

@weitzman
Copy link
Member

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.

@jordandukart
Copy link
Contributor Author

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 elseif to an if, but some feedback would be nice.

$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)));
Copy link
Member

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.

@jordandukart
Copy link
Contributor Author

Think this should be good now?

weitzman added a commit that referenced this pull request Oct 27, 2013
Flag an error in drush when a SimpleTest fails.
@weitzman weitzman merged commit e5655f2 into drush-ops:master Oct 27, 2013
@weitzman
Copy link
Member

Thanks - merged ... Does not apply cleanly to 6.x. Please post here if anyone backports this.

@adam-vessey
Copy link

Backported in #458

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

Successfully merging this pull request may close these issues.

3 participants