diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-01-29 15:08:58 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-01-31 23:23:26 +0000 |
commit | 54d4694f328a4ae07955aa68dcb6d3c183ed2edd (patch) | |
tree | 889ae89d6de707f1da3736e19c44065db5a0db88 /meta/lib/oeqa/runtime | |
parent | 3731033435b6a432b9a67da54f09761288c211e4 (diff) | |
download | poky-54d4694f328a4ae07955aa68dcb6d3c183ed2edd.tar.gz |
oeqa/logparser: Improve results handling
Merge the results handling into the ptest log parser as a seperate
method.
Drop the weird "pass.skip.fail." prefix to the results filename, its
just bizarre.
Drop the code turning a list into a regex then searching the regex for
an item, "x in y" is perfectly capable.
Use a dict, sort the keys as needed and drop the list sorting code.
(From OE-Core rev: f317800e950b4a37b4034133bc52e0c47f04dc29)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/runtime')
-rw-r--r-- | meta/lib/oeqa/runtime/cases/ptest.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/meta/lib/oeqa/runtime/cases/ptest.py b/meta/lib/oeqa/runtime/cases/ptest.py index 3cfd7af7e2..2843953b38 100644 --- a/meta/lib/oeqa/runtime/cases/ptest.py +++ b/meta/lib/oeqa/runtime/cases/ptest.py | |||
@@ -49,8 +49,9 @@ class PtestRunnerTest(OERuntimeTestCase): | |||
49 | extras['ptestresult.rawlogs'] = {'log': output} | 49 | extras['ptestresult.rawlogs'] = {'log': output} |
50 | 50 | ||
51 | # Parse and save results | 51 | # Parse and save results |
52 | parse_result, sections = PtestParser().parse(ptest_runner_log) | 52 | parser = PtestParser() |
53 | parse_result.log_as_files(ptest_log_dir, test_status = ['pass','fail', 'skip']) | 53 | results, sections = parser.parse(ptest_runner_log) |
54 | parser.results_as_files(ptest_log_dir, test_status = ['pass','fail', 'skip']) | ||
54 | if os.path.exists(ptest_log_dir_link): | 55 | if os.path.exists(ptest_log_dir_link): |
55 | # Remove the old link to create a new one | 56 | # Remove the old link to create a new one |
56 | os.remove(ptest_log_dir_link) | 57 | os.remove(ptest_log_dir_link) |
@@ -60,14 +61,15 @@ class PtestRunnerTest(OERuntimeTestCase): | |||
60 | 61 | ||
61 | trans = str.maketrans("()", "__") | 62 | trans = str.maketrans("()", "__") |
62 | resmap = {'pass': 'PASSED', 'skip': 'SKIPPED', 'fail': 'FAILED'} | 63 | resmap = {'pass': 'PASSED', 'skip': 'SKIPPED', 'fail': 'FAILED'} |
63 | for section in parse_result.result_dict: | 64 | for section in results: |
64 | for test, result in parse_result.result_dict[section]: | 65 | for test in results[section]: |
66 | result = results[section][test] | ||
65 | testname = "ptestresult." + (section or "No-section") + "." + "_".join(test.translate(trans).split()) | 67 | testname = "ptestresult." + (section or "No-section") + "." + "_".join(test.translate(trans).split()) |
66 | extras[testname] = {'status': resmap[result]} | 68 | extras[testname] = {'status': resmap[result]} |
67 | 69 | ||
68 | failed_tests = {} | 70 | failed_tests = {} |
69 | for section in parse_result.result_dict: | 71 | for section in results: |
70 | failed_testcases = [ "_".join(test.translate(trans).split()) for test, result in parse_result.result_dict[section] if result == 'fail' ] | 72 | failed_testcases = [ "_".join(test.translate(trans).split()) for test in results[section] if results[section][test] == 'fail' ] |
71 | if failed_testcases: | 73 | if failed_testcases: |
72 | failed_tests[section] = failed_testcases | 74 | failed_tests[section] = failed_testcases |
73 | 75 | ||