Merge lp:~wgrant/launchpad/move-rescueiflost-tests into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Michael Hudson-Doyle on 2010-04-08 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | not available |
| Proposed branch: | lp:~wgrant/launchpad/move-rescueiflost-tests |
| Merge into: | lp:launchpad |
| Prerequisite: | lp:~wgrant/launchpad/more-buildmaster-cleanup |
| Diff against target: |
702 lines (+204/-284) 6 files modified
lib/lp/buildmaster/doc/builder.txt (+135/-93) lib/lp/buildmaster/doc/buildfarmjobbehavior.txt (+8/-0) lib/lp/buildmaster/tests/test_manager.py (+3/-3) lib/lp/code/tests/test_recipebuilder.py (+4/-4) lib/lp/soyuz/doc/buildd-slavescanner.txt (+3/-84) lib/lp/soyuz/tests/soyuzbuilddhelpers.py (+51/-100) |
| To merge this branch: | bzr merge lp:~wgrant/launchpad/move-rescueiflost-tests |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Michael Nelson (community) | code | Approve on 2010-04-07 | |
| Brad Crittenden (community) | 2010-04-03 | Needs Information on 2010-04-06 | |
|
Review via email:
|
|||
Commit Message
Move the rescueIfLost tests out of buildd-
Description of the Change
This branch moves buildd-
It replaces a tonne of mock slaves with a couple of configurable ones, and fixes a couple of other tests around the tree that used the condemned mocks. It also replaces with a test of IdleBuildBehavi
I also rewrote the start of builder.txt, since its style offended me.
| William Grant (wgrant) wrote : | # |
On Tue, 2010-04-06 at 15:51 +0000, Brad Crittenden wrote:
> Review: Needs Information
> Hi William,
>
> This branch looks great. As we discussed on IRC please run it past a Soyuz team member and I'll approve it.
Thanks for the review, Brad.
> > === modified file 'lib/lp/
> > --- lib/lp/
> > +++ lib/lp/
> > @@ -2,36 +2,34 @@
> > Builder Class
> > =============
> >
> > -This test aims to meet the requirements of
> > -<https:/
> > -which represents the Buildd Slave entity.
> > -
> > -Need auxiliar methods from zope toolchain:
> > +The Builder class represents a slave machine in the build farm. These
> > +slaves are used to execute untrusted code -- for example when building
> > +packages.
> > +
> > +There are several builders in the sample data. Let's examine the first.
> > +
> > + >>> from lp.buildmaster.
> > + >>> builder = Builder.get(1)
> > +
> > +As expected, it implements IBuilder.
>
> Nice changes.
>
> > +Builders can take on different behaviors depending on the type of build
> > +they are currently processing. Each builder provides an attribute
> > +(current_
> > +for the current build is delegated. In the sample data, bob's current
> > +behavior is the behavior for dealing with binary packages
>
> How about:
> "behavior is dealing with binary packages."
> (Note full-stop.)
>
> > >>> from zope.security.proxy import isinstance
> > >>> from lp.soyuz.
> > @@ -40,85 +38,77 @@
> > ... builder.
> > True
> >
> > -Confirm we can get the slave xmlrpc interface
> > +A builder has an XML-RPC proxy in the 'slave' attribute, which allows
> > +us to easily call methods on the slave machines.
> >
> > >>> s = builder.slave
> >
> > -Confirm that the urlbase is correct in that slave. (If the protocol changes,
> > -this may change too)
> > +The base URL of the proxy matches the builder's URL.
> >
> > >>> s.urlbase == builder.url
> > True
> >
> > -Check if the instance corresponds to the declared interface:
> > -
> > - >>> verifyObject(
> > - True
> > -
> >
> > BuilderSet
> > ==========
> >
> > -Now perform the tests for the Builder ContentSet class, BuilderSet.
> > -
> > -Check if it can be imported:
> > -
> > +Builders and groups thereof are managed through a utility, IBuilderSet.
> > +
> > + >>> from zope.component import getUtility
> > >>> from lp.buildmaster.
> > -
> > -Check we can use the set as a utility:
> > -
> > >>> builderset = getUtility(
> > -
> > -Check if the instance returned as utility corresponds to its
> > -respective interface:
> > -
> > >>> verifyObject(
> > True
> >
> > -Check if the instance is iterable:
> > +Iterating over a BuilderSet yields all registered builders.
...
| Michael Nelson (michael.nelson) wrote : | # |
I *think* Jelmer is actually working on refactoring a lot of buildd-slavescanner into unit-tests (but I can't see the branch), so it'd be worthwhile chatting with him about it (he might just handle the conflicts). Other than that, I'm all for it :)

Hi William,
This branch looks great. As we discussed on IRC please run it past a Soyuz team member and I'll approve it.
> === modified file 'lib/lp/ buildmaster/ doc/builder. txt' buildmaster/ doc/builder. txt 2010-03-24 10:24:22 +0000 buildmaster/ doc/builder. txt 2010-04-03 04:39:18 +0000 /launchpad. canonical. com/BasicTestCo verage> for the Builder class, model.builder import Builder
> --- lib/lp/
> +++ lib/lp/
> @@ -2,36 +2,34 @@
> Builder Class
> =============
>
> -This test aims to meet the requirements of
> -<https:/
> -which represents the Buildd Slave entity.
> -
> -Need auxiliar methods from zope toolchain:
> +The Builder class represents a slave machine in the build farm. These
> +slaves are used to execute untrusted code -- for example when building
> +packages.
> +
> +There are several builders in the sample data. Let's examine the first.
> +
> + >>> from lp.buildmaster.
> + >>> builder = Builder.get(1)
> +
> +As expected, it implements IBuilder.
Nice changes.
> +Builders can take on different behaviors depending on the type of build build_behavior) to which all the build-type specific behavior
> +they are currently processing. Each builder provides an attribute
> +(current_
> +for the current build is delegated. In the sample data, bob's current
> +behavior is the behavior for dealing with binary packages
How about:
"behavior is dealing with binary packages."
(Note full-stop.)
> >>> from zope.security.proxy import isinstance model.binarypac kagebuildbehavi or import ( current_ build_behavior, BinaryPackageBu ildBehavior) IBuilder, builder) interfaces. builder import IBuilderSet IBuilderSet) IBuilderSet, builderset)
> >>> from lp.soyuz.
> @@ -40,85 +38,77 @@
> ... builder.
> True
>
> -Confirm we can get the slave xmlrpc interface
> +A builder has an XML-RPC proxy in the 'slave' attribute, which allows
> +us to easily call methods on the slave machines.
>
> >>> s = builder.slave
>
> -Confirm that the urlbase is correct in that slave. (If the protocol changes,
> -this may change too)
> +The base URL of the proxy matches the builder's URL.
>
> >>> s.urlbase == builder.url
> True
>
> -Check if the instance corresponds to the declared interface:
> -
> - >>> verifyObject(
> - True
> -
>
> BuilderSet
> ==========
>
> -Now perform the tests for the Builder ContentSet class, BuilderSet.
> -
> -Check if it can be imported:
> -
> +Builders and groups thereof are managed through a utility, IBuilderSet.
> +
> + >>> from zope.component import getUtility
> >>> from lp.buildmaster.
> -
> -Check we can use the set as a utility:
> -
> >>> builderset = getUtility(
> -
> -Check if the instance returned as utility corresponds to its
> -respective interface:
> -
> >>> verifyObject(
> True
>
> -Check if the instance is iterable:
> +Iterating over a BuilderSet yields all registered builders.
>
> >>> for b in builderset:
> - ... b.id
> - 1
> + ... print b.name
> + bob
> + frog
> +
> +count() return the number of builder instance we have stored:
typo: instances
> +
> + >>> builderset.count()
> 2
>
> -Check if the __getitem__ method:
> -
...