Merge lp://staging/~gary/launchpad/bug838869 into lp://staging/launchpad

Proposed by Gary Poster
Status: Merged
Approved by: Gary Poster
Approved revision: no longer in the source branch.
Merged at revision: 13857
Proposed branch: lp://staging/~gary/launchpad/bug838869
Merge into: lp://staging/launchpad
Diff against target: 613 lines (+439/-41)
4 files modified
lib/canonical/launchpad/webapp/adapter.py (+120/-37)
lib/canonical/launchpad/webapp/tests/test_statementtracer.py (+316/-0)
lib/lp/services/profile/profile.py (+2/-2)
lib/lp/services/profile/tests.py (+1/-2)
To merge this branch: bzr merge lp://staging/~gary/launchpad/bug838869
Reviewer Review Type Date Requested Status
j.c.sackett (community) Approve
Review via email: mp+73695@code.staging.launchpad.net

Commit message

[r=jcsackett][bug=838869] Add tests for Launchpad SQL logger; add a more surgical SQL logger for outside of a request than what we had before; and add the ability to conditionally request tracebacks in the SQL logger.

Description of the change

This branch does three things.

- It adds a helper for tracking queries piecemeal in tests and make harness, SQLLogger. This is different than the QueryCollector in lib/lp/testing/_webservice.py because it does not require a browser request to work. I use this in a branch stacked on this one, https://code.launchpad.net/~gary/launchpad/bug811447 , to check queries generated from a piece of model code.

- It adds the ability to conditionally collect stacktraces, and renames the associated function from `start_sql_traceback_logging` to `start_sql_logging`. I use this in a branch stacked on this one, https://code.launchpad.net/~gary/launchpad/bug838878 , to support ++profile++sqltrace conditionally generating stacktraces.

- It adds tests for the logger, which had not existed at all as far as I could find. I include tests for the functionality I added as well as existing functionality. This is bug 838869.

Lint is happy.

Reasonable QA will be to go to https://qastaging.launchpad.net/++profile++sqltrace and make sure it still generates a sql trace analysis; and run `make run LP_DEBUG_SQL=1` on a dev machine to make sure it still produces SQL.

Thank you.

To post a comment you must log in.
Revision history for this message
j.c.sackett (jcsackett) wrote :

Gary, this looks good.

review: Approve
Revision history for this message
Robert Collins (lifeless) wrote :

There was/is a non browser query collector in testing/. This may be
duplicative.

On 3/09/2011 4:34 AM, <email address hidden> wrote:

The proposal to merge lp:~gary/launchpad/bug838869 into lp:launchpad has
been updated.

   Status: Approved => Merged

For more details, see:
https://code.launchpad.net/~gary/launchpad/bug838869/+merge/73695

--
https://code.launchpad.net/~gary/launchpad/bug838869/+merge/73695
Your team Launchpad code revie...

--
launchpad-reviews mailing list
<email address hidden>
https://lists.ubuntu.com/ma...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.