← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~pappacena/launchpad:oci-build-metadata-teams into launchpad:master

 

Thiago F. Pappacena has proposed merging ~pappacena/launchpad:oci-build-metadata-teams into launchpad:master.

Commit message:
Adding test to make sure team owned OCI recipe builds will not break the metadata generation

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/392713
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~pappacena/launchpad:oci-build-metadata-teams into launchpad:master.
diff --git a/lib/lp/oci/tests/test_ocirecipebuildbehaviour.py b/lib/lp/oci/tests/test_ocirecipebuildbehaviour.py
index 2297d6e..5f54969 100644
--- a/lib/lp/oci/tests/test_ocirecipebuildbehaviour.py
+++ b/lib/lp/oci/tests/test_ocirecipebuildbehaviour.py
@@ -329,6 +329,29 @@ class TestAsyncOCIRecipeBuildBehaviour(
             }),
         }))
 
+    def test_getBuildInfoArgs_from_teams(self):
+        team = self.factory.makeTeam()
+        oci_project = self.factory.makeOCIProject(registrant=team)
+        recipe = self.makeRecipe(
+            processor_names=["amd64"],
+            oci_project=oci_project, registrant=team, owner=team)
+        build_request = self.makeBuildRequest(recipe, recipe.owner)
+        build = build_request.builds[0]
+        job = self.makeJob(build=build)
+
+        self.assertThat(job._getBuildInfoArgs(), MatchesDict({
+            "architectures": Equals(["amd64"]),
+            "recipe_owner": Equals({"name": recipe.owner.name, "email": None}),
+            "build_request_id": Equals(build_request.id),
+            "build_requester": Equals({
+                "name": build.requester.name, "email": None}),
+            "build_request_timestamp": Equals(
+                build_request.date_requested.isoformat()),
+            "build_urls": MatchesDict({
+                "amd64": Equals(canonical_url(build_request.builds[0]))
+            }),
+        }))
+
     def test_getBuildInfoArgs_without_build_request(self):
         recipe = self.makeRecipe(processor_names=["amd64"])
         distro_arch_series = removeSecurityProxy(