Merge lp:~adeuring/launchpad/bug-739065 into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Abel Deuring | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 13098 | ||||
Proposed branch: | lp:~adeuring/launchpad/bug-739065 | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
360 lines (+251/-36) 4 files modified
lib/lp/soyuz/model/distributionsourcepackagerelease.py (+65/-31) lib/lp/soyuz/model/distroseriesbinarypackage.py (+6/-4) lib/lp/soyuz/tests/test_distributionsourcepackagerelease.py (+152/-0) lib/lp/soyuz/tests/test_distroseriesbinarypackage.py (+28/-1) |
||||
To merge this branch: | bzr merge lp:~adeuring/launchpad/bug-739065 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gavin Panella (community) | Approve | ||
Review via email: mp+61555@code.launchpad.net |
Description of the change
This branch is a first step to fix bug 739065: SourcePackage:
The OOPS reports from that bug show that two SQL queries which return only one row each are repeated quite often; this branch lets the query in DistributionSou
Since it can happen that no DistroSeriesPac
A test run of the new query in DistributionSou
DistributionSou
tests:
./bin/test soyuz -vvt test_distributi
./bin/test soyuz -vvt test_distroseri
no lint
Looks good. Some trivial comments, that's all.
[1]
+ all_published = DecoratedResultSet(
+ all_published, lambda row: row[1:3])
Just for interest, operator. itemgetter( ) can return values at multiple
indices:
Or even:
[2]
+ for publishing, package_cache in all_published: aryPackage( distroarchserie s.distroseries, binarypackagere lease.binarypac kagename,
+ samples.append(
+ DistroSeriesBin
+ publishing.
+ publishing.
You seem to be selecting BinaryPackageName in all_published; perhaps,
but adjusting the slicing requested of the DecoratedResultSet you can
get it straight back from the query?
[3]
+ with StormStatementR ecorder( ) as recorder: package. cache statements) )
+ binary_
+ self.assertEqual(0, len(recorder.
I think you should do here:
This ensures you get a statement log in the event that the match
fails.
[4]
+ with StormStatementR ecorder( ) as recorder: es_binary_ package. cache (len(recorder. statements) > 0)
+ self.distroseri
+ self.assertTrue
Likewise, I think you should do: