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

Proposed by Brad Crittenden
Status: Merged
Approved by: Gary Poster
Approved revision: no longer in the source branch.
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
lib/lp/code/vocabularies/tests/branch.txt (+11/-10)
To merge this branch: bzr merge lp:~bac/launchpad/bug-987903
Reviewer Review Type Date Requested Status
Gary Poster (community) Approve
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.
Revision history for this message
Gary Poster (gary) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/code/vocabularies/tests/branch.txt'
--- lib/lp/code/vocabularies/tests/branch.txt 2011-03-07 01:31:32 +0000
+++ lib/lp/code/vocabularies/tests/branch.txt 2012-04-30 14:05:33 +0000
@@ -20,21 +20,22 @@
20 # Just use None as the context.20 # Just use None as the context.
21 >>> branch_vocabulary = vocabulary_registry.get(None, "Branch")21 >>> branch_vocabulary = vocabulary_registry.get(None, "Branch")
22 >>> def print_vocab_branches(vocab, search):22 >>> def print_vocab_branches(vocab, search):
23 ... for term in vocab.searchForTerms(search):23 ... terms = vocab.searchForTerms(search)
24 ... print term.value.unique_name24 ... for name in sorted(term.value.unique_name for term in terms):
25 ... print name
2526
26 >>> print_vocab_branches(branch_vocabulary, 'main')27 >>> print_vocab_branches(branch_vocabulary, 'main')
27 ~name12/firefox/main
28 ~stevea/thunderbird/main
29 ~justdave/+junk/main28 ~justdave/+junk/main
30 ~kiko/+junk/main29 ~kiko/+junk/main
31 ~vcs-imports/evolution/main30 ~name12/firefox/main
32 ~name12/gnome-terminal/main31 ~name12/gnome-terminal/main
32 ~stevea/thunderbird/main
33 ~vcs-imports/evolution/main
3334
34 >>> print_vocab_branches(branch_vocabulary, 'vcs-imports')35 >>> print_vocab_branches(branch_vocabulary, 'vcs-imports')
36 ~vcs-imports/evolution/import
37 ~vcs-imports/evolution/main
35 ~vcs-imports/gnome-terminal/import38 ~vcs-imports/gnome-terminal/import
36 ~vcs-imports/evolution/import
37 ~vcs-imports/evolution/main
3839
39 >>> print_vocab_branches(branch_vocabulary, 'evolution')40 >>> print_vocab_branches(branch_vocabulary, 'evolution')
40 ~carlos/evolution/2.041 ~carlos/evolution/2.0
@@ -81,14 +82,14 @@
8182
82 >>> login(ADMIN_EMAIL)83 >>> login(ADMIN_EMAIL)
83 >>> print_vocab_branches(branch_vocabulary, 'trunk')84 >>> print_vocab_branches(branch_vocabulary, 'trunk')
84 ~spiv/+junk/trunk
85 ~limi/+junk/trunk
86 ~landscape-developers/landscape/trunk85 ~landscape-developers/landscape/trunk
86 ~limi/+junk/trunk
87 ~spiv/+junk/trunk
8788
88 >>> login(ANONYMOUS)89 >>> login(ANONYMOUS)
89 >>> print_vocab_branches(branch_vocabulary, 'trunk')90 >>> print_vocab_branches(branch_vocabulary, 'trunk')
91 ~limi/+junk/trunk
90 ~spiv/+junk/trunk92 ~spiv/+junk/trunk
91 ~limi/+junk/trunk
9293
9394
94BranchRestrictedOnProduct95BranchRestrictedOnProduct