blob: cfed268b3834db8c7b9a5788dbbe668557a41866 [file] [log] [blame]
# Copyright 2016 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.
# Recipe which runs the Skia infra tests.
DEPS = [
def RunSteps(api):
# Run the infra tests.
repo_name =['repository'].split('/')[-1]
if repo_name.endswith('.git'):
repo_name = repo_name[:-len('.git')]
repo_root = api.path['start_dir'].join(repo_name)
infra_tests = repo_root.join('infra', 'bots', '')
# Merge the default environment with the Go environment.
env = {}
for k, v in api.vars.default_env.iteritems():
# The PATH variable gets merged; all others get replaced.
if k == 'PATH':
# This works because the value for PATH in go_env and default_env includes
# the '%(PATH)s' placeholder.
env[k] = env[k] % {k: v}
env[k] = v
with api.context(cwd=repo_root, env=env):
# Some tests assume that they're being run inside a git repo.
api.step('git init', cmd=['git', 'init'])
api.step('git add .', cmd=['git', 'add', '.'])
api.step('git commit', cmd=['git', 'commit', '-a', '-m', 'initial commit'])
# Unfortunately, the recipe tests are flaky due to file removal on Windows.
# Run multiple attempts.
last_exc = None
for _ in range(3):
api.step('infra_tests', cmd=['python', '-u', infra_tests])
except api.step.StepFailure as e: # pragma: nocover
last_exc = e
else: # pragma: nocover
raise last_exc
def GenTests(api):
yield (
api.test('infra_tests') +'Housekeeper-PerCommit-InfraTests_Win',