Merge lp:~michael.nelson/launchpad/ppa-privatisation-test-refactor3 into lp:launchpad
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Henning Eggers on 2010-02-23 | ||||
| Approved revision: | not available | ||||
| Merged at revision: | not available | ||||
| Proposed branch: | lp:~michael.nelson/launchpad/ppa-privatisation-test-refactor3 | ||||
| Merge into: | lp:launchpad | ||||
| Prerequisite: | lp:~michael.nelson/launchpad/ppa-privatisation-test-refactor2 | ||||
| Diff against target: |
751 lines (+194/-174) 9 files modified
lib/canonical/launchpad/doc/publishing-security.txt (+48/-47) lib/canonical/launchpad/doc/tales.txt (+33/-28) lib/lp/registry/browser/tests/person-views.txt (+5/-7) lib/lp/soyuz/browser/tests/archive-views.txt (+14/-22) lib/lp/soyuz/browser/tests/archivesubscription-views.txt (+16/-15) lib/lp/soyuz/browser/tests/builder-views.txt (+4/-4) lib/lp/soyuz/doc/archive-dependencies.txt (+35/-26) lib/lp/soyuz/doc/buildd-slavescanner.txt (+32/-22) lib/lp/testing/factory.py (+7/-3) |
||||
| To merge this branch: | bzr merge lp:~michael.nelson/launchpad/ppa-privatisation-test-refactor3 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Henning Eggers (community) | code | 2010-02-22 | Approve on 2010-02-23 |
|
Review via email:
|
|||
| Michael Nelson (michael.nelson) wrote : | # |
| Henning Eggers (henninge) wrote : | # |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Michael!
Sorry for the delay. This branch looks mostly good but I have a few
stylistic issues about comments in doctests and a couple of long lines.
The only real test issue is about 'foo.bar'. Please consider that and if
I am wrong, ignore my comment. ;-)
You are good to land this when these issues have been attended to.
review approve code
Thank you for your good work! ;-)
Cheers,
Hennig
> === modified file 'lib/canonical/
> --- lib/canonical/
> +++ lib/canonical/
> @@ -8,50 +8,49 @@
> are no restrictions. For those attached to a private archive, only those able
> to view the archive, or admins, can see the publication.
>
> -As an anonymous user get the first published source and binary out of cprov's
> -public PPA:
> + # Create two ppas, one public and one private and publish to both.
A comment in a doc test is very uncommon AFAIK. Since all text in here
are explanations, why not put this into the main text? "We have two
ppas, a public one and a private one. Both are published." Or something
like that.
> + >>> login('<email address hidden>')
> + >>> public_ppa = factory.
> + >>> private_ppa = factory.
> + >>> from lp.soyuz.
> + >>> test_publisher = SoyuzTestPublis
> + >>> test_publisher.
> + >>> ignore = test_publisher.
> + >>> ignore = test_publisher.
> +
> +
> +As an anonymous user we can get the first published source and binary out
> +the public PPA:
>
> >>> login(ANONYMOUS)
> -
> - >>> from canonical.
> - >>> cprov_ppa = getUtility(
> - >>> cprov_ppa.private
> - False
> -
> - >>> source_pub = cprov_ppa.
> + >>> source_pub = public_
> >>> print source_
> - cdrkit 1.0 in breezy-autotest
> + foo 666 in breezy-autotest
>
> - >>> binary_pub = cprov_ppa.
> + >>> binary_pub = public_
> >>> print binary_
> - mozilla-firefox 1.0 in warty hppa
> + foo-bin 666 in breezy-autotest i386
>
> A regular user can see them too:
>
> >>> login('<email address hidden>')
> - >>> source_pub = cprov_ppa.
> + >>> source_pub = public_
> >>> print source_
> - cdrkit 1.0 in breezy-autotest
> + foo 666 in breezy-autotest
>
> - >>> binary_pub = cprov_ppa.
> + >>> binary_pub = public_
> >>> print binary_
> - mozilla-firefox 1.0 in warty hppa
> -
> -Now, we'll make cprov's PPA private:
> -
> - >>> login('<email address hidden>')
> - >>> cprov_ppa.private = True
> - >>> cpr...
| Michael Nelson (michael.nelson) wrote : | # |
On Tue, Feb 23, 2010 at 11:00 AM, Henning Eggers
<email address hidden> wrote:
> Review: Approve code
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Michael!
>
> Sorry for the delay. This branch looks mostly good but I have a few
> stylistic issues about comments in doctests and a couple of long lines.
> The only real test issue is about 'foo.bar'. Please consider that and if
> I am wrong, ignore my comment. ;-)
Thanks for all the thoughts below!
>
> You are good to land this when these issues have been attended to.
>
> review approve code
>
> Thank you for your good work! ;-)
>
> Cheers,
> Hennig
>
>
>> === modified file 'lib/canonical/
>> --- lib/canonical/
>> +++ lib/canonical/
>> @@ -8,50 +8,49 @@
>> are no restrictions. For those attached to a private archive, only those able
>> to view the archive, or admins, can see the publication.
>>
>> -As an anonymous user get the first published source and binary out of cprov's
>> -public PPA:
>> + # Create two ppas, one public and one private and publish to both.
>
> A comment in a doc test is very uncommon AFAIK. Since all text in here
> are explanations, why not put this into the main text? "We have two
> ppas, a public one and a private one. Both are published." Or something
> like that.
>
True. I've tended to add python comments just to indicate that it is
not part of the narrative, but rather is setup code. But I'll stop now
:)
>> === modified file 'lib/canonical/
>> --- lib/canonical/
>> +++ lib/canonical/
>> @@ -126,55 +126,59 @@
>> for referring to them in other pages and a 'reference' formatter which
>> displays the unique ppa reference.
>>
>> - >>> print test_tales(
>> - <a href="/
>> - class="sprite ppa-icon">PPA for Mark Shuttleworth</a>
>> - >>> print test_tales(
>> - ppa:mark/ppa
>> + >>> login('<email address hidden>')
>> + >>> owner = factory.
>> + >>> public_ppa = factory.
>> + ... name='ppa', private=False, owner=owner)
>> + >>> login(ANONYMOUS)
>> + >>> print test_tales(
>> + <a href="/
>> + class="sprite ppa-icon">PPA for Joe Smith</a>
>> + >>> print test_tales(
>> + ppa:joe/ppa
>>
>> Disabled PPAs links use a different icon and are only linkified for
>> users with launchpad.View on them.
>>
>> - >>> login('<email address hidden>')
>> - >>> mark.archive.
>> + >>> login('<email address hidden>')
>> + >>> public_
>>
>> - >>> print test_tales(
>> - <a href="/
>> - for Mark Shuttleworth</a>
>> + >>> print test_tales(
| Henning Eggers (henninge) wrote : | # |
Thank you for the fixes! ;)

This is the third branch in a series to refactor soyuz tests after fixing bug 506203.
The MP for the branch that actually fixed the bug is at:
https:/ /code.edge. launchpad. net/~michael. nelson/ launchpad/ 506203- ppa-privatisati on-check/ +merge/ 19415
The fix ensures that the privacy of a PPA cannot be altered once it has packages published. Unfortunately most of our test infrastructure does exactly that (switches the privacy to do a few tests and then switches it back).
The complete test breakages are as follows: pastebin. ubuntu. com/378292/
http://
This branch fixes:
bin/test -vv -t publishing- security. txt -t tales.txt -t person-views.txt -t archive-views.txt -t archivesubscrip tion-views. txt -t builder-views.txt -t archive- dependencies. txt -t buildd- slavescanner. txt
Thanks.