launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #24349
[Merge] ~twom/launchpad:snap-build-behaviour-repositories into launchpad:master
Tom Wardill has proposed merging ~twom/launchpad:snap-build-behaviour-repositories into launchpad:master.
Commit message:
Test for the presence of Universe components.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~twom/launchpad/+git/launchpad/+merge/379495
The existing test did not check for the presence of the correct components in the archive.
Add some setup to ensure that they should exist, and then check that we get the none-default (universe) that was added.
Added to all tests that check for expected archive lists.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~twom/launchpad:snap-build-behaviour-repositories into launchpad:master.
diff --git a/lib/lp/snappy/tests/test_snapbuildbehaviour.py b/lib/lp/snappy/tests/test_snapbuildbehaviour.py
index b397bba..aa32d4c 100644
--- a/lib/lp/snappy/tests/test_snapbuildbehaviour.py
+++ b/lib/lp/snappy/tests/test_snapbuildbehaviour.py
@@ -100,6 +100,7 @@ from lp.soyuz.adapters.archivedependencies import (
)
from lp.soyuz.enums import PackagePublishingStatus
from lp.soyuz.interfaces.archive import ArchiveDisabled
+from lp.soyuz.interfaces.component import IComponentSet
from lp.soyuz.tests.soyuz import Base64KeyMatches
from lp.testing import (
TestCase,
@@ -241,6 +242,12 @@ class TestSnapBuildBehaviourBase(TestCaseWithFactory):
distroarchseries = self.factory.makeDistroArchSeries(
distroseries=distroseries, architecturetag="i386",
processor=processor)
+
+ # Taken from test_archivedependencies.py
+ for component_name in ["main", "universe"]:
+ component = getUtility(IComponentSet)[component_name]
+ self.factory.makeComponentSelection(distroseries, component)
+
build = self.factory.makeSnapBuild(
archive=archive, distroarchseries=distroarchseries, pocket=pocket,
name="test-snap", **kwargs)
@@ -446,6 +453,8 @@ class TestAsyncSnapBuildBehaviour(TestSnapBuildBehaviourBase):
expected_archives, expected_trusted_keys = (
yield get_sources_list_for_building(
job.build, job.build.distro_arch_series, None))
+ for archive_line in expected_archives:
+ self.assertIn('universe', archive_line)
with dbuser(config.builddmaster.dbuser):
args = yield job.extraBuildArgs()
self.assertThat(args, MatchesDict({
@@ -484,6 +493,8 @@ class TestAsyncSnapBuildBehaviour(TestSnapBuildBehaviourBase):
expected_archives, expected_trusted_keys = (
yield get_sources_list_for_building(
job.build, job.build.distro_arch_series, None))
+ for archive_line in expected_archives:
+ self.assertIn('universe', archive_line)
with dbuser(config.builddmaster.dbuser):
args = yield job.extraBuildArgs()
self.assertThat(args, MatchesDict({
@@ -513,6 +524,8 @@ class TestAsyncSnapBuildBehaviour(TestSnapBuildBehaviourBase):
expected_archives, expected_trusted_keys = (
yield get_sources_list_for_building(
job.build, job.build.distro_arch_series, None))
+ for archive_line in expected_archives:
+ self.assertIn('universe', archive_line)
with dbuser(config.builddmaster.dbuser):
args = yield job.extraBuildArgs()
self.assertThat(args, MatchesDict({
@@ -545,6 +558,8 @@ class TestAsyncSnapBuildBehaviour(TestSnapBuildBehaviourBase):
expected_archives, expected_trusted_keys = (
yield get_sources_list_for_building(
job.build, job.build.distro_arch_series, None))
+ for archive_line in expected_archives:
+ self.assertIn('universe', archive_line)
args = yield job.extraBuildArgs()
split_browse_root = urlsplit(config.codehosting.git_browse_root)
self.assertThat(args, MatchesDict({
@@ -587,6 +602,8 @@ class TestAsyncSnapBuildBehaviour(TestSnapBuildBehaviourBase):
expected_archives, expected_trusted_keys = (
yield get_sources_list_for_building(
job.build, job.build.distro_arch_series, None))
+ for archive_line in expected_archives:
+ self.assertIn('universe', archive_line)
with dbuser(config.builddmaster.dbuser):
args = yield job.extraBuildArgs()
self.assertThat(args, MatchesDict({
@@ -616,6 +633,8 @@ class TestAsyncSnapBuildBehaviour(TestSnapBuildBehaviourBase):
expected_archives, expected_trusted_keys = (
yield get_sources_list_for_building(
job.build, job.build.distro_arch_series, None))
+ for archive_line in expected_archives:
+ self.assertIn('universe', archive_line)
with dbuser(config.builddmaster.dbuser):
args = yield job.extraBuildArgs()
self.assertThat(args, MatchesDict({