-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[microTVM] Replace static fixtures with parameterization #12530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[microTVM] Replace static fixtures with parameterization #12530
Conversation
mehrdadh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@guberti I like this change, thanks for fixing this!
|
|
||
| def pytest_addoption(parser): | ||
| """Adds more pytest arguments""" | ||
| parser.addoption( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't this force every test to have --platform as an argument? In that case we don't want this for tests that are specific to Zephyr/Arduino
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope! Only tests that include the platform fixture will require the --platform argument, and likewise for board. This is done by the if argument in metafunc.fixturenames line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, thanks for clarification!
* Replace microTVM static fixtures with parameterization * [microTVM] Only perform parameterization when fixture is present * Reformat with black * Fix Cortex-M tests * Add docstring to pytest_generate_tests * Remove trailing space from docstring
#12207 went a long way to improving microTVM code reuse, but introduced an unintentional? change. Previously, the full
pytestnames of microTVM tests included the value ofboard, prepended to any paremeterization. For example,test_rpc_large_arraywould have the name:This behavior was useful, as it meant that exported Junit XML files would correctly record which board the test was run on. However, after #12207 the names of tests stopped including this information:
This prevented Junit from differentiating between the tests when they were run on different boards, and instead just overwrote results on previous boards. Additionally, we never made this distinction for
commontests that were parameterized byplatform, so tests liketests.micro.common.test_autotune.test_kws_autotune_workflowwould have one of the platforms overwrite the other (with whichever one finished last being the one that was ultimately reported).This PR uses the
pytest_generate_testshook to fix this issue. Now, theboardparameter is included in the test name as before, and theplatformparameter will be included for any tests that use that fixture (e.g. common tests).cc @alanmacd @gromero @mehrdadh