diff options
author | Yeoh Ee Peng <ee.peng.yeoh@intel.com> | 2019-03-07 12:49:08 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-03-26 15:38:28 +0000 |
commit | 3e6a012462a0ae274697a1b0e444712b7bc0eec7 (patch) | |
tree | 776c36cbaff02737a4a05bef4825141fefb599d0 /scripts/lib | |
parent | 43823fbe1102d69e12c39eda060a73baadeea12c (diff) | |
download | poky-3e6a012462a0ae274697a1b0e444712b7bc0eec7.tar.gz |
scripts/resulttool: Enable manual result store and regression
To enable store for testresults.json file from manualexecution,
add layers metadata to configuration and add "manual" map to
resultutils.store_map.
To enable regression for manual, add "manual" map to
resultutils.regression_map. Also added compulsory configurations
('MACHINE', 'IMAGE_BASENAME') to manualexecution.
(From OE-Core rev: 514a9165790dda2afb412c519cb1444493dff1f9)
Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rwxr-xr-x | scripts/lib/resulttool/manualexecution.py | 36 | ||||
-rw-r--r-- | scripts/lib/resulttool/resultutils.py | 9 |
2 files changed, 26 insertions, 19 deletions
diff --git a/scripts/lib/resulttool/manualexecution.py b/scripts/lib/resulttool/manualexecution.py index ecdc4e7a7a..a44cc86190 100755 --- a/scripts/lib/resulttool/manualexecution.py +++ b/scripts/lib/resulttool/manualexecution.py | |||
@@ -19,6 +19,7 @@ import datetime | |||
19 | import re | 19 | import re |
20 | from oeqa.core.runner import OETestResultJSONHelper | 20 | from oeqa.core.runner import OETestResultJSONHelper |
21 | 21 | ||
22 | |||
22 | def load_json_file(file): | 23 | def load_json_file(file): |
23 | with open(file, "r") as f: | 24 | with open(file, "r") as f: |
24 | return json.load(f) | 25 | return json.load(f) |
@@ -46,31 +47,34 @@ class ManualTestRunner(object): | |||
46 | def _get_input(self, config): | 47 | def _get_input(self, config): |
47 | while True: | 48 | while True: |
48 | output = input('{} = '.format(config)) | 49 | output = input('{} = '.format(config)) |
49 | if re.match('^[a-zA-Z0-9_]+$', output): | 50 | if re.match('^[a-zA-Z0-9_-]+$', output): |
50 | break | 51 | break |
51 | print('Only alphanumeric and underscore are allowed. Please try again') | 52 | print('Only alphanumeric and underscore/hyphen are allowed. Please try again') |
52 | return output | 53 | return output |
53 | 54 | ||
54 | def _create_config(self): | 55 | def _create_config(self): |
56 | from oeqa.utils.metadata import get_layers | ||
57 | from oeqa.utils.commands import get_bb_var | ||
58 | from resulttool.resultutils import store_map | ||
59 | |||
60 | layers = get_layers(get_bb_var('BBLAYERS')) | ||
55 | self.configuration = {} | 61 | self.configuration = {} |
56 | while True: | 62 | self.configuration['LAYERS'] = layers |
57 | try: | 63 | current_datetime = datetime.datetime.now() |
58 | conf_total = int(input('\nPlease provide how many configuration you want to save \n')) | 64 | self.starttime = current_datetime.strftime('%Y%m%d%H%M%S') |
59 | break | 65 | self.configuration['STARTTIME'] = self.starttime |
60 | except ValueError: | 66 | self.configuration['TEST_TYPE'] = 'manual' |
61 | print('Invalid input. Please provide input as a number not character.') | 67 | self.configuration['TEST_MODULE'] = self.test_module |
62 | for i in range(conf_total): | 68 | |
69 | extra_config = set(store_map['manual']) - set(self.configuration) | ||
70 | for config in sorted(extra_config): | ||
63 | print('---------------------------------------------') | 71 | print('---------------------------------------------') |
64 | print('This is configuration #%s ' % (i + 1) + '. Please provide configuration name and its value') | 72 | print('This is configuration #%s. Please provide configuration value(use "None" if not applicable).' |
73 | % config) | ||
65 | print('---------------------------------------------') | 74 | print('---------------------------------------------') |
66 | name_conf = self._get_input('Configuration Name') | ||
67 | value_conf = self._get_input('Configuration Value') | 75 | value_conf = self._get_input('Configuration Value') |
68 | print('---------------------------------------------\n') | 76 | print('---------------------------------------------\n') |
69 | self.configuration[name_conf.upper()] = value_conf | 77 | self.configuration[config] = value_conf |
70 | current_datetime = datetime.datetime.now() | ||
71 | self.starttime = current_datetime.strftime('%Y%m%d%H%M%S') | ||
72 | self.configuration['STARTTIME'] = self.starttime | ||
73 | self.configuration['TEST_TYPE'] = self.test_module | ||
74 | 78 | ||
75 | def _create_result_id(self): | 79 | def _create_result_id(self): |
76 | self.result_id = 'manual_' + self.test_module + '_' + self.starttime | 80 | self.result_id = 'manual_' + self.test_module + '_' + self.starttime |
diff --git a/scripts/lib/resulttool/resultutils.py b/scripts/lib/resulttool/resultutils.py index c8ccf1bcb6..153f2b8e10 100644 --- a/scripts/lib/resulttool/resultutils.py +++ b/scripts/lib/resulttool/resultutils.py | |||
@@ -21,19 +21,22 @@ flatten_map = { | |||
21 | "oeselftest": [], | 21 | "oeselftest": [], |
22 | "runtime": [], | 22 | "runtime": [], |
23 | "sdk": [], | 23 | "sdk": [], |
24 | "sdkext": [] | 24 | "sdkext": [], |
25 | "manual": [] | ||
25 | } | 26 | } |
26 | regression_map = { | 27 | regression_map = { |
27 | "oeselftest": ['TEST_TYPE', 'MACHINE'], | 28 | "oeselftest": ['TEST_TYPE', 'MACHINE'], |
28 | "runtime": ['TESTSERIES', 'TEST_TYPE', 'IMAGE_BASENAME', 'MACHINE', 'IMAGE_PKGTYPE', 'DISTRO'], | 29 | "runtime": ['TESTSERIES', 'TEST_TYPE', 'IMAGE_BASENAME', 'MACHINE', 'IMAGE_PKGTYPE', 'DISTRO'], |
29 | "sdk": ['TESTSERIES', 'TEST_TYPE', 'IMAGE_BASENAME', 'MACHINE', 'SDKMACHINE'], | 30 | "sdk": ['TESTSERIES', 'TEST_TYPE', 'IMAGE_BASENAME', 'MACHINE', 'SDKMACHINE'], |
30 | "sdkext": ['TESTSERIES', 'TEST_TYPE', 'IMAGE_BASENAME', 'MACHINE', 'SDKMACHINE'] | 31 | "sdkext": ['TESTSERIES', 'TEST_TYPE', 'IMAGE_BASENAME', 'MACHINE', 'SDKMACHINE'], |
32 | "manual": ['TEST_TYPE', 'TEST_MODULE', 'IMAGE_BASENAME', 'MACHINE'] | ||
31 | } | 33 | } |
32 | store_map = { | 34 | store_map = { |
33 | "oeselftest": ['TEST_TYPE'], | 35 | "oeselftest": ['TEST_TYPE'], |
34 | "runtime": ['TEST_TYPE', 'DISTRO', 'MACHINE', 'IMAGE_BASENAME'], | 36 | "runtime": ['TEST_TYPE', 'DISTRO', 'MACHINE', 'IMAGE_BASENAME'], |
35 | "sdk": ['TEST_TYPE', 'MACHINE', 'SDKMACHINE', 'IMAGE_BASENAME'], | 37 | "sdk": ['TEST_TYPE', 'MACHINE', 'SDKMACHINE', 'IMAGE_BASENAME'], |
36 | "sdkext": ['TEST_TYPE', 'MACHINE', 'SDKMACHINE', 'IMAGE_BASENAME'] | 38 | "sdkext": ['TEST_TYPE', 'MACHINE', 'SDKMACHINE', 'IMAGE_BASENAME'], |
39 | "manual": ['TEST_TYPE', 'TEST_MODULE', 'MACHINE', 'IMAGE_BASENAME'] | ||
37 | } | 40 | } |
38 | 41 | ||
39 | # | 42 | # |