def UploadSymbols(self, buildroot, board): """Upload generated debug symbols.""" failed_name = 'failed_upload_symbols.list' failed_list = os.path.join(self.archive_path, failed_name) if self._run.options.remote_trybot or self._run.options.debug_forced: # For debug builds, limit ourselves to just uploading 1 symbol. # This way trybots and such still exercise this code. cnt = 1 official = False else: cnt = None official = self._run.config.chromeos_official upload_passed = True try: commands.UploadSymbols(buildroot, board, official, cnt, failed_list) except failures_lib.BuildScriptFailure: upload_passed = False if os.path.exists(failed_list): self.UploadArtifact(failed_name, archive=False) logging.notice('To upload the missing symbols from this build, run:') for url in self._GetUploadUrls(filename=failed_name): logging.notice('upload_symbols --failed-list %s %s', os.path.join(url, failed_name), os.path.join(url, 'debug_breakpad.tar.xz')) # Delay throwing the exception until after we uploaded the list. if not upload_passed: raise DebugSymbolsUploadException('Failed to upload all symbols.')
def testUploadSymbolsMinimal(self): """Test uploading symbols for official builds""" commands.UploadSymbols('/buildroot', 'MyBoard') self.assertCommandContains( ['/buildroot/chromite/bin/upload_symbols', '--yes', '--root', '/buildroot/chroot', '--board', 'MyBoard'])
def testUploadSymbolsMinimalNoneChromeOS(self): """Test uploading symbols for official builds""" commands.UploadSymbols( '/buildroot', breakpad_root='/breakpad', product_name='CoolProduct') self.assertCommandContains( ['/buildroot/chromite/bin/upload_symbols', '--yes', '--breakpad_root', '/breakpad', '--product_name', 'CoolProduct'])
def testUploadSymbolsMaximal(self): """Test uploading symbols for official builds""" commands.UploadSymbols( '/buildroot', 'MyBoard', official=True, cnt=55, failed_list='/failed_list.txt', breakpad_root='/breakpad', product_name='CoolProduct') self.assertCommandContains( ['/buildroot/chromite/bin/upload_symbols', '--yes', '--root', '/buildroot/chroot', '--board', 'MyBoard', '--official_build', '--upload-limit', '55', '--failed-list', '/failed_list.txt', '--breakpad_root', '/breakpad', '--product_name', 'CoolProduct'])
def UploadSymbols(self, buildroot, board, failed_list): """Upload generated debug symbols.""" if self._run.options.remote_trybot or self._run.debug: # For debug builds, limit ourselves to just uploading 1 symbol. # This way trybots and such still exercise this code. cnt = 1 official = False else: cnt = None official = self._run.config.chromeos_official commands.UploadSymbols(buildroot, board, official, cnt, failed_list) if os.path.exists(failed_list): self.UploadArtifact(os.path.basename(failed_list), archive=False)
def UploadSymbols(self, buildroot, board): """Upload generated debug symbols.""" failed_list = os.path.join(self.archive_path, 'failed_upload_symbols.list') if self._run.options.remote_trybot or self._run.debug: # For debug builds, limit ourselves to just uploading 1 symbol. # This way trybots and such still exercise this code. cnt = 1 official = False else: cnt = None official = self._run.config.chromeos_official try: commands.UploadSymbols(buildroot, board, official, cnt, failed_list) except failures_lib.BuildScriptFailure: raise DebugSymbolsUploadException('Failed to upload all symbols.') if os.path.exists(failed_list): self.UploadArtifact(os.path.basename(failed_list), archive=False)
def testFailedUploadSymbols(self): """Test when uploading fails""" self.rc.SetDefaultCmdResult(returncode=1, error='i am sad') # This should not throw an exception. commands.UploadSymbols(self.tempdir)