2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 """Wrapper for runtest.py, makes it possible to control src-side
7 which file gets used and test the changes on trybots before landing."""
17 SRC_DIR
= os
.path
.dirname(os
.path
.dirname(os
.path
.dirname(__file__
)))
21 parser
= argparse
.ArgumentParser()
22 # TODO(phajdan.jr): Remove after cleaning up build repo side.
24 '--path-build', help='Path to the build repo')
25 parser
.add_argument('args', nargs
='*', help='Arguments to pass to runtest.py')
26 args
= parser
.parse_args(argv
)
28 env
= copy
.copy(os
.environ
)
29 # Reset PYTHONPATH to make sure we're not accidentally using
30 # the buildbot-provided value and build-side modules. That would make
31 # changes inside this directory not take effect on buildbot.
33 pythonpath
.append(os
.path
.join(
34 SRC_DIR
, 'infra', 'scripts', 'legacy', 'scripts'))
35 pythonpath
.append(os
.path
.join(
36 SRC_DIR
, 'infra', 'scripts', 'legacy', 'site_config'))
37 pythonpath
.append(os
.path
.join(
38 SRC_DIR
, 'third_party'))
39 env
['PYTHONPATH'] = os
.pathsep
.join(pythonpath
)
41 return subprocess
.call([
43 os
.path
.join(SRC_DIR
, 'infra', 'scripts', 'legacy',
44 'scripts', 'slave', 'runtest.py')
45 ] + args
.args
, env
=env
)
48 if __name__
== '__main__':
49 sys
.exit(main(sys
.argv
[1:]))