Skip to content

tests/net_hosted: Only run network loopback test on supported targets. #17206

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
merged 1 commit into from
May 1, 2025

Conversation

dpgeorge
Copy link
Member

Summary

Only a few ports have TCP/IP loopback enabled in their network stack, and this test will only pass on those ports. There's not really any good way to do a feature check for loopback mode without actually running the test and seeing if it passes/fails, so add an explicit check that the test is running on a port known to support loopback.

(Enabling loopback on lwIP, eg RPI_PICO_W, costs +568 code and +272 bss and is a rarely used feature, so not worth unconditionally enabling.)

Testing

Tested on RPI_PICO2_W, this test now skips.

Tested on unix port and ESP32_GENERIC, this test still runs and passes.

Only a few ports have TCP/IP loopback enabled in their network stack, and
this test will only pass on those ports.  There's not really any good way
to do a feature check for loopback mode without actually running the test
and seeing if it passes/fails, so add an explicit check that the test is
running on a port known to support loopback.

(Enabling loopback on lwIP, eg RPI_PICO_W, costs +568 code and +272 bss and
is a rarely used feature, so not worth unconditionally enabling.)

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge dpgeorge added the tests Relates to tests/ directory in source label Apr 29, 2025
@dpgeorge dpgeorge requested a review from projectgus April 29, 2025 00:32
Copy link

codecov bot commented Apr 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.54%. Comparing base (6406afb) to head (be39106).
Report is 11 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #17206   +/-   ##
=======================================
  Coverage   98.54%   98.54%           
=======================================
  Files         169      169           
  Lines       21890    21890           
=======================================
  Hits        21572    21572           
  Misses        318      318           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@projectgus projectgus merged commit 3f1df4b into micropython:master May 1, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Relates to tests/ directory in source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants