diff options
| -rw-r--r-- | scripts/lib/resulttool/store.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/scripts/lib/resulttool/store.py b/scripts/lib/resulttool/store.py index 903e29627a..578910d234 100644 --- a/scripts/lib/resulttool/store.py +++ b/scripts/lib/resulttool/store.py | |||
| @@ -74,12 +74,25 @@ def store(args, logger): | |||
| 74 | 74 | ||
| 75 | logger.info('Storing test result into git repository %s' % args.git_dir) | 75 | logger.info('Storing test result into git repository %s' % args.git_dir) |
| 76 | 76 | ||
| 77 | gitarchive.gitarchive(tempdir, args.git_dir, False, False, | 77 | excludes = [] |
| 78 | if args.logfile_archive: | ||
| 79 | excludes = ['*.log', "*.log.zst"] | ||
| 80 | |||
| 81 | tagname = gitarchive.gitarchive(tempdir, args.git_dir, False, False, | ||
| 78 | "Results of {branch}:{commit}", "branch: {branch}\ncommit: {commit}", "{branch}", | 82 | "Results of {branch}:{commit}", "branch: {branch}\ncommit: {commit}", "{branch}", |
| 79 | False, "{branch}/{commit_count}-g{commit}/{tag_number}", | 83 | False, "{branch}/{commit_count}-g{commit}/{tag_number}", |
| 80 | 'Test run #{tag_number} of {branch}:{commit}', '', | 84 | 'Test run #{tag_number} of {branch}:{commit}', '', |
| 81 | [], [], False, keywords, logger) | 85 | excludes, [], False, keywords, logger) |
| 82 | 86 | ||
| 87 | if args.logfile_archive: | ||
| 88 | logdir = args.logfile_archive + "/" + tagname | ||
| 89 | shutil.copytree(tempdir, logdir) | ||
| 90 | for root, dirs, files in os.walk(logdir): | ||
| 91 | for name in files: | ||
| 92 | if not name.endswith(".log"): | ||
| 93 | continue | ||
| 94 | f = os.path.join(root, name) | ||
| 95 | subprocess.run(["zstd", f, "--rm"], check=True, capture_output=True) | ||
| 83 | finally: | 96 | finally: |
| 84 | subprocess.check_call(["rm", "-rf", tempdir]) | 97 | subprocess.check_call(["rm", "-rf", tempdir]) |
| 85 | 98 | ||
| @@ -107,3 +120,5 @@ def register_commands(subparsers): | |||
| 107 | help='add extra test environment data to each result file configuration') | 120 | help='add extra test environment data to each result file configuration') |
| 108 | parser_build.add_argument('-r', '--revision', default='', | 121 | parser_build.add_argument('-r', '--revision', default='', |
| 109 | help='only store data for the specified revision') | 122 | help='only store data for the specified revision') |
| 123 | parser_build.add_argument('-l', '--logfile-archive', default='', | ||
| 124 | help='directory to separately archive log files along with a copy of the results') | ||
