Bug 15248

Summary: Consider migrating oe-selftest to pytest
Product: [QA/Testing] Functional (self) Testing Reporter: Chris Laplante <chris.laplante>
Component: oe-selftestAssignee: Unassigned <unassigned>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: Medium CC: randy.macleod, tgamblin, tim.orling
Version: 5.99   
Target Milestone: Future   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Chris Laplante 2023-10-20 04:07:38 UTC
As a relative outsider looking in, it seems to me that oe-selftest has grown beyond the capabilities of unittest. I think we could benefit from some of the more sophisticated features of a framework like pytest.

Some highlights worth investigating:
* Fixtures: https://pytest.org/en/7.4.x/how-to/fixtures.html
* Live logging: https://pytest.org/en/7.4.x/how-to/logging.html#live-logs
* Parameterization: https://pytest.org/en/7.4.x/how-to/parametrize.html#basic-pytest-generate-tests-example

However, I don't know if it is realistically possible to make the migration in any reasonable amount of time...
Comment 1 Randy MacLeod 2023-10-26 14:35:17 UTC
Does pytest support concurrent execution?  There are several plugins apparently so we'd need to pick on.
Getting someone time to work on it is a challenge.
Comment 2 Tim Orling 2023-10-26 14:37:45 UTC
https://pypi.org/project/pytest-xdist/ is probably the best known of the concurrent execution plugins.