diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-10-24 23:13:30 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-10-28 23:41:40 +0300 |
commit | fc36772b068834435f0061f8b95ee95fedc374b5 (patch) | |
tree | b7905e9544114deec91e274004a0eceb44c8a679 /tests | |
parent | 731926e70e244d3943f8904b54b770c05cc6d490 (diff) |
Tests: minor updates to benchmark script for running on buildbot
* graph command accepts folder of json files as input
* reset command clears log files
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/performance/benchmark | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/performance/benchmark b/tests/performance/benchmark index a58c339e9f8..80556674dcc 100755 --- a/tests/performance/benchmark +++ b/tests/performance/benchmark @@ -4,6 +4,7 @@ import api import argparse import fnmatch +import glob import pathlib import shutil import sys @@ -228,6 +229,9 @@ def cmd_reset(env: api.TestEnvironment, argv: List): config.queue.write() + if args.test == '*': + shutil.rmtree(config.logs_dir) + def cmd_run(env: api.TestEnvironment, argv: List, update_only: bool): # Run tests. parser = argparse.ArgumentParser() @@ -274,7 +278,17 @@ def cmd_graph(argv: List): parser.add_argument('-o', '--output', type=str, required=True) args = parser.parse_args(argv) - graph = api.TestGraph([pathlib.Path(path) for path in args.json_file]) + # For directories, use all json files in the directory. + json_files = [] + for path in args.json_file: + path = pathlib.Path(path) + if path.is_dir(): + for filepath in glob.iglob(str(path / '*.json')): + json_files.append(pathlib.Path(filepath)) + else: + json_files.append(path) + + graph = api.TestGraph(json_files) graph.write(pathlib.Path(args.output)) def main(): |