Skip to contentSkip to conversation

scripts/test-case-mgmt: store test result & log into git repository

PATCH Superseded Yeoh Ee Peng 1 participant 1 message Oct 25, 2018

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 scripts/test-case-mgmt: store test result & log into git repository

These scripts were developed as an alternative testcase management tool to Testopia. Using these scripts, user can store test result & log from OEQA automated testcase execution.

These scripts will store test result & log in GIT repository. To use these scripts, first source oe environment, then run the entry point script to look for help.

    $ test-case-mgmt

To store test result for OEQA automated testcase, execute the below

    $ test-case-mgmt store <source_dir> <git_branch>
---
 scripts/lib/testcasemgmt/__init__.py |   0
 scripts/lib/testcasemgmt/gitstore.py | 129 +++++++++++++++++++++++++++++++++++
 scripts/lib/testcasemgmt/store.py    |  40 +++++++++++
 scripts/test-case-mgmt               |  92 +++++++++++++++++++++++++
 4 files changed, 261 insertions(+)
 create mode 100644 scripts/lib/testcasemgmt/__init__.py
 create mode 100644 scripts/lib/testcasemgmt/gitstore.py
 create mode 100644 scripts/lib/testcasemgmt/store.py
 create mode 100755 scripts/test-case-mgmt
scripts/lib/testcasemgmt/__init__.py new file +0 -0
new file mode 100644
index 0000000..e69de29
scripts/lib/testcasemgmt/gitstore.py new file +129 -0

129 lines not on this page · raw message

scripts/lib/testcasemgmt/store.py new file +40 -0
new file mode 100644
index 0000000..c6386c8a
@@ -0,0 +1,40 @@
+# test case management tool - store test result
+#
+# Copyright (c) 2018, Intel Corporation.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+from testcasemgmt.gitstore import GitStore
+
+def store(args, logger):
+    gitstore = GitStore()
+    gitstore.store_test_result(logger, args.source_dir, args.git_branch, args.dest_dir, args.dest_sub_dir,
+                               args.overwrite_result)
+    return 0
+
+def register_commands(subparsers):
+    """Register subcommands from this plugin"""
+    parser_build = subparsers.add_parser('store', help='Store test result files into git repository.',
+                                         description='Store test result files into git repository.',
+                                         group='store')
+    parser_build.set_defaults(func=store)
+    parser_build.add_argument('source_dir',
+                              help='Source directory that contain the test result files to be stored.')
+    parser_build.add_argument('git_branch', help='Git branch used to store the test result files.')
+    parser_build.add_argument('-d', '--dest_dir', default='',
+                              help='(Optional) Destination directory to be used/created as git repository '
+                                   'to store the test result files from the source directory. '
+                                   'Default location for destination directory will be <top_dir>/testresults.git.')
+    parser_build.add_argument('-s', '--dest_sub_dir', default='',
+                              help='(Optional) Additional sub directory to be used/created under the destination '
+                                   'git repository, this sub directory will be used to hold the test result files. '
+                                   'Use sub directory if needing separate directories to hold multiple test files.')
+    parser_build.add_argument('-o', '--overwrite_result', action='store_true',
+                              help='(Optional) To overwrite existing testresult file with new file provided.')
scripts/test-case-mgmt new file +92 -0

92 lines not on this page · raw message

Signature · 1 line
2.7.4