Merge lp:~cjwatson/launchpad/fix-test-db-assumptions into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18935
Proposed branch: lp:~cjwatson/launchpad/fix-test-db-assumptions
Merge into: lp:launchpad
Diff against target: 58 lines (+8/-5)
2 files modified
lib/lp/code/stories/webservice/xx-branch.txt (+7/-4)
lib/lp/soyuz/stories/soyuz/xx-private-builds.txt (+1/-1)
To merge this branch: bzr merge lp:~cjwatson/launchpad/fix-test-db-assumptions
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+366100@code.launchpad.net

Commit message

Weaken some test assertions that failed on PostgreSQL 10.

Description of the change

For some reason I see these locally but not on buildbot. However, they do look like incorrect test code.

I'm not wholly convinced by the xx-private-builds.txt change, since the "5 of 3 results" I see locally is clearly dodgy; but on the other hand the exact number of rows in EXPLAIN output doesn't seem like something we should be asserting in tests.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) wrote :

EXPLAIN is a rough estimate, and it's going to be particularly far off if vacuum hasn't run recently. It being off by that much is entirely reasonable.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/code/stories/webservice/xx-branch.txt'
2--- lib/lp/code/stories/webservice/xx-branch.txt 2018-05-13 10:35:52 +0000
3+++ lib/lp/code/stories/webservice/xx-branch.txt 2019-04-16 11:05:52 +0000
4@@ -186,18 +186,21 @@
5
6 The branches of a project are also available.
7
8+ >>> from operator import itemgetter
9+
10 >>> def print_branch(branch):
11 ... print(branch['unique_name'] + ' - ' + branch['lifecycle_status'])
12 >>> def print_branches(webservice, url, status=None, modified_since=None):
13 ... branches = webservice.named_get(
14 ... url, 'getBranches',
15 ... status=status, modified_since=modified_since).jsonBody()
16- ... for branch in branches['entries']:
17+ ... for branch in sorted(
18+ ... branches['entries'], key=itemgetter('unique_name')):
19 ... print_branch(branch)
20
21 >>> print_branches(webservice, '/fooix')
22+ ~eric/fooix/feature-branch - Experimental
23 ~eric/fooix/trunk - Development
24- ~eric/fooix/feature-branch - Experimental
25
26 The branches can be limited to those that have been modified since a specified
27 time.
28@@ -217,8 +220,8 @@
29 The branches owned by a person are available from the person object.
30
31 >>> print_branches(webservice, '/~eric')
32+ ~eric/fooix/feature-branch - Experimental
33 ~eric/fooix/trunk - Development
34- ~eric/fooix/feature-branch - Experimental
35
36 As with projects, these can be filtered by the branch status.
37
38@@ -239,8 +242,8 @@
39 >>> logout()
40
41 >>> print_branches(webservice, '/widgets')
42+ ~eric/fooix/feature-branch - Experimental
43 ~eric/fooix/trunk - Development
44- ~eric/fooix/feature-branch - Experimental
45 ~mary/blob/bar - Development
46
47 As with projects, these can be filtered by the branch status.
48
49=== modified file 'lib/lp/soyuz/stories/soyuz/xx-private-builds.txt'
50--- lib/lp/soyuz/stories/soyuz/xx-private-builds.txt 2018-06-30 21:31:02 +0000
51+++ lib/lp/soyuz/stories/soyuz/xx-private-builds.txt 2019-04-16 11:05:52 +0000
52@@ -152,7 +152,7 @@
53 ...
54 i386 build of cdrkit 1.0 in ubuntu warty RELEASE
55 ...
56- 5 of 17 results
57+ 5 of ... results
58 ...
59
60