Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
simpletest.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
7 Sep 2008 at 12:23 UTC
Updated:
24 Sep 2008 at 09:52 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
damien tournoud commentedAfter a discussion with chx on the IRC, I rewrote the backtracing logic a bit and added useful comments.
Comment #2
damien tournoud commentedAfter new dicussions with chx, I simplified the
getCallerContext()method a moved it to common.inc with the name_drupal_get_last_caller(). This is for future extensibility, as it will be useful in #304924: Extend drupal_error_handler to manage exceptions.Comment #3
damien tournoud commentedHere are results before and after the patch. Notice how file and line numbers were wrong: there were the line and file number of the call to the function, not those of the call to the assertion inside the function.
Comment #4
damien tournoud commentedAdds an exception handler for tests. Essentially, this is #293521: Simpletest should catch exceptions but adapted to the context of this patch.
Comment #5
damien tournoud commentedAgain on chx' suggestion, here is a slight change in the backtracing logic: we now ignore all methods from DrupalWebTestCase, not only the assertions. The result actually looks great (see attached screenshot).
Comment #6
damien tournoud commentedHere a new patch that removes two unneeded lines, and adds tests of the new backtracing code to
simpletest.test.Comment #7
chx commentedI run out of ideas of what to add / remove / fix and I even channeled Dries to DamZ on IRC by asking for a new test. So, I believe this is ready.
Comment #8
boombatower commentedErrrr....can I review this...I worked on the other patch that this stems from and I not really sure I like what is going on. Don't have time at the moment, but should later.
Comment #9
webchickYes, I'd like to hear your thoughts. I do agree with splitting this from the UI changes, however. That other patch is currently in discussion about buttons and placement and descriptions, and this patch looks like it fixes a lot of underlying things that will help us fix other testing system stuff in the meantime.
Comment #10
boombatower commentedThe patch looks good, simpletest.test passes. Just includes the back-end changes from my patch.
Once this goes in I'll work on re-rolling the other patch to reflect this, could be fun with the large overlap and slight differences. :)
Comment #11
boombatower commentedWould probably be a good idea if someone ran all the tests.
Comment #12
maartenvg commentedI ran all the test and everything passes, 5390 passes to be exact. :)
Comment #13
boombatower commentedGreat, looks like it is ready to go.
Comment #14
webchickI'll be taking a look at this after supper and committing it providing I don't find any remaining issues.
Comment #15
chx commentedJust PHPdoc and indent fixes. Do not credit me.
Comment #16
webchickCommitted this, with a couple minor PHPDoc tweaks. Thanks!
Now let's get #250047: Rework the SimpleTest results interface and clean-up of backend code in. ;)
Btw, I talked over with chx that _drupal_get_last_caller($backtrace) looks like it could be generalized a bit and re-used in multiple places, if it accepts an index of how far back to parse... _db_query() does (or used to before DBTNG?) a similar thing where it grabs the "true" calling function rather than db_query() for more sensible debug messages.
Can be handled in a follow-up patch, but I'm curious about Damien's thoughts on that.
Comment #17
webchickComment #18
damien tournoud commentedOf course, that's exactly the plan. That's also why it is placed just below
drupal_error_handler()in common.inc :) I already have a mockup of this in #304924: Extend drupal_error_handler to manage exceptions, but it will require a reroll and some more testing.Comment #19
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.