skia2/infra/bots/recipe_modules/isolate/test_api.py
Eric Boren f94514b0ff [recipes] Copy file, isolate, swarming, swarming_client from build.git
Rename swarming -> skia_swarming.
Some required heavy modification to remove other dependencies on modules
in build.git.

Expected changes:

- RECIPE_MODULE[build::<module>] -> RECIPE_MODULE[skia::<module>]
- No more runit; directly run through Python.

Bug: skia:6628
Change-Id: I1b1370ed387966222ce10731771dbde9020cf542
Reviewed-on: https://skia-review.googlesource.com/17448
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
2017-05-22 13:08:25 +00:00

31 lines
1.2 KiB
Python

# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# TODO(borenet): This module was copied from build.git and heavily modified to
# remove dependencies on other modules in build.git. It belongs in a different
# repo. Remove this once it has been moved.
from recipe_engine import recipe_test_api
class IsolateTestApi(recipe_test_api.RecipeTestApi):
def output_json(self, targets=None, missing=None):
"""Mocked output of 'find_isolated_tests' and 'isolate_tests' steps.
Deterministically synthesizes json.output test data for the given targets.
If |targets| is None, will emit test data with some dummy targets instead,
emulating find_isolated_tests.py finding some files.
If |missing| is given it's a subset of |targets| that wasn't isolated in
'isolate_tests' due to some error.
"""
missing = missing or ()
if targets is None:
targets = ['dummy_target_1', 'dummy_target_2']
return self.m.json.output({
target: None if target in missing else '[dummy hash for %s]' % target
for target in targets
})