Skip to content

tests/run-tests.py: Run tests-with-regex-output as normal tests. #17768

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dpgeorge
Copy link
Member

Summary

Some tests (currently given by the special_tests list) have output which must be mached via a regex, because it can change from run to run (eg the address of an object is printed). These tests are currently classified as is_special in the test runner, which means they get special treatment. In particular they don't set the emitter as specified by args.emit. That means these tests do not run via .mpy or using the native emitter, even if those options are given on the command line.

This commit fixes that by considering is_special as different to tests_with_regex_output. The former is used for things like target feature detection (which are not really tests) and when extra command line options need to be passed to the unix micropython executable. The latter (now called tests_with_regex_output) are specifically for tests that have output to be matched via regex.

The thread_exc2.py test now needs to be excluded when running using the native emitter, because the native emitter doesn't print traceback info.

Testing

Tested locally using the unix port. Will be more thoroughly tested by CI.

@dpgeorge dpgeorge added the tests Relates to tests/ directory in source label Jul 26, 2025
Some tests (currently given by the `special_tests` list) have output which
must be mached via a regex, because it can change from run to run (eg the
address of an object is printed).  These tests are currently classified as
`is_special` in the test runner, which means they get special treatment.
In particular they don't set the emitter as specified by `args.emit`.  That
means these tests do not run via .mpy or using the native emitter, even if
those options are given on the command line.

This commit fixes that by considering `is_special` as different to
`tests_with_regex_output`.  The former is used for things like target
feature detection (which are not really tests) and when extra command line
options need to be passed to the unix micropython executable.  The latter
(now called `tests_with_regex_output`) are specifically for tests that have
output to be matched via regex.

The `thread_exc2.py` test now needs to be excluded when running using the
native emitter, because the native emitter doesn't print traceback info.

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge dpgeorge force-pushed the tests-run-tests-regex-output-not-special branch from 0e6611f to bd3b157 Compare July 26, 2025 10:22
Copy link

codecov bot commented Jul 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.38%. Comparing base (ebc9525) to head (bd3b157).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #17768   +/-   ##
=======================================
  Coverage   98.38%   98.38%           
=======================================
  Files         171      171           
  Lines       22239    22239           
=======================================
  Hits        21880    21880           
  Misses        359      359           

☔ 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