launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #18562
[Merge] lp:~wgrant/launchpad/processor-virt into lp:launchpad
William Grant has proposed merging lp:~wgrant/launchpad/processor-virt into lp:launchpad with lp:~wgrant/launchpad/processor-nonvirt-db as a prerequisite.
Commit message:
Add new Processor columns, and use Processor.supports_virtualized in favour of DistroArchSeries.supports_virtualized.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~wgrant/launchpad/processor-virt/+merge/259096
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/processor-virt into lp:launchpad.
=== modified file 'lib/lp/archiveuploader/tests/test_ppauploadprocessor.py'
--- lib/lp/archiveuploader/tests/test_ppauploadprocessor.py 2014-10-31 07:00:29 +0000
+++ lib/lp/archiveuploader/tests/test_ppauploadprocessor.py 2015-05-14 09:38:46 +0000
@@ -64,7 +64,6 @@
self.name16_ppa = self.makeArchive(self.name16)
# Extra setup for breezy and allowing PPA builds on breezy/i386.
self.setupBreezy()
- self.breezy['i386'].supports_virtualized = True
transaction.commit()
# Set up the uploadprocessor with appropriate options and logger
@@ -286,7 +285,6 @@
# farty and override to use that.
self.setupBreezy(name="farty")
# Allow PPA builds.
- self.breezy['i386'].supports_virtualized = True
upload_dir = self.queueUpload("bar_1.0-1", "~name16/ppa/ubuntu/farty")
self.processUpload(self.uploadprocessor, upload_dir)
@@ -767,7 +765,7 @@
# Remove breezy/i386 PPA support.
self.switchToAdmin()
- self.breezy['i386'].supports_virtualized = False
+ self.breezy['i386'].processor.supports_virtualized = False
self.switchToUploader()
# Next version can't be accepted because it can't be built.
=== modified file 'lib/lp/archiveuploader/tests/test_recipeuploads.py'
--- lib/lp/archiveuploader/tests/test_recipeuploads.py 2011-12-19 23:38:16 +0000
+++ lib/lp/archiveuploader/tests/test_recipeuploads.py 2015-05-14 09:38:46 +0000
@@ -30,10 +30,6 @@
self.setupBreezy()
- # We need at least one architecture for the PPA upload to be
- # accepted.
- self.breezy['i386'].supports_virtualized = True
-
self.switchToAdmin()
self.recipe = self.factory.makeSourcePackageRecipe()
self.build = getUtility(ISourcePackageRecipeBuildSource).new(
=== modified file 'lib/lp/buildmaster/interfaces/processor.py'
--- lib/lp/buildmaster/interfaces/processor.py 2015-04-20 09:48:57 +0000
+++ lib/lp/buildmaster/interfaces/processor.py 2015-05-14 09:38:46 +0000
@@ -66,6 +66,17 @@
restricted = exported(
Bool(title=_("Whether this processor is restricted.")),
as_of='devel', readonly=True)
+ build_by_default = exported(
+ Bool(title=_(
+ "Whether this processor is enabled on archives by default.")),
+ as_of='devel', readonly=True)
+ supports_virtualized = exported(
+ Bool(title=_("Whether this processor supports virtualized builds.")),
+ as_of='devel', readonly=True)
+ supports_nonvirtualized = exported(
+ Bool(title=_(
+ "Whether this processor supports non-virtualized builds.")),
+ as_of='devel', readonly=True)
class IProcessorSet(Interface):
@@ -92,7 +103,9 @@
def getRestricted():
"""Return all restricted `IProcessor`s."""
- def new(name, title, description, restricted):
+ def new(name, title, description, restricted=False,
+ build_by_default=False, supports_virtualized=False,
+ supports_nonvirtualized=True):
"""Create a new processor.
:param name: Name of the processor.
=== modified file 'lib/lp/buildmaster/model/processor.py'
--- lib/lp/buildmaster/model/processor.py 2015-04-20 09:48:57 +0000
+++ lib/lp/buildmaster/model/processor.py 2015-05-14 09:38:46 +0000
@@ -28,6 +28,9 @@
title = StringCol(dbName='title', notNull=True)
description = StringCol(dbName='description', notNull=True)
restricted = Bool(allow_none=False, default=False)
+ build_by_default = Bool(allow_none=False, default=False)
+ supports_virtualized = Bool(allow_none=False, default=False)
+ supports_nonvirtualized = Bool(allow_none=False, default=True)
def __repr__(self):
return "<Processor %r>" % self.title
@@ -53,8 +56,12 @@
"""See `IProcessorSet`."""
return IStore(Processor).find(Processor, Processor.restricted == True)
- def new(self, name, title, description, restricted=False):
+ def new(self, name, title, description, restricted=False,
+ build_by_default=False, supports_virtualized=False,
+ supports_nonvirtualized=True):
"""See `IProcessorSet`."""
return Processor(
name=name, title=title, description=description,
- restricted=restricted)
+ restricted=restricted, build_by_default=build_by_default,
+ supports_virtualized=supports_virtualized,
+ supports_nonvirtualized=supports_nonvirtualized)
=== modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipe.py'
--- lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2015-04-30 01:45:30 +0000
+++ lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2015-05-14 09:38:46 +0000
@@ -106,7 +106,7 @@
naked_squirrel = removeSecurityProxy(self.squirrel)
naked_squirrel.nominatedarchindep = self.squirrel.newArch(
'i386', getUtility(IProcessorSet).getByName('386'), False,
- self.chef, supports_virtualized=True)
+ self.chef)
def makeRecipe(self):
"""Create and return a specific recipe."""
@@ -1488,7 +1488,7 @@
distribution=self.ppa.distribution)
removeSecurityProxy(woody).nominatedarchindep = woody.newArch(
'i386', getUtility(IProcessorSet).getByName('386'), False,
- self.factory.makePerson(), supports_virtualized=True)
+ self.factory.makePerson())
return woody
def test_request_builds_rejects_duplicate(self):
=== modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipebuild.py'
--- lib/lp/code/browser/tests/test_sourcepackagerecipebuild.py 2015-04-20 09:48:57 +0000
+++ lib/lp/code/browser/tests/test_sourcepackagerecipebuild.py 2015-05-14 09:38:46 +0000
@@ -71,7 +71,7 @@
naked_squirrel = removeSecurityProxy(self.squirrel)
naked_squirrel.nominatedarchindep = self.squirrel.newArch(
'i386', getUtility(IProcessorSet).getByName('386'), False,
- self.chef, supports_virtualized=True)
+ self.chef)
def makeRecipeBuild(self):
"""Create and return a specific recipe."""
=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipebuild.py'
--- lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2015-04-30 01:45:30 +0000
+++ lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2015-05-14 09:38:46 +0000
@@ -61,8 +61,7 @@
person = self.factory.makePerson()
distroseries = self.factory.makeDistroSeries()
distroseries_i386 = distroseries.newArch(
- 'i386', getUtility(IProcessorSet).getByName('386'), False, person,
- supports_virtualized=True)
+ 'i386', getUtility(IProcessorSet).getByName('386'), False, person)
removeSecurityProxy(distroseries).nominatedarchindep = (
distroseries_i386)
if archive is None:
=== modified file 'lib/lp/registry/interfaces/distroseries.py'
--- lib/lp/registry/interfaces/distroseries.py 2015-03-06 13:19:06 +0000
+++ lib/lp/registry/interfaces/distroseries.py 2015-05-14 09:38:46 +0000
@@ -765,8 +765,7 @@
:return: A new `PackageUpload`.
"""
- def newArch(architecturetag, processor, official, owner,
- supports_virtualized=False, enabled=True):
+ def newArch(architecturetag, processor, official, owner, enabled=True):
"""Create a new port or DistroArchSeries for this DistroSeries."""
def getPOFileContributorsByLanguage(language):
=== modified file 'lib/lp/registry/model/distroseries.py'
--- lib/lp/registry/model/distroseries.py 2014-11-09 23:32:23 +0000
+++ lib/lp/registry/model/distroseries.py 2015-05-14 09:38:46 +0000
@@ -57,6 +57,7 @@
from lp.bugs.model.structuralsubscription import (
StructuralSubscriptionTargetMixin,
)
+from lp.buildmaster.model.processor import Processor
from lp.registry.errors import NoSuchDistroSeries
from lp.registry.interfaces.distroseries import (
DerivationError,
@@ -420,7 +421,8 @@
results = store.find(
DistroArchSeries,
DistroArchSeries.distroseries == self,
- DistroArchSeries.supports_virtualized == True)
+ Processor.id == DistroArchSeries.processor_id,
+ Processor.supports_virtualized == True)
return results.order_by(DistroArchSeries.architecturetag)
# End of DistroArchSeries lookup methods
@@ -1178,12 +1180,11 @@
return DecoratedResultSet(package_caches, result_to_dsbp)
def newArch(self, architecturetag, processor, official, owner,
- supports_virtualized=False, enabled=True):
+ enabled=True):
"""See `IDistroSeries`."""
return DistroArchSeries(
architecturetag=architecturetag, processor=processor,
- official=official, distroseries=self, owner=owner,
- supports_virtualized=supports_virtualized, enabled=enabled)
+ official=official, distroseries=self, owner=owner, enabled=enabled)
def newMilestone(self, name, dateexpected=None, summary=None,
code_name=None, tags=None):
=== modified file 'lib/lp/soyuz/browser/distroarchseries.py'
--- lib/lp/soyuz/browser/distroarchseries.py 2013-12-14 00:01:14 +0000
+++ lib/lp/soyuz/browser/distroarchseries.py 2015-05-14 09:38:46 +0000
@@ -98,8 +98,7 @@
class DistroArchSeriesAddView(LaunchpadFormView):
schema = DistroArchSeriesAddSchema
- field_names = [
- 'architecturetag', 'processor', 'official', 'supports_virtualized']
+ field_names = ['architecturetag', 'processor', 'official']
@property
def label(self):
@@ -120,8 +119,8 @@
def create_action(self, action, data):
"""Create a new Port."""
distroarchseries = self.context.newArch(
- data['architecturetag'], data['processor'],
- data['official'], self.user, data['supports_virtualized'])
+ data['architecturetag'], data['processor'], data['official'],
+ self.user)
self.next_url = canonical_url(distroarchseries)
@@ -130,10 +129,7 @@
schema = IDistroArchSeries
- field_names = [
- 'architecturetag', 'official', 'supports_virtualized',
- 'enabled',
- ]
+ field_names = ['architecturetag', 'official', 'enabled']
@action(_('Change'), name='update')
def change_details(self, action, data):
=== modified file 'lib/lp/soyuz/browser/tests/test_publishing.py'
--- lib/lp/soyuz/browser/tests/test_publishing.py 2014-07-08 06:34:37 +0000
+++ lib/lp/soyuz/browser/tests/test_publishing.py 2015-05-14 09:38:46 +0000
@@ -46,12 +46,11 @@
self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)
# Create everything we need to create builds, such as a
# DistroArchSeries and a builder.
- self.processor = self.factory.makeProcessor()
+ self.processor = self.factory.makeProcessor(supports_virtualized=True)
self.distroseries = self.factory.makeDistroSeries(
distribution=getUtility(IDistributionSet)['ubuntu'])
self.das = self.factory.makeDistroArchSeries(
- distroseries=self.distroseries, processor=self.processor,
- supports_virtualized=True)
+ distroseries=self.distroseries, processor=self.processor)
self.archive = self.factory.makeArchive(
distribution=self.distroseries.distribution)
with person_logged_in(self.admin):
=== modified file 'lib/lp/soyuz/doc/distroarchseries.txt'
--- lib/lp/soyuz/doc/distroarchseries.txt 2014-07-16 00:57:21 +0000
+++ lib/lp/soyuz/doc/distroarchseries.txt 2015-05-14 09:38:46 +0000
@@ -200,7 +200,7 @@
>>> from lp.services.database.sqlbase import flush_database_updates
>>> login('foo.bar@xxxxxxxxxxxxx')
- >>> hoary['hppa'].supports_virtualized = True
+ >>> hoary['hppa'].processor.supports_virtualized = True
>>> flush_database_updates()
>>> print_architectures(hoary.virtualized_architectures)
=== modified file 'lib/lp/soyuz/interfaces/distroarchseries.py'
--- lib/lp/soyuz/interfaces/distroarchseries.py 2015-04-20 09:48:57 +0000
+++ lib/lp/soyuz/interfaces/distroarchseries.py 2015-05-14 09:38:46 +0000
@@ -99,7 +99,7 @@
title=_("PPA support available"),
description=_("Indicate whether or not this port has support "
"for building PPA packages."),
- required=False))
+ readonly=True, required=False))
enabled = exported(
Bool(
title=_("Enabled"),
=== modified file 'lib/lp/soyuz/model/binarypackagebuild.py'
--- lib/lp/soyuz/model/binarypackagebuild.py 2015-05-12 01:13:19 +0000
+++ lib/lp/soyuz/model/binarypackagebuild.py 2015-05-14 09:38:46 +0000
@@ -1398,7 +1398,7 @@
not das.processor.restricted
or das.processor in archive.enabled_restricted_processors)
and (
- das.supports_virtualized
+ das.processor.supports_virtualized
or not archive.require_virtualized))]
def createForSource(self, sourcepackagerelease, archive, distroseries,
=== modified file 'lib/lp/soyuz/model/distroarchseries.py'
--- lib/lp/soyuz/model/distroarchseries.py 2015-04-20 09:48:57 +0000
+++ lib/lp/soyuz/model/distroarchseries.py 2015-05-14 09:38:46 +0000
@@ -76,7 +76,6 @@
dbName='owner', foreignKey='Person',
storm_validator=validate_public_person, notNull=True)
package_count = IntCol(notNull=True, default=DEFAULT)
- supports_virtualized = BoolCol(notNull=False, default=False)
enabled = BoolCol(notNull=False, default=True)
packages = SQLRelatedJoin('BinaryPackageRelease',
@@ -100,6 +99,10 @@
self.distroseries.distribution.displayname,
self.distroseries.displayname, self.architecturetag)
+ @property
+ def supports_virtualized(self):
+ return self.processor.supports_virtualized
+
def updatePackageCount(self):
"""See `IDistroArchSeries`."""
from lp.soyuz.model.publishing import BinaryPackagePublishingHistory
=== modified file 'lib/lp/soyuz/scripts/initialize_distroseries.py'
--- lib/lp/soyuz/scripts/initialize_distroseries.py 2014-10-31 05:29:24 +0000
+++ lib/lp/soyuz/scripts/initialize_distroseries.py 2015-05-14 09:38:46 +0000
@@ -384,10 +384,8 @@
sqlvalues(self.arches))
self._store.execute("""
INSERT INTO DistroArchSeries
- (distroseries, processor, architecturetag, owner, official,
- supports_virtualized)
- SELECT %s, processor, architecturetag, %s,
- bool_and(official), bool_or(supports_virtualized)
+ (distroseries, processor, architecturetag, owner, official)
+ SELECT %s, processor, architecturetag, %s, bool_and(official)
FROM DistroArchSeries WHERE enabled = TRUE %s
GROUP BY processor, architecturetag
""" % (sqlvalues(self.distroseries, self.distroseries.owner)
=== modified file 'lib/lp/soyuz/scripts/tests/test_add_missing_builds.py'
--- lib/lp/soyuz/scripts/tests/test_add_missing_builds.py 2014-11-05 10:48:11 +0000
+++ lib/lp/soyuz/scripts/tests/test_add_missing_builds.py 2015-05-14 09:38:46 +0000
@@ -41,7 +41,7 @@
# i386 and hppa are enabled by STP but we need to mark hppa as
# PPA-enabled.
- self.stp.breezy_autotest_hppa.supports_virtualized = True
+ self.stp.breezy_autotest_hppa.processor.supports_virtualized = True
# Create an arch-any and an arch-all source in a PPA.
self.ppa = self.factory.makeArchive(
=== modified file 'lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py'
--- lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py 2015-04-20 09:48:57 +0000
+++ lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py 2015-05-14 09:38:46 +0000
@@ -58,12 +58,12 @@
processor = getUtility(IProcessorSet).getByName(processor_name)
except ProcessorNotFound:
processor = self.factory.makeProcessor(name=processor_name)
+ processor.supports_virtualized = True
parent_das = self.factory.makeDistroArchSeries(
distroseries=parent, processor=processor, architecturetag=arch_tag)
lf = self.factory.makeLibraryFileAlias()
transaction.commit()
parent_das.addOrUpdateChroot(lf)
- parent_das.supports_virtualized = True
return parent_das
def setupParent(self, parent=None, packages=None, format_selection=None,
=== modified file 'lib/lp/soyuz/stories/distroseries/add-architecture.txt'
--- lib/lp/soyuz/stories/distroseries/add-architecture.txt 2013-09-30 02:59:29 +0000
+++ lib/lp/soyuz/stories/distroseries/add-architecture.txt 2015-05-14 09:38:46 +0000
@@ -22,7 +22,6 @@
>>> admin_browser.getControl('Architecture Tag').value = 'ia64'
>>> admin_browser.getControl('Processor:').value = ['amd64']
>>> admin_browser.getControl('Official Support').selected = True
- >>> admin_browser.getControl('PPA support available').selected = True
>>> admin_browser.getControl('Continue').click()
>>> print admin_browser.title
ia64 : Hoary (5.04) : Ubuntu
=== modified file 'lib/lp/soyuz/stories/ppa/xx-copy-packages.txt'
--- lib/lp/soyuz/stories/ppa/xx-copy-packages.txt 2015-04-20 09:48:57 +0000
+++ lib/lp/soyuz/stories/ppa/xx-copy-packages.txt 2015-05-14 09:38:46 +0000
@@ -128,8 +128,7 @@
>>> cprov = person_set.getByName('cprov')
>>> grumpy = ubuntu.getSeries('grumpy')
>>> grumpy_i386 = grumpy.newArch(
- ... 'i386', getUtility(IProcessorSet).getByName('386'), False, cprov,
- ... supports_virtualized=True)
+ ... 'i386', getUtility(IProcessorSet).getByName('386'), False, cprov)
>>> grumpy.nominatedarchindep = grumpy_i386
>>> trash = grumpy_i386.addOrUpdateChroot(fake_chroot)
=== modified file 'lib/lp/soyuz/stories/soyuz/xx-distroarchseries.txt'
--- lib/lp/soyuz/stories/soyuz/xx-distroarchseries.txt 2013-09-30 02:59:29 +0000
+++ lib/lp/soyuz/stories/soyuz/xx-distroarchseries.txt 2015-05-14 09:38:46 +0000
@@ -105,8 +105,6 @@
'i386'
>>> admin_browser.getControl("Official Support").selected
True
- >>> admin_browser.getControl("PPA support available").selected
- True
The page presents a cancellation link that returns the user back to the
DistroArchSeries page if clicked:
@@ -114,9 +112,9 @@
>>> print admin_browser.getLink("Cancel").url
http://launchpad.dev/ubuntu/warty/i386
-Removing the PPA support for this DistroArchSeries.
+Removing the official support for this DistroArchSeries.
- >>> admin_browser.getControl("PPA support available").selected = False
+ >>> admin_browser.getControl("Official Support").selected = False
Clicking the "Change" button makes the change and takes the user back to the
DistroArchSeries page.
@@ -137,8 +135,6 @@
>>> admin_browser.getControl("Architecture Tag").value
'i386'
>>> admin_browser.getControl("Official Support").selected
- True
- >>> admin_browser.getControl("PPA support available").selected
False
We always present a warning in this form indicating that changes may
@@ -160,33 +156,17 @@
... print extract_text(find_tag_by_id(
... anon_browser.contents, 'portlet-architectures-list'))
-Since we disabled ppa-support for warty/i386, it's now presented as
-'official' only.
-
- >>> check_arch_list()
- i386
- hppa (unofficial)
-
-Re-enabling the PPA support on warty/i386 has immediate effects in the
-way this distroarchseries is presented.
-
- >>> admin_browser.getControl("PPA support available").selected = True
- >>> admin_browser.getControl("Change").click()
-
- >>> check_arch_list()
- i386
- hppa (unofficial)
-
-The same effect is observed when we make warty/i386 unofficial.
-
- >>> admin_browser.getLink("Administer").click()
- >>> admin_browser.getControl("Official Support").selected = False
- >>> admin_browser.getControl("Change").click()
-
>>> check_arch_list()
hppa (unofficial)
i386 (unofficial)
+ >>> admin_browser.getControl("Official Support").selected = True
+ >>> admin_browser.getControl("Change").click()
+
+ >>> check_arch_list()
+ i386
+ hppa (unofficial)
+
== Creating a new DistroArchSeries ==
@@ -209,7 +189,6 @@
>>> admin_browser.getControl("Architecture Tag").value = 'i386'
>>> admin_browser.getControl("Processor:").value = ['386']
>>> admin_browser.getControl("Official Support").selected = True
- >>> admin_browser.getControl("PPA support available").selected = True
XXX cprov 20071213: we should return a proper error page on attempts
to open an already installed architecture instead of a
@@ -241,7 +220,6 @@
>>> admin_browser.getControl("Architecture Tag").value = 'amd64'
>>> admin_browser.getControl("Processor:").value = ['amd64']
>>> admin_browser.getControl("Official Support").selected = True
- >>> admin_browser.getControl("PPA support available").selected = True
>>> admin_browser.getControl("Continue").click()
When the new architecture has been created, it is displayed to the
=== modified file 'lib/lp/soyuz/tests/test_build.py'
--- lib/lp/soyuz/tests/test_build.py 2014-10-31 07:00:29 +0000
+++ lib/lp/soyuz/tests/test_build.py 2015-05-14 09:38:46 +0000
@@ -45,11 +45,10 @@
def setUp(self):
super(TestBuild, self).setUp()
self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)
- self.processor = self.factory.makeProcessor()
+ self.processor = self.factory.makeProcessor(supports_virtualized=True)
self.distroseries = self.factory.makeDistroSeries()
self.das = self.factory.makeDistroArchSeries(
- distroseries=self.distroseries, processor=self.processor,
- supports_virtualized=True)
+ distroseries=self.distroseries, processor=self.processor)
with person_logged_in(self.admin):
self.publisher = SoyuzTestPublisher()
self.publisher.prepareBreezyAutotest()
@@ -166,8 +165,7 @@
# Builds can not be retried for released distroseries
distroseries = self.factory.makeDistroSeries()
das = self.factory.makeDistroArchSeries(
- distroseries=distroseries, processor=self.processor,
- supports_virtualized=True)
+ distroseries=distroseries, processor=self.processor)
with person_logged_in(self.admin):
distroseries.nominatedarchindep = das
distroseries.status = SeriesStatus.OBSOLETE
@@ -184,8 +182,7 @@
# released.
distroseries = self.factory.makeDistroSeries()
das = self.factory.makeDistroArchSeries(
- distroseries=distroseries, processor=self.processor,
- supports_virtualized=True)
+ distroseries=distroseries, processor=self.processor)
archive = self.factory.makeArchive(
purpose=ArchivePurpose.PARTNER,
distribution=distroseries.distribution)
=== modified file 'lib/lp/soyuz/tests/test_build_depwait.py'
--- lib/lp/soyuz/tests/test_build_depwait.py 2013-11-28 08:51:32 +0000
+++ lib/lp/soyuz/tests/test_build_depwait.py 2015-05-14 09:38:46 +0000
@@ -31,11 +31,10 @@
self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)
# Create everything we need to create builds, such as a
# DistroArchSeries and a builder.
- self.processor = self.factory.makeProcessor()
+ self.processor = self.factory.makeProcessor(supports_virtualized=True)
self.distroseries = self.factory.makeDistroSeries()
self.das = self.factory.makeDistroArchSeries(
- distroseries=self.distroseries, processor=self.processor,
- supports_virtualized=True)
+ distroseries=self.distroseries, processor=self.processor)
self.archive = self.factory.makeArchive(
distribution=self.distroseries.distribution,
purpose=ArchivePurpose.PRIMARY)
=== modified file 'lib/lp/soyuz/tests/test_build_notify.py'
--- lib/lp/soyuz/tests/test_build_notify.py 2014-07-09 06:34:14 +0000
+++ lib/lp/soyuz/tests/test_build_notify.py 2015-05-14 09:38:46 +0000
@@ -35,11 +35,10 @@
super(TestBuildNotify, self).setUp()
self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)
# Create all of the items we need to create builds
- self.processor = self.factory.makeProcessor()
+ self.processor = self.factory.makeProcessor(supports_virtualized=True)
self.distroseries = self.factory.makeDistroSeries()
self.das = self.factory.makeDistroArchSeries(
- distroseries=self.distroseries, processor=self.processor,
- supports_virtualized=True)
+ distroseries=self.distroseries, processor=self.processor)
self.creator = self.factory.makePerson(email='test@xxxxxxxxxxx')
self.gpgkey = self.factory.makeGPGKey(owner=self.creator)
self.archive = self.factory.makeArchive(
=== modified file 'lib/lp/soyuz/tests/test_build_privacy.py'
--- lib/lp/soyuz/tests/test_build_privacy.py 2013-11-28 08:51:32 +0000
+++ lib/lp/soyuz/tests/test_build_privacy.py 2015-05-14 09:38:46 +0000
@@ -25,11 +25,10 @@
super(TestBuildPrivacy, self).setUp()
# Add everything we need to create builds.
self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)
- processor = self.factory.makeProcessor()
+ processor = self.factory.makeProcessor(supports_virtualized=True)
distroseries = self.factory.makeDistroSeries()
das = self.factory.makeDistroArchSeries(
- distroseries=distroseries, processor=processor,
- supports_virtualized=True)
+ distroseries=distroseries, processor=processor)
with person_logged_in(self.admin):
publisher = SoyuzTestPublisher()
publisher.prepareBreezyAutotest()
=== modified file 'lib/lp/soyuz/tests/test_build_set.py'
--- lib/lp/soyuz/tests/test_build_set.py 2015-02-11 14:43:44 +0000
+++ lib/lp/soyuz/tests/test_build_set.py 2015-05-14 09:38:46 +0000
@@ -45,16 +45,16 @@
def setUp(self):
super(TestBuildSet, self).setUp()
self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)
- self.processor_one = self.factory.makeProcessor()
- self.processor_two = self.factory.makeProcessor()
+ self.processor_one = self.factory.makeProcessor(
+ supports_virtualized=True)
+ self.processor_two = self.factory.makeProcessor(
+ supports_virtualized=True)
self.distroseries = self.factory.makeDistroSeries()
self.distribution = self.distroseries.distribution
self.das_one = self.factory.makeDistroArchSeries(
- distroseries=self.distroseries, processor=self.processor_one,
- supports_virtualized=True)
+ distroseries=self.distroseries, processor=self.processor_one)
self.das_two = self.factory.makeDistroArchSeries(
- distroseries=self.distroseries, processor=self.processor_two,
- supports_virtualized=True)
+ distroseries=self.distroseries, processor=self.processor_two)
self.archive = self.factory.makeArchive(
distribution=self.distroseries.distribution,
purpose=ArchivePurpose.PRIMARY)
@@ -243,13 +243,15 @@
def setUp(self):
super(TestGetAllowedArchitectures, self).setUp()
- self.avr = self.factory.makeProcessor(name="avr2001")
- self.sparc = self.factory.makeProcessor(name="sparc64")
+ self.avr = self.factory.makeProcessor(
+ name="avr2001", supports_virtualized=True)
+ self.sparc = self.factory.makeProcessor(
+ name="sparc64", supports_virtualized=True)
self.distroseries = self.factory.makeDistroSeries()
for name, arch in (('avr', self.avr), ('sparc', self.sparc)):
self.factory.makeDistroArchSeries(
architecturetag=name, processor=arch,
- distroseries=self.distroseries, supports_virtualized=True)
+ distroseries=self.distroseries)
self.archive = self.factory.makeArchive(
distribution=self.distroseries.distribution)
@@ -287,7 +289,7 @@
def test_virt_archives_have_only_virt_archs(self):
# For archives which must build on virtual builders, only
# virtual archs are returned.
- self.distroseries['sparc'].supports_virtualized = False
+ self.sparc.supports_virtualized = False
self.assertContentEqual(
[self.distroseries['avr']],
BinaryPackageBuildSet()._getAllowedArchitectures(
@@ -295,7 +297,7 @@
def test_nonvirt_archives_have_only_all_archs(self):
# Non-virtual archives can build on all unrestricted architectures.
- self.distroseries['sparc'].supports_virtualized = False
+ self.sparc.supports_virtualized = False
self.archive.require_virtualized = False
self.assertContentEqual(
[self.distroseries['sparc'], self.distroseries['avr']],
@@ -310,16 +312,19 @@
super(BuildRecordCreationTests, self).setUp()
self.distro = self.factory.makeDistribution()
self.archive = self.factory.makeArchive(distribution=self.distro)
- self.avr = self.factory.makeProcessor(name="avr2001")
- self.sparc = self.factory.makeProcessor(name="sparc64")
- self.x32 = self.factory.makeProcessor(name="x32")
+ self.avr = self.factory.makeProcessor(
+ name="avr2001", supports_virtualized=True)
+ self.sparc = self.factory.makeProcessor(
+ name="sparc64", supports_virtualized=True)
+ self.x32 = self.factory.makeProcessor(
+ name="x32", supports_virtualized=True)
self.distroseries = self.factory.makeDistroSeries(
distribution=self.distro, name="crazy")
for name, arch in (('avr', self.avr), ('sparc', self.sparc)):
self.factory.makeDistroArchSeries(
architecturetag=name, processor=arch,
- distroseries=self.distroseries, supports_virtualized=True)
+ distroseries=self.distroseries)
self.distroseries.nominatedarchindep = self.distroseries['sparc']
self.addFakeChroots(self.distroseries)
@@ -329,7 +334,7 @@
('x32', self.x32)):
self.factory.makeDistroArchSeries(
architecturetag=name, processor=arch,
- distroseries=self.distroseries2, supports_virtualized=True)
+ distroseries=self.distroseries2)
self.distroseries2.nominatedarchindep = self.distroseries2['x32']
self.addFakeChroots(self.distroseries2)
@@ -607,7 +612,8 @@
sourcepackagerelease=spr, archive=parent_archive,
distroseries=dsp.parent_series)
das = self.factory.makeDistroArchSeries(
- distroseries=dsp.parent_series, supports_virtualized=True)
+ distroseries=dsp.parent_series,
+ processor=self.factory.makeProcessor(supports_virtualized=True))
orig_build = getUtility(IBinaryPackageBuildSet).new(
spr, parent_archive, das, PackagePublishingPocket.RELEASE,
status=BuildStatus.FULLYBUILT)
@@ -620,7 +626,7 @@
# archtag as the parent.
das_derived = self.factory.makeDistroArchSeries(
dsp.derived_series, architecturetag=das.architecturetag,
- processor=das.processor, supports_virtualized=True)
+ processor=das.processor)
# Now copy the package to the derived series, with binary.
derived_archive = dsp.derived_series.main_archive
getUtility(ISourcePackageFormatSelectionSet).add(
=== modified file 'lib/lp/soyuz/tests/test_build_start_estimation.py'
--- lib/lp/soyuz/tests/test_build_start_estimation.py 2013-09-12 02:33:22 +0000
+++ lib/lp/soyuz/tests/test_build_start_estimation.py 2015-05-14 09:38:46 +0000
@@ -42,7 +42,7 @@
self.bob = getUtility(IBuilderSet).getByName(BOB_THE_BUILDER_NAME)
das = self.factory.makeDistroArchSeries(
distroseries=self.distroseries, processor=self.bob.processor,
- architecturetag='i386', supports_virtualized=True)
+ architecturetag='i386')
with person_logged_in(self.admin):
self.distroseries.nominatedarchindep = das
self.publisher.addFakeChroots(distroseries=self.distroseries)
=== modified file 'lib/lp/soyuz/tests/test_hasbuildrecords.py'
--- lib/lp/soyuz/tests/test_hasbuildrecords.py 2014-10-29 07:41:24 +0000
+++ lib/lp/soyuz/tests/test_hasbuildrecords.py 2015-05-14 09:38:46 +0000
@@ -79,16 +79,16 @@
self.admin = getUtility(IPersonSet).getByEmail(ADMIN_EMAIL)
# Create the machinery we need to create builds, such as
# DistroArchSeries and builders.
- self.processor_one = self.factory.makeProcessor()
- self.processor_two = self.factory.makeProcessor()
+ self.processor_one = self.factory.makeProcessor(
+ supports_virtualized=True)
+ self.processor_two = self.factory.makeProcessor(
+ supports_virtualized=True)
self.distroseries = self.factory.makeDistroSeries()
self.distribution = self.distroseries.distribution
self.das_one = self.factory.makeDistroArchSeries(
- distroseries=self.distroseries, processor=self.processor_one,
- supports_virtualized=True)
+ distroseries=self.distroseries, processor=self.processor_one)
self.das_two = self.factory.makeDistroArchSeries(
- distroseries=self.distroseries, processor=self.processor_two,
- supports_virtualized=True)
+ distroseries=self.distroseries, processor=self.processor_two)
self.archive = self.factory.makeArchive(
distribution=self.distroseries.distribution,
purpose=ArchivePurpose.PRIMARY)
@@ -305,11 +305,10 @@
# Set up a distroseries and related bits, so we can create builds.
source_name = self.factory.getUniqueString()
spn = self.factory.makeSourcePackageName(name=source_name)
- processor = self.factory.makeProcessor()
+ processor = self.factory.makeProcessor(supports_virtualized=True)
distroseries = self.factory.makeDistroSeries()
das = self.factory.makeDistroArchSeries(
- distroseries=distroseries, processor=processor,
- supports_virtualized=True)
+ distroseries=distroseries, processor=processor)
with person_logged_in(admin):
publisher = SoyuzTestPublisher()
publisher.prepareBreezyAutotest()
=== modified file 'lib/lp/soyuz/tests/test_initializedistroseriesjob.py'
--- lib/lp/soyuz/tests/test_initializedistroseriesjob.py 2015-04-20 09:48:57 +0000
+++ lib/lp/soyuz/tests/test_initializedistroseriesjob.py 2015-05-14 09:38:46 +0000
@@ -232,7 +232,7 @@
def create_child(factory):
- processor = factory.makeProcessor()
+ processor = factory.makeProcessor(supports_virtualized=True)
parent = factory.makeDistroSeries()
parent_das = factory.makeDistroArchSeries(
distroseries=parent, processor=processor)
@@ -241,7 +241,6 @@
transaction.commit()
parent_das.addOrUpdateChroot(lf)
with celebrity_logged_in('admin'):
- parent_das.supports_virtualized = True
parent.nominatedarchindep = parent_das
publisher = SoyuzTestPublisher()
publisher.prepareBreezyAutotest()
@@ -279,12 +278,12 @@
processor = getUtility(IProcessorSet).getByName(processor_name)
except ProcessorNotFound:
processor = self.factory.makeProcessor(name=processor_name)
+ processor.supports_virtualized = True
parent_das = self.factory.makeDistroArchSeries(
distroseries=parent, processor=processor, architecturetag=arch_tag)
lf = self.factory.makeLibraryFileAlias()
transaction.commit()
parent_das.addOrUpdateChroot(lf)
- parent_das.supports_virtualized = True
return parent_das
def test_job(self):
=== modified file 'lib/lp/soyuz/tests/test_packagecloner.py'
--- lib/lp/soyuz/tests/test_packagecloner.py 2015-04-20 09:48:57 +0000
+++ lib/lp/soyuz/tests/test_packagecloner.py 2015-05-14 09:38:46 +0000
@@ -78,8 +78,7 @@
distribution=distro, name=distroseries_name)
das = self.factory.makeDistroArchSeries(
distroseries=distroseries, architecturetag="i386",
- processor=getUtility(IProcessorSet).getByName('386'),
- supports_virtualized=True)
+ processor=getUtility(IProcessorSet).getByName('386'))
distroseries.nominatedarchindep = das
return distroseries
@@ -365,11 +364,10 @@
package_info = PackageInfo(
"bzr", "2.1", status=PackagePublishingStatus.PUBLISHED)
distroseries = self.createSourceDistribution([package_info])
- # Create a DAS for a second processor.
+ # Create a DAS for a second processor.
self.factory.makeDistroArchSeries(
distroseries=distroseries, architecturetag="amd64",
- processor=getUtility(IProcessorSet).getByName('amd64'),
- supports_virtualized=True)
+ processor=getUtility(IProcessorSet).getByName('amd64'))
# The request builds for only one of the processors, so we
# expect just one build for each source.
processors = [getUtility(IProcessorSet).getByName('386')]
@@ -387,7 +385,7 @@
amd64 = getUtility(IProcessorSet).getByName('amd64')
self.factory.makeDistroArchSeries(
distroseries=distroseries, architecturetag="amd64",
- processor=amd64, supports_virtualized=True)
+ processor=amd64)
# The request builds for both processors, so we expect two builds
# per source.
processors = [getUtility(IProcessorSet).getByName('386'), amd64]
@@ -648,7 +646,7 @@
amd64 = getUtility(IProcessorSet).getByName('amd64')
self.factory.makeDistroArchSeries(
distroseries=distroseries, architecturetag="amd64",
- processor=amd64, supports_virtualized=True)
+ processor=amd64)
# The request builds for both processors, so we expect two builds
# per source.
processors = [getUtility(IProcessorSet).getByName('386'), amd64]
=== modified file 'lib/lp/soyuz/tests/test_publishing.py'
--- lib/lp/soyuz/tests/test_publishing.py 2015-04-29 13:58:31 +0000
+++ lib/lp/soyuz/tests/test_publishing.py 2015-05-14 09:38:46 +0000
@@ -120,7 +120,7 @@
except NotFoundError:
self.breezy_autotest_i386 = self.breezy_autotest.newArch(
'i386', getUtility(IProcessorSet).getByName('386'), False,
- self.person, supports_virtualized=True)
+ self.person)
try:
self.breezy_autotest_hppa = self.breezy_autotest['hppa']
except NotFoundError:
=== modified file 'lib/lp/testing/factory.py'
--- lib/lp/testing/factory.py 2015-05-10 23:13:48 +0000
+++ lib/lp/testing/factory.py 2015-05-14 09:38:46 +0000
@@ -869,7 +869,9 @@
name=name, active=active, dateexpected=dateexpected))
def makeProcessor(self, name=None, title=None, description=None,
- restricted=False):
+ restricted=False, build_by_default=False,
+ supports_virtualized=False,
+ supports_nonvirtualized=True):
"""Create a new processor.
:param name: Name of the processor
@@ -885,7 +887,10 @@
if description is None:
description = "The %s processor and compatible processors" % name
return getUtility(IProcessorSet).new(
- name, title, description, restricted)
+ name, title, description, restricted=restricted,
+ build_by_default=build_by_default,
+ supports_virtualized=supports_virtualized,
+ supports_nonvirtualized=supports_nonvirtualized)
def makeProductRelease(self, milestone=None, product=None,
productseries=None):
@@ -2708,8 +2713,7 @@
def makeDistroArchSeries(self, distroseries=None,
architecturetag=None, processor=None,
- official=True, owner=None,
- supports_virtualized=False, enabled=True):
+ official=True, owner=None, enabled=True):
"""Create a new distroarchseries"""
if distroseries is None:
@@ -2724,8 +2728,7 @@
if architecturetag is None:
architecturetag = self.getUniqueString('arch')
return distroseries.newArch(
- architecturetag, processor, official, owner,
- supports_virtualized, enabled)
+ architecturetag, processor, official, owner, enabled)
def makeComponent(self, name=None):
"""Make a new `IComponent`."""
Follow ups