-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
tests: improve autodetection of target features and simplify how tests are selected #17880
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
tests: improve autodetection of target features and simplify how tests are selected #17880
Conversation
0d5f468
to
a0b9c6e
Compare
Code size report:
|
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.
These look like good simplifications to me!
This simplifies the code by removing the explicit addition of the "float/" test directory for certain targets. It also means the tests won't be added incorrectly, eg on a unix build without float. Signed-off-by: Damien George <damien@micropython.org>
Ports that now run the stress tests, that didn't prior to this commit are: cc3200, esp8266, minimal, nrf, renesas-ra, samd, qemu, webassembly. Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
The unicode tests are now run on all targets that enable unicode. And other unicode tests (namely `extmod/json_loads.py`) are now properly skipped if the target doesn't have unicode support. Signed-off-by: Damien George <damien@micropython.org>
Instead of using a feature check. This is more consistent with how other optional modules are skipped. Signed-off-by: Damien George <damien@micropython.org>
Because these ports run tests as part of CI, and need to be run if any of the tests change, to check those changes. Signed-off-by: Damien George <damien@micropython.org>
This gets the recursive stress-tests working on this port. For relatively small Python functions the maximum recursive depth is about 150 nested calls. Signed-off-by: Damien George <damien@micropython.org>
0271a61
to
c16fe5b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #17880 +/- ##
=======================================
Coverage 98.38% 98.38%
=======================================
Files 171 171
Lines 22295 22295
=======================================
Hits 21936 21936
Misses 359 359 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
There are five changes in this PR, all aimed to automate, simplify and generalise which tests are run on a given target:
float/
tests if the target supports floating pointstress/
testsports/stm32
to the list of test dirs; it's now done in a general way based onsys.platform
target_info.py
to detect unicode supportextmod/json_loads.py
) are now properly skipped if the target doesn't have unicode supportbasics/io_*.py
tests using the SKIP mechanism, rather than having a feature test for the io moduleEDIT: I added a 6th commit, to enable C-stack checking on the webassembly port. That's needed for it to pass the now-enabled stress tests on this port. This is definitely an improvement to this port, otherwise users get strange Wasm errors if they overflow the C stack.
Testing
Tested locally on unix, webassembly, qemu, PYBD_SF6 and ADAFRUIT_ITSYBITSY_M0_EXPRESS.
Will also be tested by CI.
Trade-offs and Alternatives
This should be a win all round, to simplify
run-tests.py
and improve test coverage.It will also help with Octoprobe, to get more tests passing there (it tests a lot of different configurations, especially smaller targets without unicode).