mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 13:09:50 +00:00
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>
This commit is contained in:
@@ -49,8 +49,9 @@ class PtestRunnerTest(OERuntimeTestCase):
|
||||
extras['ptestresult.rawlogs'] = {'log': output}
|
||||
|
||||
# Parse and save results
|
||||
parse_result, sections = PtestParser().parse(ptest_runner_log)
|
||||
parse_result.log_as_files(ptest_log_dir, test_status = ['pass','fail', 'skip'])
|
||||
parser = PtestParser()
|
||||
results, sections = parser.parse(ptest_runner_log)
|
||||
parser.results_as_files(ptest_log_dir, test_status = ['pass','fail', 'skip'])
|
||||
if os.path.exists(ptest_log_dir_link):
|
||||
# Remove the old link to create a new one
|
||||
os.remove(ptest_log_dir_link)
|
||||
@@ -60,14 +61,15 @@ class PtestRunnerTest(OERuntimeTestCase):
|
||||
|
||||
trans = str.maketrans("()", "__")
|
||||
resmap = {'pass': 'PASSED', 'skip': 'SKIPPED', 'fail': 'FAILED'}
|
||||
for section in parse_result.result_dict:
|
||||
for test, result in parse_result.result_dict[section]:
|
||||
for section in results:
|
||||
for test in results[section]:
|
||||
result = results[section][test]
|
||||
testname = "ptestresult." + (section or "No-section") + "." + "_".join(test.translate(trans).split())
|
||||
extras[testname] = {'status': resmap[result]}
|
||||
|
||||
failed_tests = {}
|
||||
for section in parse_result.result_dict:
|
||||
failed_testcases = [ "_".join(test.translate(trans).split()) for test, result in parse_result.result_dict[section] if result == 'fail' ]
|
||||
for section in results:
|
||||
failed_testcases = [ "_".join(test.translate(trans).split()) for test in results[section] if results[section][test] == 'fail' ]
|
||||
if failed_testcases:
|
||||
failed_tests[section] = failed_testcases
|
||||
|
||||
|
||||
Reference in New Issue
Block a user