api: toolchain: Handle profile_info arch
Also add a check for non empty "arch" in profile_info.
BUG=b:246457583
TEST=cq,http://ci.chromium.org/b/8789202207026755521
Change-Id: I6ff797628b41c0878046b40f581503c2e58c761a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4248401
Tested-by: Denis Nikitin <denik@chromium.org>
Reviewed-by: Chris Gerber <gerb@google.com>
Commit-Queue: Denis Nikitin <denik@chromium.org>
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
diff --git a/api/controller/toolchain_unittest.py b/api/controller/toolchain_unittest.py
index 17dc677..8ab8c3d 100644
--- a/api/controller/toolchain_unittest.py
+++ b/api/controller/toolchain_unittest.py
@@ -150,7 +150,8 @@
),
],
profile_info=common_pb2.ArtifactProfileInfo(
- chrome_cwp_profile="CWPVERSION"
+ chrome_cwp_profile="CWPVERSION",
+ arch="amd64",
),
)
# pylint: enable=line-too-long
@@ -167,7 +168,10 @@
"gs://path3",
],
},
- {"chrome_cwp_profile": "CWPVERSION"},
+ {
+ "chrome_cwp_profile": "CWPVERSION",
+ "arch": "amd64",
+ },
)
def testPassesProfileInfoAfdoRelease(self):
@@ -190,8 +194,10 @@
],
profile_info=common_pb2.ArtifactProfileInfo(
afdo_release=common_pb2.AfdoRelease(
- chrome_cwp_profile="CWPVERSION", image_build_id=1234
- )
+ chrome_cwp_profile="CWPVERSION",
+ image_build_id=1234,
+ ),
+ arch="amd64",
),
)
# pylint: enable=line-too-long
@@ -208,7 +214,11 @@
"gs://path3",
],
},
- {"chrome_cwp_profile": "CWPVERSION", "image_build_id": 1234},
+ {
+ "chrome_cwp_profile": "CWPVERSION",
+ "image_build_id": 1234,
+ "arch": "amd64",
+ },
)
def testHandlesDuplicateInputArtifacts(self):
@@ -335,7 +345,9 @@
def setUp(self):
self.response = toolchain_pb2.GetUpdatedFilesResponse()
self.artifact_path = "/any/path/to/metadata"
- self.profile_info = common_pb2.ArtifactProfileInfo(kernel_version="4.4")
+ self.profile_info = common_pb2.ArtifactProfileInfo(
+ kernel_version="4.4", arch="amd64"
+ )
self.update = self.PatchObject(
toolchain_util, "GetUpdatedFiles", return_value=([], "")
)