Merge lp://staging/~thumper/launchpad/sprint-attendees into lp://staging/launchpad

Proposed by Tim Penhey
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: 12685
Proposed branch: lp://staging/~thumper/launchpad/sprint-attendees
Merge into: lp://staging/launchpad
Diff against target: 287 lines (+97/-58)
8 files modified
lib/lp/blueprints/browser/sprint.py (+1/-1)
lib/lp/blueprints/browser/tests/test_sprint.py (+29/-0)
lib/lp/blueprints/doc/sprint-meeting-export.txt (+1/-1)
lib/lp/blueprints/doc/sprint.txt (+1/-1)
lib/lp/blueprints/doc/sprintattendance.txt (+3/-13)
lib/lp/blueprints/model/sprint.py (+34/-24)
lib/lp/blueprints/model/sprintattendance.py (+24/-15)
lib/lp/blueprints/templates/sprint-portlet-attendees.pt (+4/-3)
To merge this branch: bzr merge lp://staging/~thumper/launchpad/sprint-attendees
Reviewer Review Type Date Requested Status
Aaron Bentley (community) Approve
Review via email: mp+53941@code.staging.launchpad.net

Commit message

[r=abentley][bug=735996] Be smarter loading the sprint attendees.

Description of the change

Addresses Sprint:+index timeouts, bug 735996

As part of this work I Stormified the SprintAttendance class.
I'd been wondering how hard it would be, as we started using
Storm ages ago, but I'd guess that most model classes are still
using SQLBase.

As a part of that I had to change how the SprintAttendance
objects were being retrieved. Which led me to a few very
poor implementations.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

+ view = create_initialized_view(sprint, '+index')
+ with StormStatementRecorder() as recorder:
+ view.render()
+ self.assertThat(recorder, HasQueryCount(LessThan(10)))

This will give incorrect results, because render doesn't do what a
proper page render does (including things like portlet rendering).
from lp.testing.matchers import BrowsesWithQueryLimit
self.assertThat(sprint, BrowsersWithQueryLimit(10, sprint.owner))

will test this more reliably.

Revision history for this message
Aaron Bentley (abentley) wrote :

Approved, modulo Robert's testing change.

review: Approve

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.