Index: infra/bots/recipe_modules/flavor/coverage_flavor.py |
diff --git a/infra/bots/recipe_modules/skia/coverage_flavor.py b/infra/bots/recipe_modules/flavor/coverage_flavor.py |
similarity index 62% |
rename from infra/bots/recipe_modules/skia/coverage_flavor.py |
rename to infra/bots/recipe_modules/flavor/coverage_flavor.py |
index 5fd853363dc1616f8c2f55c48bfd8b465757f0ff..a3bb5828ce847ddfe5cbf8283fb4a329950663a3 100644 |
--- a/infra/bots/recipe_modules/skia/coverage_flavor.py |
+++ b/infra/bots/recipe_modules/flavor/coverage_flavor.py |
@@ -6,7 +6,6 @@ |
import datetime |
import default_flavor |
import posixpath |
-import ssh_devices |
"""Utils for running coverage tests.""" |
@@ -17,12 +16,12 @@ class CoverageFlavorUtils(default_flavor.DefaultFlavorUtils): |
def step(self, name, cmd, **kwargs): |
"""Run the given step through coverage.""" |
compile_target = 'dm' |
- build_cmd = [self._skia_api.skia_dir.join('tools', 'llvm_coverage_build'), |
+ build_cmd = [self.m.vars.skia_dir.join('tools', 'llvm_coverage_build'), |
compile_target] |
- self._skia_api.run(self._skia_api.m.step, |
- 'build %s' % compile_target, |
- cmd=build_cmd, |
- cwd=self._skia_api.m.path['checkout']) |
+ self.m.run(self.m.step, |
+ 'build %s' % compile_target, |
+ cmd=build_cmd, |
+ cwd=self.m.path['checkout']) |
# Slice out the 'key' and 'properties' arguments to be reused. |
key = [] |
@@ -38,39 +37,39 @@ class CoverageFlavorUtils(default_flavor.DefaultFlavorUtils): |
if current is not None: |
current.append(cmd[i]) |
- results_dir = self._skia_api.skia_out.join('coverage_results') |
+ results_dir = self.m.vars.skia_out.join('coverage_results') |
self.create_clean_host_dir(results_dir) |
# Run DM under coverage. |
- report_file_basename = '%s.cov' % self._skia_api.got_revision |
+ report_file_basename = '%s.cov' % self.m.vars.got_revision |
report_file = results_dir.join(report_file_basename) |
args = [ |
'python', |
- self._skia_api.skia_dir.join('tools', 'llvm_coverage_run.py'), |
+ self.m.vars.skia_dir.join('tools', 'llvm_coverage_run.py'), |
] + cmd + ['--outResultsFile', report_file] |
- self._skia_api.run(self._skia_api.m.step, name=name, cmd=args, |
- cwd=self._skia_api.m.path['checkout'], **kwargs) |
+ self.m.run(self.m.step, name=name, cmd=args, |
+ cwd=self.m.path['checkout'], **kwargs) |
# Generate nanobench-style JSON output from the coverage report. |
nanobench_json = results_dir.join('nanobench_%s.json' % ( |
- self._skia_api.got_revision)) |
+ self.m.vars.got_revision)) |
line_by_line_basename = ('coverage_by_line_%s.json' % ( |
- self._skia_api.got_revision)) |
+ self.m.vars.got_revision)) |
line_by_line = results_dir.join(line_by_line_basename) |
args = [ |
'python', |
- self._skia_api.skia_dir.join('tools', 'parse_llvm_coverage.py'), |
+ self.m.vars.skia_dir.join('tools', 'parse_llvm_coverage.py'), |
'--report', report_file, '--nanobench', nanobench_json, |
'--linebyline', line_by_line] |
args.extend(key) |
args.extend(properties) |
- self._skia_api.run( |
- self._skia_api.m.step, |
+ self.m.run( |
+ self.m.step, |
'Generate Coverage Data', |
- cmd=args, cwd=self._skia_api.m.path['checkout']) |
+ cmd=args, cwd=self.m.path['checkout']) |
# Copy files from results_dir into swarming_out_dir. |
- for r in self._skia_api.m.file.listdir('results_dir', results_dir): |
- self._skia_api.m.file.copy( |
+ for r in self.m.file.listdir('results_dir', results_dir): |
+ self.m.file.copy( |
'Copy to swarming out', results_dir.join(r), |
- self._skia_api.swarming_out_dir) |
+ self.m.vars.swarming_out_dir) |