16 Commits
Author SHA1 Message Date
William Douglas 623d973c43 Fixup imports for isort
Change fixes up CI issues with flake8.

Signed-off-by: William Douglas <william.douglas@intel.com>
2023-10-11 10:33:31 -07:00
Patrick McCarty 546b947ba6 Refactor pytest test summary parsing; update tests
Instead of using separate regular expressions to capture the multiple
forms pytest test summaries might take, use one generic regular
expression to match the summary line, and then process comma-separated
components of the line with more specific matches.

Three test cases needed to be updated to accommodate this refactor:

- Two tests omitted the leading '=' characters from the line to match,
  even though their summary lines clearly originated from pytest. Fix by
  adding some leading '=' characters for those summary lines.

- One test mistakenly counted an "xpass" as an "xfail". Autospec maps
  "xpass" results to "pass", so update the test accordingly.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2022-05-04 16:41:39 -07:00
Patrick McCarty d6d2fb6661 count: match newer-style pytest summaries
More modern `pytest` versions appear to format the time value
differently... So, for the regexps that no longer match, support the
new format.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2022-02-28 12:49:36 -08:00
Patrick McCarty 0fdaee07da count: move pytest match examples next to the regexps
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2022-02-28 12:49:36 -08:00
Patrick McCarty 756d1871a8 Improve meson test results reporting
Support the output of `meson test` in addition to `ninja test`, since
the meson docs recommend running `meson test`.

Also add a new unit test to cover some of the test result summary line
differences.

Fixes #323

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2020-01-30 19:02:23 -08:00
Juro Bystricky 9bd8e185da count.py: Fix false positive FAIL
The following pattern match expression:
    match = re.search(r"(---\s+)?FAIL:?\s*", line)

would match both XFAIL and FAIL.
In the case of XFAIL in the line, the match would be interpreted as FAIL.

Remedy: use this instead:
   match = re.search(r"(---\s+)?(?<!X)FAIL:?\s*", line).

Kudos to phmccarty.
2020-01-06 14:09:42 -08:00
Brett T. Warden 4c4e04a589 Allow generic TODO in test failures
When parsing TAP, reduce the match pattern for expected failures to just
through "TODO", instead of "TODO known breakage".

https://testanything.org/tap-version-13-specification.html#todo-tests
2019-11-27 12:31:20 -08:00
Patrick McCarty 4e889da4b8 Start using open_auto()
See previous commit for rationale of this new helper function.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-06-24 13:08:39 -07:00
Sean V Kelley 154be056ee count.py: Add parsing for Mercurial
output:
total tests: 55
total passing: 51
tests skipped: 4

Signed-off-by: Sean V Kelley <sean.v.kelley@linux.intel.com>
2018-12-03 11:52:11 -08:00
William Douglas 9253e03f86 flake8 clean autospec based on Clear Linux 25890
Update autospec to be largely flake8 clean with 2 exceptions added to
the Makefile. One for Module docs that autospec is intentionally not
including as the file splits aren't real modules at this point. And
the second for import groups needing newline separation that autospec
is ignoring to avoid splitting up each autospec "module" being
imported as autospec today isn't really built on modules the python
way.
2018-11-05 14:20:21 -08:00
Arzhan Kinzhalin 6740ba1683 Fix linter (flake8) errors.
Also:
* flake8 configuration is moved from the command-line in the makefile to
  setup.cfg
2018-10-25 09:30:46 -07:00
Caio Marcelo de Oliveira Filho 590c85bba3 count: support counting test results from meson
This patch takes a different approach, since it was likely that
changing the way we count the existing individual patterns could break
other logs.

So when it identifies this is a meson test, it forks off to just parse
the meson patterns.

It doesn't support the "CLR-XTEST:" prefix to group multiple tests,
mostly because I couldn't find examples of it to test.
2018-07-25 18:47:10 -07:00
Matthew Johnson 07622d5770 Increase count.py test coverage
Also remove some never-hit regular expressions from count.py

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-11-16 13:11:07 -08:00
Matthew Johnson 5d722054e9 Add regular expression for vim tests
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-11-02 11:05:11 -07:00
William Douglas de97576f4e Cleanups for make check to pass 2017-09-22 15:20:17 -07:00
Matthew Johnson 43b7027d7c Convert count.pl to python
Convert the large count.pl script to a python script. This was mainly
done for ease of testing and calling within other python modules, such
as autospec/test.py.

The python script is nowhere near perfect. Most of the conversion was
done using find and replace. However, the python script has been tested
and behaves in the same way the perl script does. The only change (other
then several regex bugs found) should be the way it is called.

python3 count.py path/to/logtoscan

and within a python module:

import count
count.parse_log('path/to/logtoscan')
2017-07-11 14:12:44 -07:00