OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 3 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
4 # | 4 # |
5 # Use of this source code is governed by a BSD-style license | 5 # Use of this source code is governed by a BSD-style license |
6 # that can be found in the LICENSE file in the root of the source | 6 # that can be found in the LICENSE file in the root of the source |
7 # tree. An additional intellectual property rights grant can be found | 7 # tree. An additional intellectual property rights grant can be found |
8 # in the file PATENTS. All contributing project authors may | 8 # in the file PATENTS. All contributing project authors may |
9 # be found in the AUTHORS file in the root of the source tree. | 9 # be found in the AUTHORS file in the root of the source tree. |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 The exception is that --isolated-script-test-output and | 24 The exception is that --isolated-script-test-output and |
25 --isolated-script-test-chartson-output are expected to be after '--', so they | 25 --isolated-script-test-chartson-output are expected to be after '--', so they |
26 are processed and removed from there. | 26 are processed and removed from there. |
27 For example: | 27 For example: |
28 | 28 |
29 gtest-parallel-wrapper.py some_test \ | 29 gtest-parallel-wrapper.py some_test \ |
30 --some_flag=some_value \ | 30 --some_flag=some_value \ |
31 --another_flag \ | 31 --another_flag \ |
32 -- \ | 32 -- \ |
33 --isolated-script-test-output=some_dir \ | 33 --isolated-script-test-output=some_dir \ |
34 --isolated-script-test-chartjson-output=some_other_dir \ | 34 --isolated-script-test-perf-output=some_other_dir \ |
35 --foo=bar \ | 35 --foo=bar \ |
36 --baz | 36 --baz |
37 | 37 |
38 Will be converted into: | 38 Will be converted into: |
39 | 39 |
40 python gtest-parallel some_test \ | 40 python gtest-parallel some_test \ |
41 --shard_count 1 \ | 41 --shard_count 1 \ |
42 --shard_index 0 \ | 42 --shard_index 0 \ |
43 --some_flag=some_value \ | 43 --some_flag=some_value \ |
44 --another_flag \ | 44 --another_flag \ |
(...skipping 26 matching lines...) Expand all Loading... |
71 | 71 |
72 gtest_parallel_args = sys.argv[1:argv_index] | 72 gtest_parallel_args = sys.argv[1:argv_index] |
73 executable_args = sys.argv[argv_index + 1:] | 73 executable_args = sys.argv[argv_index + 1:] |
74 | 74 |
75 parser = argparse.ArgumentParser() | 75 parser = argparse.ArgumentParser() |
76 parser.add_argument('--isolated-script-test-output', type=str, default=None) | 76 parser.add_argument('--isolated-script-test-output', type=str, default=None) |
77 | 77 |
78 # We don't need to implement this flag, and possibly can't, since it's | 78 # We don't need to implement this flag, and possibly can't, since it's |
79 # intended for results of Telemetry tests. See | 79 # intended for results of Telemetry tests. See |
80 # https://chromium.googlesource.com/external/github.com/catapult-project/catap
ult/+/HEAD/dashboard/docs/data-format.md | 80 # https://chromium.googlesource.com/external/github.com/catapult-project/catap
ult/+/HEAD/dashboard/docs/data-format.md |
81 parser.add_argument('--isolated-script-test-chartjson-output', type=str, | 81 parser.add_argument('--isolated-script-test-perf-output', type=str, |
82 default=None) | 82 default=None) |
83 | 83 |
84 # No-sandbox is a Chromium-specific flag, ignore it. | 84 # No-sandbox is a Chromium-specific flag, ignore it. |
85 # TODO(oprypin): Remove (bugs.webrtc.org/8115) | 85 # TODO(oprypin): Remove (bugs.webrtc.org/8115) |
86 parser.add_argument('--no-sandbox', action='store_true', default=False) | 86 parser.add_argument('--no-sandbox', action='store_true', default=False) |
87 | 87 |
88 # We have to do this, since --isolated-script-test-output is passed as an | 88 # We have to do this, since --isolated-script-test-output is passed as an |
89 # argument to the executable by the swarming scripts, and we want to pass it | 89 # argument to the executable by the swarming scripts, and we want to pass it |
90 # to gtest-parallel instead. | 90 # to gtest-parallel instead. |
91 options, executable_args = parser.parse_known_args(executable_args) | 91 options, executable_args = parser.parse_known_args(executable_args) |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 logs = [os.path.join(logs_dir, log) for log in os.listdir(logs_dir)] | 149 logs = [os.path.join(logs_dir, log) for log in os.listdir(logs_dir)] |
150 log_file = os.path.join(output_dir, '%s-tests.log' % test_status) | 150 log_file = os.path.join(output_dir, '%s-tests.log' % test_status) |
151 CatFiles(logs, log_file) | 151 CatFiles(logs, log_file) |
152 os.rmdir(logs_dir) | 152 os.rmdir(logs_dir) |
153 | 153 |
154 return exit_code | 154 return exit_code |
155 | 155 |
156 | 156 |
157 if __name__ == '__main__': | 157 if __name__ == '__main__': |
158 sys.exit(main()) | 158 sys.exit(main()) |
OLD | NEW |