launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #30859
Re: [Merge] ~pelpsi/launchpad-buildd:snap-components-support into launchpad-buildd:master
i think having a realistic filename will help tracing & finding this with `git grep` later
Diff comments:
> diff --git a/lpbuildd/tests/test_snap.py b/lpbuildd/tests/test_snap.py
> index 0e44093..42834a3 100644
> --- a/lpbuildd/tests/test_snap.py
> +++ b/lpbuildd/tests/test_snap.py
> @@ -255,6 +255,78 @@ class TestSnapBuildManagerIteration(TestCase):
> self.assertFalse(self.builder.wasCalled("buildFail"))
>
> @defer.inlineCallbacks
> + def test_iterate_with_components(self):
> + # The build manager iterates a build that uploads components from
> + # start to finish.
> + args = {
> + "git_repository": "https://git.launchpad.dev/~example/+git/snap",
> + "git_path": "master",
> + }
> + expected_options = [
> + "--git-repository",
> + "https://git.launchpad.dev/~example/+git/snap",
> + "--git-path",
> + "master",
> + ]
> + yield self.startBuild(args, expected_options)
> +
> + log_path = os.path.join(self.buildmanager._cachepath, "buildlog")
> + with open(log_path, "w") as log:
> + log.write("I am a build log.")
> +
> + self.buildmanager.backend.add_file(
> + "/build/test-snap/test-snap_0_all.snap", b"I am a snap package."
> + )
> + self.buildmanager.backend.add_file(
> + "/build/test-snap/test-snap_0_all.comp", b"I am a component."
Not a realistic component name.
Please use "test-snap+somecomponent_0.comp"
> + )
> +
> + # After building the package, reap processes.
> + yield self.buildmanager.iterate(0)
> + expected_command = [
> + "sharepath/bin/in-target",
> + "in-target",
> + "scan-for-processes",
> + "--backend=lxd",
> + "--series=xenial",
> + "--arch=i386",
> + self.buildid,
> + ]
> + self.assertEqual(SnapBuildState.BUILD_SNAP, self.getState())
> + self.assertEqual(expected_command, self.buildmanager.commands[-1])
> + self.assertNotEqual(
> + self.buildmanager.iterate, self.buildmanager.iterators[-1]
> + )
> + self.assertFalse(self.builder.wasCalled("buildFail"))
> + self.assertThat(
> + self.builder,
> + HasWaitingFiles.byEquality(
> + {
> + "test-snap_0_all.comp": b"I am a component.",
> + "test-snap_0_all.snap": b"I am a snap package.",
> + }
> + ),
> + )
> +
> + # Control returns to the DebianBuildManager in the UMOUNT state.
> + self.buildmanager.iterateReap(self.getState(), 0)
> + expected_command = [
> + "sharepath/bin/in-target",
> + "in-target",
> + "umount-chroot",
> + "--backend=lxd",
> + "--series=xenial",
> + "--arch=i386",
> + self.buildid,
> + ]
> + self.assertEqual(SnapBuildState.UMOUNT, self.getState())
> + self.assertEqual(expected_command, self.buildmanager.commands[-1])
> + self.assertEqual(
> + self.buildmanager.iterate, self.buildmanager.iterators[-1]
> + )
> + self.assertFalse(self.builder.wasCalled("buildFail"))
> +
> + @defer.inlineCallbacks
> def test_iterate_with_debug(self):
> # The build manager iterates a build that uploads debug symbols from
> # start to finish.
--
https://code.launchpad.net/~pelpsi/launchpad-buildd/+git/launchpad-buildd/+merge/459807
Your team Launchpad code reviewers is requested to review the proposed merge of ~pelpsi/launchpad-buildd:snap-components-support into launchpad-buildd:master.
References