Merge lp:~bac/launchpad/bug-987903 into lp:launchpad

Proposed by Brad Crittenden on 2012-04-30
Status: Merged
Approved by: Gary Poster on 2012-04-30
Approved revision: 15173
Merged at revision: 15179
Proposed branch: lp:~bac/launchpad/bug-987903
Merge into: lp:launchpad
Diff against target: 51 lines (+11/-10) 1 file modified
To merge this branch: bzr merge lp:~bac/launchpad/bug-987903
Reviewer Review Type Date Requested Status
Gary Poster (community) 2012-04-30 Approve on 2012-04-30
Review via email: mp+104116@code.launchpad.net

Commit Message

Sort results in branch.txt to avoid ordering failures.

Description of the Change

= Summary =

During parallel testing we've seen branch.txt fail due to an ordering
issue. The order of items retrieved by the vocabulary is not
significant, so the results are now sorted to avoid this issue.

== Proposed fix ==

Sort branches by name before printing.

== Pre-implementation notes ==

Talk with Gary.

== Tests ==

bin/test -vvm lp.code -t branch.txt

== Demo and Q/A ==

None

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/code/vocabularies/tests/branch.txt

To post a comment you must log in.
Gary Poster (gary) :
review: Approve

Preview Diff

1=== modified file 'lib/lp/code/vocabularies/tests/branch.txt'
2--- lib/lp/code/vocabularies/tests/branch.txt 2011-03-07 01:31:32 +0000
3+++ lib/lp/code/vocabularies/tests/branch.txt 2012-04-30 14:05:33 +0000
4@@ -20,21 +20,22 @@
5 # Just use None as the context.
6 >>> branch_vocabulary = vocabulary_registry.get(None, "Branch")
7 >>> def print_vocab_branches(vocab, search):
8- ... for term in vocab.searchForTerms(search):
9- ... print term.value.unique_name
10+ ... terms = vocab.searchForTerms(search)
11+ ... for name in sorted(term.value.unique_name for term in terms):
12+ ... print name
13
14 >>> print_vocab_branches(branch_vocabulary, 'main')
15- ~name12/firefox/main
16- ~stevea/thunderbird/main
17 ~justdave/+junk/main
18 ~kiko/+junk/main
19- ~vcs-imports/evolution/main
20+ ~name12/firefox/main
21 ~name12/gnome-terminal/main
22+ ~stevea/thunderbird/main
23+ ~vcs-imports/evolution/main
24
25 >>> print_vocab_branches(branch_vocabulary, 'vcs-imports')
26+ ~vcs-imports/evolution/import
27+ ~vcs-imports/evolution/main
28 ~vcs-imports/gnome-terminal/import
29- ~vcs-imports/evolution/import
30- ~vcs-imports/evolution/main
31
32 >>> print_vocab_branches(branch_vocabulary, 'evolution')
33 ~carlos/evolution/2.0
34@@ -81,14 +82,14 @@
35
36 >>> login(ADMIN_EMAIL)
37 >>> print_vocab_branches(branch_vocabulary, 'trunk')
38- ~spiv/+junk/trunk
39- ~limi/+junk/trunk
40 ~landscape-developers/landscape/trunk
41+ ~limi/+junk/trunk
42+ ~spiv/+junk/trunk
43
44 >>> login(ANONYMOUS)
45 >>> print_vocab_branches(branch_vocabulary, 'trunk')
46+ ~limi/+junk/trunk
47 ~spiv/+junk/trunk
48- ~limi/+junk/trunk
49
50
51 BranchRestrictedOnProduct