def BuildRelease(self, target): clnum_path = os.path.join('$JOB_TMP', self.CHECKOUT_DIR, 'CLNUM') toolchain_root = os.path.join('/google/data/rw/projects/toolchains', target, 'unstable') toolchain_path = os.path.join(toolchain_root, '${CLNUM}') build_toolchain = cmd.Wrapper( cmd.Chain( cmd.MakeDir(toolchain_path), cmd.Shell('buildit', '--keep-work-dir', '--build-type=release', '--work-dir=%s' % self.buildit_work_dir_path, '--results-dir=%s' % toolchain_path, '--force-release=%s' % '${CLNUM}', target, path='.')), cwd=self.buildit_path, umask='0022', env={'CLNUM': '$(< %s)' % clnum_path}) # remove all but 10 most recent directories remove_old_toolchains_from_x20 = cmd.Wrapper( cmd.Pipe( cmd.Shell('ls', '-1', '-r'), cmd.Shell('sed', '-e', '1,10d'), cmd.Shell('xargs', 'rm', '-r', '-f')), cwd=toolchain_root) return cmd.Chain(build_toolchain, remove_old_toolchains_from_x20)
def AddBuildbotConfig(self, config_name, config_list): config_header = 'add_config(%r, [%s])' % (config_name, ', '.join(config_list)) config_file = os.path.join(self.CHROMEOS_ROOT, 'chromite/cbuildbot/cbuildbot_config.py') quoted_config_header = '%r' % config_header quoted_config_header = re.sub("'", "\\\"", quoted_config_header) return cmd.Pipe( cmd.Shell('echo', quoted_config_header), cmd.Shell('tee', '--append', config_file))
def Buildbot(self, config_name): buildbot = os.path.join(self._chromeos_root, 'chromite/cbuildbot/cbuildbot.py') return cmd.Shell(buildbot, '--buildroot=%s' % self._chromeos_root, '--resume', '--noarchive', '--noprebuilts', '--nosync', '--nouprev', '--notests', '--noclean', config_name)
def RunTests(self, target, board, component='gcc'): dejagnu_flags = ['--outdir=%s' % self.dejagnu_output_path, '--target_board=%s' % board] # Look for {pandaboard,qemu}.exp files in # //depot/google3/experimental/users/kbaclawski/dejagnu/boards site_exp_file = os.path.join('/google/src/head/depot/google3', 'experimental/users/kbaclawski', 'dejagnu/site.exp') build_dir_path = os.path.join(target, 'rpmbuild/BUILD/crosstool*-0.0', 'build-%s' % component) run_dejagnu = cmd.Wrapper( cmd.Chain( cmd.MakeDir(self.dejagnu_output_path), cmd.Shell('make', 'check', '-k', '-j $(grep -c processor /proc/cpuinfo)', 'RUNTESTFLAGS="%s"' % ' '.join(dejagnu_flags), 'DEJAGNU="%s"' % site_exp_file, ignore_error=True)), cwd=os.path.join(self.buildit_work_dir_path, build_dir_path), env={'REMOTE_TMPDIR': 'job-$JOB_ID'}) save_results = cmd.Copy(self.dejagnu_output_path, to_dir='$JOB_TMP/results', recursive=True) return cmd.Chain(run_dejagnu, save_results)
def SetupChromeOS(self, version='latest', use_minilayout=False): setup_chromeos = cmd.Shell('setup_chromeos.py', '--public', '--dir=%s' % self._chromeos_root, '--version=%s' % version, path=self._scripts_path) if use_minilayout: setup_chromeos.AddOption('--minilayout') return setup_chromeos
def RunBenchmarks(self, board, tests): image_path = os.path.join(self._chromeos_root, 'src/build/images', board, 'latest/chromiumos_image.bin') return cmd.Shell('cros_run_benchmarks.py', '--remote=$SECONDARY_MACHINES[0]', '--board=%s' % board, '--tests=%s' % tests, '--full_table', image_path, path='/home/mobiletc-prebuild')
def CreateJobGroup(self): chain = cmd.Chain( self.CheckoutV14Dir(), cmd.Shell('python', os.path.join(self.P4_VERSION_DIR, 'test_gcc_dejagnu.py'), '--board=%s' % self._board, '--remote=%s' % self._remote, '--cleanup=%s' % self._cleanup)) label = 'dejagnu' job = jobs.CreateLinuxJob(label, chain, timeout=8 * 60 * 60) return job_group.JobGroup(label, [job], cleanup_on_failure=True, cleanup_on_completion=True)
def GenerateReport(self, boards): sumfiles = [os.path.join('$JOB_TMP', board, '*.sum') for board in boards] return cmd.Wrapper( cmd.Shell('dejagnu.sh', 'report', '-m', '$JOB_TMP/manifests/*.xfail', '-o', '$JOB_TMP/results/report.html', *sumfiles, path='.'), cwd='$HOME/automation/clients/report')
def CreateJobGroup(self): chain = cmd.Chain( self.CheckoutV14Dir(), cmd.Shell( 'python', os.path.join(self.P4_VERSION_DIR, 'test_toolchains.py'), '--force-mismatch', '--clean', '--public', # crbug.com/145822 '--board=%s' % self._board, '--remote=%s' % self._remote, '--githashes=%s' % self._gcc_githash)) label = 'testlabel' job = jobs.CreateLinuxJob(label, chain, timeout=24 * 60 * 60) return job_group.JobGroup(label, [job], True, False)
def SummarizeResults(self, logs_path): return cmd.Shell('summarize_results.py', logs_path, path=self._scripts_path)