Add ability to ignore errors during breakpad symbol generation
Implement the fields added in
https://chromium-review.googlesource.com/c/chromiumos/infra/proto/+/4507337
in the service API.
BUG=b:270240549,b:241470012
TEST=Confirmed `cros_generate_breakpad_symbols --board=tatl` gets error
about missing ASH_CHROME, but `cros_generate_breakpad_symbols
--board=tatl --ignore_expected_file=ASH_CHROME` does not.
TEST=Commented out most of EXPECTED_POOR_SYMBOLIZATION_FILES. Confirmed
`cros_generate_breakpad_symbols --board=eve` generated errors but
`cros_generate_breakpad_symbols --board=eve --ignore_errors` did not.
TEST=CQ
Change-Id: I54af6b043b00866358277b1981bf5e05992915e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4529455
Reviewed-by: Alex Klein <saklein@chromium.org>
Commit-Queue: Ian Barkley-Yeung <iby@chromium.org>
Tested-by: Ian Barkley-Yeung <iby@chromium.org>
diff --git a/api/controller/sysroot_unittest.py b/api/controller/sysroot_unittest.py
index 2ce8f89..69836b5 100644
--- a/api/controller/sysroot_unittest.py
+++ b/api/controller/sysroot_unittest.py
@@ -281,6 +281,56 @@
self.assertEqual(data["failure_reason"], "foo bar")
self.assertTrue(found_artifact)
+ def testArtifactsBreakpadDebugSymbols(self):
+ """Tests the extra parameters to BundleBreakpadSymbols"""
+ proto = common_pb2.ArtifactsByService.Sysroot(
+ output_artifacts=[
+ common_pb2.ArtifactsByService.Sysroot.ArtifactInfo(
+ artifact_types=[
+ # pylint: disable=line-too-long
+ common_pb2.ArtifactsByService.Sysroot.ArtifactType.BREAKPAD_DEBUG_SYMBOLS
+ # pylint: enable=line-too-long
+ ]
+ )
+ ],
+ ignore_breakpad_symbol_generation_errors=True,
+ ignore_breakpad_symbol_generation_expected_files=[
+ # pylint: disable=line-too-long
+ common_pb2.ArtifactsByService.Sysroot.BreakpadSymbolGenerationExpectedFile.EXPECTED_FILE_LIBC,
+ common_pb2.ArtifactsByService.Sysroot.BreakpadSymbolGenerationExpectedFile.EXPECTED_FILE_CRASH_REPORTER,
+ # pylint: enable=line-too-long
+ ],
+ )
+ sysroot_controller.GetArtifacts(
+ proto, None, None, "build_target", "out"
+ )
+ self._mocks[
+ # pylint: disable=line-too-long
+ common_pb2.ArtifactsByService.Sysroot.ArtifactType.BREAKPAD_DEBUG_SYMBOLS
+ # pylint: enable=line-too-long
+ ].assert_called_once_with(
+ None,
+ None,
+ "build_target",
+ "out",
+ True,
+ ["LIBC", "CRASH_REPORTER"],
+ )
+
+ def testArtifactsExpectedFileNames(self):
+ """Verify all BreakpadSymbolGenerationExpectedFile have valid names.
+
+ _BundleBreakpadSymbols inside GetArtifacts assumes that all values of
+ the BreakpadSymbolGenerationExpectedFile enum are named starting with
+ EXPECTED_FILE_. Confirm that assumption.
+ """
+ for enum in (
+ # pylint: disable=line-too-long
+ common_pb2.ArtifactsByService.Sysroot.BreakpadSymbolGenerationExpectedFile.keys()
+ # pylint: enable=line-too-long
+ ):
+ self.assertTrue(enum.startswith("EXPECTED_FILE_"))
+
class GenerateArchiveTest(
cros_test_lib.MockTempDirTestCase, api_config.ApiConfigMixin