| Index: testing/scripts/run_telemetry_as_googletest.py
|
| diff --git a/testing/scripts/run_telemetry_as_googletest.py b/testing/scripts/run_telemetry_as_googletest.py
|
| index 8a4cd63dd90223c96cd13c153dd02ef47bf3de5c..f7bdcc00c0880554c17ba6de8a7383af11ec8065 100755
|
| --- a/testing/scripts/run_telemetry_as_googletest.py
|
| +++ b/testing/scripts/run_telemetry_as_googletest.py
|
| @@ -47,9 +47,24 @@ def main():
|
| xvfb_proc, openbox_proc, xcompmgr_proc = xvfb.start_xvfb(env=env,
|
| build_dir='.')
|
| assert xvfb_proc and openbox_proc and xcompmgr_proc, 'Failed to start xvfb'
|
| + # Compatibility with gtest-based sharding.
|
| + total_shards = None
|
| + shard_index = None
|
| + if 'GTEST_TOTAL_SHARDS' in env:
|
| + total_shards = int(env['GTEST_TOTAL_SHARDS'])
|
| + del env['GTEST_TOTAL_SHARDS']
|
| + if 'GTEST_SHARD_INDEX' in env:
|
| + shard_index = int(env['GTEST_SHARD_INDEX'])
|
| + del env['GTEST_SHARD_INDEX']
|
| + sharding_args = []
|
| + if total_shards is not None and shard_index is not None:
|
| + sharding_args = [
|
| + '--total-shards=%d' % total_shards,
|
| + '--shard-index=%d' % shard_index
|
| + ]
|
| try:
|
| with common.temporary_file() as tempfile_path:
|
| - rc = common.run_command([sys.executable] + rest_args + [
|
| + rc = common.run_command([sys.executable] + rest_args + sharding_args + [
|
| '--write-full-results-to', tempfile_path,
|
| ], env=env)
|
| with open(tempfile_path) as f:
|
|
|