diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-11-22 16:11:43 +0000 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-12-09 07:54:03 -0800 |
| commit | 6d20991557e8f1574267d0da069999c6c70be96d (patch) | |
| tree | 8c9619e89874c9201609ce9a58ae5687f7aaf333 /scripts/lib | |
| parent | b27b36b2c2d4d06aefacaebf3e7e4ac07d0e9142 (diff) | |
| download | poky-6d20991557e8f1574267d0da069999c6c70be96d.tar.gz | |
resulttool: Add --logfile-archive option to store mode
Storing the log files inside the testresults git repo isn't scaling and isn't
really appropriate use of a git repository. Allow these to be optionally stored
in a separate filesystem location so the git repo can remain managable.
(From OE-Core rev: 1084e88534f7a1341249ab453b82a35f0cddba87)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 1afc0f3d7e93fa8496be241e9622d3b9a6904bd5)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'scripts/lib')
| -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') | ||
