api: Stop populating repeated PackageInfo field
In preparation for deprecating and reserving the old repeated
PackageInfo field which only contained the names of the failed packages,
we want to stop populating and referencing the field. Recipes no longer
references this field for retrieving and displaying the names of failed
packages, so it is safe to stop populating the field in response protos.
BUG=b:204816060
TEST=./run_tests
Change-Id: Id73ee535d07f662fbf8582f342258579ed4284c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/3631025
Auto-Submit: Lizzy Presland <zland@google.com>
Reviewed-by: Ram Chandrasekar <rchandrasekar@google.com>
Tested-by: Lizzy Presland <zland@google.com>
Commit-Queue: Lizzy Presland <zland@google.com>
diff --git a/api/controller/sysroot_unittest.py b/api/controller/sysroot_unittest.py
index a2608d0..2bfcdfd 100644
--- a/api/controller/sysroot_unittest.py
+++ b/api/controller/sysroot_unittest.py
@@ -323,7 +323,7 @@
patch.assert_not_called()
self.assertEqual(controller.RETURN_CODE_UNSUCCESSFUL_RESPONSE_AVAILABLE, rc)
- self.assertTrue(response.failed_packages)
+ self.assertTrue(response.failed_package_data)
def testArgumentValidation(self):
"""Test the argument validation."""
@@ -360,7 +360,7 @@
rc = sysroot_controller.InstallToolchain(in_proto, out_proto,
self.api_config)
self.assertFalse(rc)
- self.assertFalse(out_proto.failed_packages)
+ self.assertFalse(out_proto.failed_package_data)
def testErrorOutputHandling(self):
@@ -390,7 +390,6 @@
rc = sysroot_controller.InstallToolchain(in_proto, out_proto,
self.api_config)
self.assertEqual(controller.RETURN_CODE_UNSUCCESSFUL_RESPONSE_AVAILABLE, rc)
- self.assertTrue(out_proto.failed_packages)
self.assertTrue(out_proto.failed_package_data)
# This needs to return 2 to indicate the available error response.
self.assertEqual(controller.RETURN_CODE_UNSUCCESSFUL_RESPONSE_AVAILABLE, rc)
@@ -400,11 +399,6 @@
self.assertIn(cat_pkg, expected)
self.assertEqual(data.log_path.path, new_logs[package.cpvr])
- # TODO(b/206514844): remove when field is deleted
- for package in out_proto.failed_packages:
- cat_pkg = (package.category, package.package_name)
- self.assertIn(cat_pkg, expected)
-
class InstallPackagesTest(cros_test_lib.MockTempDirTestCase,
api_config.ApiConfigMixin):
@@ -530,7 +524,7 @@
patch.assert_not_called()
self.assertEqual(controller.RETURN_CODE_UNSUCCESSFUL_RESPONSE_AVAILABLE, rc)
- self.assertTrue(response.failed_packages)
+ self.assertTrue(response.failed_package_data)
def testArgumentValidationAllMissing(self):
"""Test missing all arguments."""
@@ -585,7 +579,7 @@
rc = sysroot_controller.InstallPackages(in_proto, out_proto,
self.api_config)
self.assertFalse(rc)
- self.assertFalse(out_proto.failed_packages)
+ self.assertFalse(out_proto.failed_package_data)
def testSuccessPackageIndexes(self):
"""Test successful call with package_indexes."""
@@ -651,7 +645,7 @@
rc = sysroot_controller.InstallPackages(in_proto, out_proto,
self.api_config)
self.assertFalse(rc)
- self.assertFalse(out_proto.failed_packages)
+ self.assertFalse(out_proto.failed_package_data)
self.assertCountEqual(out_proto.goma_artifacts.log_files, [
'compiler_proxy-subproc.host.log.INFO.20180921-120100.000000.gz',
'compiler_proxy.host.log.INFO.20180921-120000.000000.gz',
@@ -688,7 +682,7 @@
rc = sysroot_controller.InstallPackages(in_proto, out_proto,
self.api_config)
self.assertFalse(rc)
- self.assertFalse(out_proto.failed_packages)
+ self.assertFalse(out_proto.failed_package_data)
self.assertCountEqual(out_proto.goma_artifacts.log_files, [
'compiler_proxy-subproc.host.log.INFO.20180921-120100.000000.gz',
'compiler_proxy.host.log.INFO.20180921-120000.000000.gz',
@@ -735,7 +729,7 @@
rc = sysroot_controller.InstallPackages(in_proto, out_proto,
self.api_config)
self.assertFalse(rc)
- self.assertFalse(out_proto.failed_packages)
+ self.assertFalse(out_proto.failed_package_data)
self.assertCountEqual(out_proto.goma_artifacts.log_files, [
'compiler_proxy-subproc.host.log.INFO.20180921-120100.000000.gz',
'compiler_proxy.host.log.INFO.20180921-120000.000000.gz',
@@ -782,11 +776,6 @@
self.assertIn(cat_pkg, expected)
self.assertEqual(data.log_path.path, new_logs[package.cpvr])
- # TODO(b/206514844): remove when field is deleted
- for package in out_proto.failed_packages:
- cat_pkg = (package.category, package.package_name)
- self.assertIn(cat_pkg, expected)
-
def testNoPackageFailureOutputHandling(self):
"""Test failure handling without packages to report."""
# Prevent argument validation error.