[oe-commits] [openembedded-core] 16/18: resulttool: Clean up help text
git at git.openembedded.org
git at git.openembedded.org
Mon Feb 18 10:34:09 UTC 2019
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit 9659fb33445e21dd424d992ee935dd37b298d6cd
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Sun Feb 17 17:49:57 2019 +0000
resulttool: Clean up help text
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
scripts/lib/resulttool/merge.py | 34 ++++++++++++++--------------------
scripts/lib/resulttool/regression.py | 15 +++++----------
scripts/lib/resulttool/report.py | 6 +++---
scripts/lib/resulttool/store.py | 18 +++++++++---------
scripts/resulttool | 7 ++++---
5 files changed, 35 insertions(+), 45 deletions(-)
diff --git a/scripts/lib/resulttool/merge.py b/scripts/lib/resulttool/merge.py
index 1dfefdf..3e4b7a3 100644
--- a/scripts/lib/resulttool/merge.py
+++ b/scripts/lib/resulttool/merge.py
@@ -17,32 +17,26 @@ import json
import resulttool.resultutils as resultutils
def merge(args, logger):
- # FIXME Add -t support for args.target_result_id
-
- if os.path.isdir(args.target_result_file):
- results = resultutils.load_resultsdata(args.target_result_file, configmap=resultutils.store_map)
- resultutils.append_resultsdata(results, args.base_result_file, configmap=resultutils.store_map)
- resultutils.save_resultsdata(results, args.target_result_file)
+ if os.path.isdir(args.target_results):
+ results = resultutils.load_resultsdata(args.target_results, configmap=resultutils.store_map)
+ resultutils.append_resultsdata(results, args.base_results, configmap=resultutils.store_map)
+ resultutils.save_resultsdata(results, args.target_results)
else:
- results = resultutils.load_resultsdata(args.base_result_file, configmap=resultutils.flatten_map)
- if os.path.exists(args.target_result_file):
- resultutils.append_resultsdata(results, args.target_result_file, configmap=resultutils.flatten_map)
- resultutils.save_resultsdata(results, os.path.dirname(args.target_result_file), fn=os.path.basename(args.target_result_file))
+ results = resultutils.load_resultsdata(args.base_results, configmap=resultutils.flatten_map)
+ if os.path.exists(args.target_results):
+ resultutils.append_resultsdata(results, args.target_results, configmap=resultutils.flatten_map)
+ resultutils.save_resultsdata(results, os.path.dirname(args.target_results), fn=os.path.basename(args.target_results))
return 0
def register_commands(subparsers):
"""Register subcommands from this plugin"""
- parser_build = subparsers.add_parser('merge', help='merge test results',
- description='merge results from multiple files',
+ parser_build = subparsers.add_parser('merge', help='merge test result files/directories',
+ description='merge the results from multiple files/directories into the target file or directory',
group='setup')
parser_build.set_defaults(func=merge)
- parser_build.add_argument('base_result_file',
- help='base result file provide the base result set')
- parser_build.add_argument('target_result_file',
- help='target result file provide the target result set for merging into the '
- 'base result set')
- parser_build.add_argument('-t', '--target-result-id', default='',
- help='(optional) default merge all result sets available from target to base '
- 'unless specific target result id was provided')
+ parser_build.add_argument('base_results',
+ help='the results file/directory to import')
+ parser_build.add_argument('target_results',
+ help='the target file or directory to merge the base_results with')
diff --git a/scripts/lib/resulttool/regression.py b/scripts/lib/resulttool/regression.py
index 1f19c39..112f1ad 100644
--- a/scripts/lib/resulttool/regression.py
+++ b/scripts/lib/resulttool/regression.py
@@ -101,22 +101,17 @@ def register_commands(subparsers):
"""Register subcommands from this plugin"""
parser_build = subparsers.add_parser('regression', help='regression file/directory analysis',
- description='regression analysis comparing base result set to target '
- 'result set',
+ description='regression analysis comparing the base set of results to the target results',
group='analysis')
parser_build.set_defaults(func=regression)
parser_build.add_argument('base_result',
- help='base result file/directory provide the files for base result set')
+ help='base result file/directory for the comparison')
parser_build.add_argument('target_result',
- help='target result file/directory provide the files for target result set for comparison with '
- 'base result')
+ help='target result file/directory to compare with')
parser_build.add_argument('-b', '--base-result-id', default='',
- help='(optional) default select regression based on configurations unless base result '
- 'id was provided')
+ help='(optional) filter the base results to this result ID')
parser_build.add_argument('-t', '--target-result-id', default='',
- help='(optional) default select regression based on configurations unless target result '
- 'id was provided')
-
+ help='(optional) filter the target results to this result ID')
parser_build = subparsers.add_parser('regression-git', help='regression git analysis',
description='regression analysis comparing base result set to target '
diff --git a/scripts/lib/resulttool/report.py b/scripts/lib/resulttool/report.py
index 862ac84..ec7d583 100644
--- a/scripts/lib/resulttool/report.py
+++ b/scripts/lib/resulttool/report.py
@@ -120,12 +120,12 @@ def report(args, logger):
def register_commands(subparsers):
"""Register subcommands from this plugin"""
- parser_build = subparsers.add_parser('report', help='report test result summary',
- description='report text-based test result summary from the source directory',
+ parser_build = subparsers.add_parser('report', help='summarise test results',
+ description='print a text-based summary of the test results',
group='analysis')
parser_build.set_defaults(func=report)
parser_build.add_argument('source_dir',
- help='source directory that contain the test result files for reporting')
+ help='source file/directory that contain the test result files to summarise')
parser_build.add_argument('-b', '--git-branch', default='',
help='(optional) default assume source directory contains all available files for '
'reporting unless a git branch was provided where it will try to checkout '
diff --git a/scripts/lib/resulttool/store.py b/scripts/lib/resulttool/store.py
index 236bfdf..8364122 100644
--- a/scripts/lib/resulttool/store.py
+++ b/scripts/lib/resulttool/store.py
@@ -27,14 +27,14 @@ def store(args, logger):
tempdir = tempfile.mkdtemp(prefix='testresults.')
try:
results = {}
- logger.info('Reading files from %s' % args.source_dir)
- for root, dirs, files in os.walk(args.source_dir):
+ 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)
else:
- dst = f.replace(args.source_dir, tempdir + "/")
+ dst = f.replace(args.source, tempdir + "/")
os.makedirs(os.path.dirname(dst), exist_ok=True)
shutil.copyfile(f, dst)
resultutils.save_resultsdata(results, tempdir)
@@ -54,14 +54,14 @@ def store(args, logger):
def register_commands(subparsers):
"""Register subcommands from this plugin"""
- parser_build = subparsers.add_parser('store', help='store test result files and directories into git repository',
- description='store the testresults.json files and related directories '
- 'from the source directory into the destination git repository '
- 'with the given git branch',
+ parser_build = subparsers.add_parser('store', help='store test results into a git repository',
+ description='takes a results file or directory of results files and stores '
+ 'them into the destination git repository, splitting out the results '
+ 'files as configured',
group='setup')
parser_build.set_defaults(func=store)
- parser_build.add_argument('source_dir',
- help='source directory that contain the test result files and directories to be stored')
+ parser_build.add_argument('source',
+ help='source file or directory that contain the test result files to be stored')
parser_build.add_argument('git_dir',
help='the location of the git repository to store the results in')
diff --git a/scripts/resulttool b/scripts/resulttool
index 13430e1..5a89e1c 100755
--- a/scripts/resulttool
+++ b/scripts/resulttool
@@ -1,11 +1,12 @@
#!/usr/bin/env python3
#
-# test results tool - tool for testresults.json (merge test results, regression analysis)
+# test results tool - tool for manipulating OEQA test result json files
+# (merge results, summarise results, regression analysis, generate manual test results file)
#
# To look for help information.
# $ resulttool
#
-# To store test result from oeqa automated tests, execute the below
+# To store test results from oeqa automated tests, execute the below
# $ resulttool store <source_dir> <git_branch>
#
# To merge test results, execute the below
@@ -58,7 +59,7 @@ def _validate_user_input_arguments(args):
return True
def main():
- parser = argparse_oe.ArgumentParser(description="OpenEmbedded test results tool.",
+ parser = argparse_oe.ArgumentParser(description="OEQA test result manipulation tool.",
epilog="Use %(prog)s <subcommand> --help to get help on a specific command")
parser.add_argument('-d', '--debug', help='enable debug output', action='store_true')
parser.add_argument('-q', '--quiet', help='print only errors', action='store_true')
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list