Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tests,esp32: Skip soft timer test on esp32 port, rename. #15540

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

Merged

Conversation

projectgus
Copy link
Contributor

@projectgus projectgus commented Jul 25, 2024

Summary

Rename the extmod/machine_timer.py test to machine_soft_timer.py (as this is what it tests). Skip it on esp32, which has no soft timer support.

Found while testing #15523.

Testing

Allows this test to not fail on esp32.

@projectgus projectgus added port-esp32 tests Relates to tests/ directory in source labels Jul 25, 2024
Copy link

codecov bot commented Jul 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.43%. Comparing base (e1ecc23) to head (4a9a318).
Report is 25 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #15540   +/-   ##
=======================================
  Coverage   98.43%   98.43%           
=======================================
  Files         161      161           
  Lines       21275    21281    +6     
=======================================
+ Hits        20942    20948    +6     
  Misses        333      333           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dpgeorge
Copy link
Member

Seems like this PR accidentally got some I2S stuff committed as well?

@projectgus projectgus force-pushed the test/machine_timer_no_virtual branch from 13515b9 to 824ae4b Compare July 25, 2024 03:11
@projectgus
Copy link
Contributor Author

Seems like this PR accidentally got some I2S stuff committed as well?

Oops, thanks. Fixed.

@projectgus projectgus force-pushed the test/machine_timer_no_virtual branch from 824ae4b to b0c07af Compare July 25, 2024 04:30
@dpgeorge
Copy link
Member

dpgeorge commented Aug 1, 2024

See related #15284. In particular my comment #15284 (comment)

The reason I never got around to fixing this test is because I kinda wanted it to be a reminder to fix this properly on esp32, ie allow it to create timers without an id. Because at the moment machine.Timer is really not very portable, and for such a basic thing like making a timer we should aim to make the API fully portable, see #2971.

Ultimately I'd like to see:

  • esp32 support soft timers
  • this existing test would then pass on esp32, probably best renamed to tests/extmod/machine_soft_timer.py
  • add a separate tests/extmod/machine_timer.py test which tests hardware timers on various ports

In the meantime... maybe just let this test fail on esp32, or at least skip?

@projectgus projectgus force-pushed the test/machine_timer_no_virtual branch from b0c07af to 4a9a318 Compare August 1, 2024 06:29
@projectgus
Copy link
Contributor Author

probably best renamed to tests/extmod/machine_soft_timer.py
or at least skip?

What about these two bits for now? That's what I've done here as they're the low hanging fruit. Skipping seems appropriate given the feature isn't implemented on that port for now. I would also like to see soft timers on esp32 port, in the long term.

@projectgus projectgus changed the title tests,esp32: Add support for timer IDs to machine_timer test. tests,esp32: Skip soft timer test on esp32 port, rename. Aug 1, 2024
@dpgeorge
Copy link
Member

dpgeorge commented Aug 1, 2024

What about these two bits for now?

Yes, looks good now.

Also rename the test to reflect that it's a soft timer test.

Signed-off-by: Angus Gratton <[email protected]>
@dpgeorge dpgeorge force-pushed the test/machine_timer_no_virtual branch from 4a9a318 to 9ba04cc Compare August 2, 2024 00:28
@dpgeorge dpgeorge merged commit 9ba04cc into micropython:master Aug 2, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
port-esp32 tests Relates to tests/ directory in source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants