diff options
Diffstat (limited to 'poky/scripts/lib/resulttool/store.py')
-rw-r--r-- | poky/scripts/lib/resulttool/store.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/poky/scripts/lib/resulttool/store.py b/poky/scripts/lib/resulttool/store.py index 5e33716c3d..e4a0807528 100644 --- a/poky/scripts/lib/resulttool/store.py +++ b/poky/scripts/lib/resulttool/store.py @@ -29,15 +29,18 @@ def store(args, logger): try: results = {} logger.info('Reading files from %s' % args.source) - for root, dirs, files in os.walk(args.source): - for name in files: - f = os.path.join(root, name) - if name == "testresults.json": - resultutils.append_resultsdata(results, f) - elif args.all: - dst = f.replace(args.source, tempdir + "/") - os.makedirs(os.path.dirname(dst), exist_ok=True) - shutil.copyfile(f, dst) + if os.path.isfile(args.source): + resultutils.append_resultsdata(results, args.source) + else: + for root, dirs, files in os.walk(args.source): + for name in files: + f = os.path.join(root, name) + if name == "testresults.json": + resultutils.append_resultsdata(results, f) + elif args.all: + dst = f.replace(args.source, tempdir + "/") + os.makedirs(os.path.dirname(dst), exist_ok=True) + shutil.copyfile(f, dst) revisions = {} @@ -65,7 +68,7 @@ def store(args, logger): results = revisions[r] keywords = {'commit': r[0], 'branch': r[1], "commit_count": r[2]} subprocess.check_call(["find", tempdir, "!", "-path", "./.git/*", "-delete"]) - resultutils.save_resultsdata(results, tempdir) + resultutils.save_resultsdata(results, tempdir, ptestlogs=True) logger.info('Storing test result into git repository %s' % args.git_dir) |