Skip to content

Conversation

@dpgeorge
Copy link
Member

Summary

This PR adjusts the tests/multi_net tests so they run on the esp8266 port:

  • The axTLS implementation of the tls module only has a basic set of features. In particular it doesn't support the CERT_REQUIRED constant nor DTLS, nor can it load the ec_key.der key when acting as a server. So skip tests that require these features, which ends up being all the ssl/tls mult tests (esp8266 can still run standard networking tests that use ssl/tls, just not the multi_net tests).
  • When generating a random port number, use random.getrandbits(), which is guaranteed to exist on all ports that have the random module (but randrange() is not).

Testing

Tested running all multi_net tests on esp8266, esp32, RPI_PICO_W and unix ports. Apart from the TCP RST tests (covered by a separate PR #18547) the tests either pass or skip. In particular the updated ssl/tls tests still run and pass on all ports except esp8266.

Trade-offs and Alternatives

esp8266 is now Tier 3, so we could just ignore test errors on that port. But I still find it useful to run tests on that hardware because it helps define a more minimal port. An esp8266 board is also included in the Octoprobe hardware set up, so it's good to have the tests passing or skipping there.

The change to use getrandbits() is also potentially useful for other ports that don't enable all random features.

The axTLS implementation of the tls module only has a basic set of
features.  In particular it doesn't support the CERT_REQUIRED constant nor
DTLS, nor can it load the `ec_key.der` key when acting as a server.  So
skip tests that require these features, which ends up being all the ssl/tls
tests.

Signed-off-by: Damien George <damien@micropython.org>
The `getrandbits()` function is guaranteed to exist on all ports that have
the `random` module (but `randrange()` is not).

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge dpgeorge added the tests Relates to tests/ directory in source label Jan 13, 2026
@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.38%. Comparing base (e52916d) to head (708d419).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #18675   +/-   ##
=======================================
  Coverage   98.38%   98.38%           
=======================================
  Files         171      171           
  Lines       22298    22298           
=======================================
  Hits        21937    21937           
  Misses        361      361           

☔ 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.

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.

1 participant