summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/logparser.py
AgeCommit message (Collapse)Author
2023-07-21oeqa/ltp: rewrote LTP testcase and parserRoss Burton
The LTP test reporting appears to be a little fragile so I tried to make it more reliable. Primarily this is done by not passing -p to runltp, which results in machine-readable logfiles instead of human-readable. These are easier to parse and have more context in, so we can also report correctly skipped tests. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2023-06-17oeqa/logparser: Fix ptest No-section exceptionRichard Purdie
Occasionally we see: File "/media/build/poky/meta/lib/oeqa/runtime/cases/ptest.py", line 27, in test_ptestrunner_expectfail self.do_ptestrunner() File "/media/build/poky/meta/lib/oeqa/runtime/cases/ptest.py", line 77, in do_ptestrunner results, sections = parser.parse(ptest_runner_log) File "/media/build/poky/meta/lib/oeqa/utils/logparser.py", line 80, in parse self.results[current_section['name']][result.group(1).strip()] = t KeyError: 'No-section' which occurs when there are "results" outside the main log section. The strace tests do then upon failure as they dump logs there. Add code to avoid the tracebacks and just make them warnings. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-05-03oeqa/runtime/ptest: Make returning no test results a failureRichard Purdie
Ensure that even if a ptests results section is empty, the log parser adds that empty section. Then ensure that empty sections trigger warnings. This means if a ptest suddently stops returning any results, we notice and see warnings about it. This has gone unnoticed on the autobuilder far too many times so is very much worth highlighting as a regression. We shouldn't have empty ptests. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12lib: Add copyright statements to files without oneRichard Purdie
Where there isn't a copyright statement, add one to make it explicit. Also add license identifiers as MIT if there isn't one. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-01ltp: update 20210927 -> 20220121Alexander Kanavin
The ltp compliancy parser is rewritten to actually match the logs: they seem to be unstructured, test case names are not printed and the only indication of failure is appearance of FAIL[ED] somewhere. Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-22oeqa/logparser: correctly set test result markersAlexander Kanavin
I spotted this by noticing ptests started to unexpectedly pass, which shouldn't happen yet. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-21oeqa/logparser: Fix performance issues with ptest log parsingRichard Purdie
On the autobuilder a ptest log with 2.1 million lines took around 18 hours to process. This is clearly crazy. We can tweak the processing code to: a) Stop repeatedly joining large strings together (append to a list instead) b) Use one startswith expression instead of multiple re.search() operations With this change it takes 18 hours down to around 12s. [YOCTO #13696] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-06-28oeqa: Cleanup /usr/bin/env pythonRobert Yang
Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-06-19oeqa/logparser: ignore test failure commentaryRoss Burton
The output format for Python and GLib both can be of this form: FAIL: foobar (Segmentation fault) In this case the test is called foobar not foobar_segmentation_fault. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-09meta/lib+scripts: Convert to SPDX license headersRichard Purdie
This adds SPDX license headers in place of the wide assortment of things currently in our script headers. We default to GPL-2.0-only except for the oeqa code where it was clearly submitted and marked as MIT on the most part or some scripts which had the "or later" GPL versioning. The patch also drops other obsolete bits of file headers where they were encoountered such as editor modelines, obsolete maintainer information or the phrase "All rights reserved" which is now obsolete and not required in copyright headers (in this case its actually confusing for licensing as all rights were not reserved). More work is needed for OE-Core but this takes care of the bulk of the scripts and meta/lib directories. The top level LICENSE files are tweaked to match the new structure and the SPDX naming. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-29logparser: Add LTP compliance sectionArmin Kuster
Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-29logparser: Add decoding ltp logsArmin Kuster
Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-31oeqa/logparser: Various misc cleanupsRichard Purdie
Get rid of further unneeded code complications: * value mappings we could just direct use * ftools when we can write files easily ourself * test result status filtering we don't use * variable overwriting module imports Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-31oeqa/logparser: Improve results handlingRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-31oeqa/utils/logparser: Add in support for duration, exitcode and logs by sectionRichard Purdie
Allow parsing of the ptest duration, exit code and timeout keywords from the logs, returning data on each section. Also include the logs broken out per section. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-31oeqa/logparser: Reform the ptest results parserRichard Purdie
Now we have a dedicated ptest parser, merge in the remaining ptest specific pieces to further clarify and simplify the code, moving to a point where we can consider extending/enhancing it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-31oeqa/logparser: Further simplification/clarificationRichard Purdie
Rename the paster to be ptest specific and apply some further cleanups to the code to simplify and clarify what its doing. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-31oeqa/utils/logparser: Simplify ptest log parsing codeRichard Purdie
logparser is only used by ptest. Its slightly overcomplicated as it was intended to be reusable but wasn't. Simplify it as a dedicated parser is likely to me more readable and maintainable. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-23utils/logparser.py: fix section checkRobert Yang
The section might be None or '', so use "if section" for it. Fixed: File "/buildarea/lyang1/poky/meta/lib/oeqa/utils/logparser.py", line 113, in log_as_files prefix += section TypeError: Can't convert 'NoneType' object to str implicitly [YOCTO #11547] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-23oeqa/utils/logparser.py: add skip statusRobert Yang
Some test cases maybe skipped, let's parse it. [YOCTO #11547] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02classes/lib: Complete transition to python3Richard Purdie
This patch contains all the other misc pieces of the transition to python3 which didn't make sense to be broken into individual patches. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-10oeqa/utils/logparser.py: results based log parser utilityLucian Musat
A module for parsing results based logs like ptest, compliance and performance. Supports breaking the logs into multiple sections and also provides a result object to use the parser with. The parser is initialized with the regex required to identify results and section statements in the target log file. Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Lucian Musat <georgex.l.musat@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>