| Summary: | Create ptest helper for python unittests | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Joshua Watt <JPEWhacker> |
| Component: | core | Assignee: | Ross Burton <ross.burton> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | Medium | CC: | meta.mr.watcher, meta.watcher, randy.macleod |
| Version: | 2.7 | ||
| Target Milestone: | 4.3 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | Don't know | |
|
Description
Joshua Watt
2019-05-09 14:05:41 UTC
I did start a unittest subclass that reimplemented the output code to match what we expect, but I got stuck on making -mtest actually work with it. I should see if I can still find it as I suspect the -mtest problem was a complication that wouldn't impact other classes. Ah, poky-contrib:ross/py. Hmm. So that branch has disappeared. But, relatedly, poky-contrib:ross/tap contains recipes for a few different Py TAP implementations. Specifically pychotap 1.2.1 contains a command line unittest runner I wrote so if a Python recipe's run-ptests did this before: $ python3 -munittest foo It can now do: $ python3 -mpychotap foo And it emits nice TAP format logs. That isn't *immediately* useful for this bug but either: 1) pychotap's __main__ can serve as a template for implementing a ptest-style formatter. 2) write a TAP-to-ptest script and pipe the TAP output into it. As TAP is gaining traction (perl and gnome use it by default), (2) is arguably a good idea. Making python3 -mtest work is another battle: the Py test suite is sufficiently complex that you can't just 'python3 -munittest test' so using a different formatter isn't that easy. Moved en masse from 4.2 to 4.3 by Randy. The new recipe python3-unittest-automake-output (added in 961e4f3fc786715fc136fa446686972a4a95a3d5) has helpers for unittest and pytest. |