Skip to content

tests: change all CLI test runners to use the new --test-instance argument scheme #17949

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 4 commits into
base: master
Choose a base branch
from

Conversation

dpgeorge
Copy link
Member

Summary

Back in PR #16111 (see commit 8978102) the run-tests.py script was changed to use an improved way of selecting the test instance, eg:

$ ./run-tests.py -t a0

that would run on /dev/ttyACM0. This has been a very nice improvement, makes it easier to specify the target.

This PR updates all other test runners to use the same scheme:

  • run-multitests.py -- previously used -i, eg -i pyb:a0
  • run-natmodtests.py -- previously used -d and -p, eg `-p -d /dev/ttyACM0'
  • run-perfbench.py -- previously used -d and -p

The run-internalbench.py runner was already updated in 88cb6bc

Now, everything uses the same scheme.

Testing

Tested locally running on the unix port and some boards attached to serial ports.

CI will also test this.

Octoprobe will need updating.

Trade-offs and Alternatives

Users will need to learn the new CLI options. And some existing ones had to be renamed because they clashed with -t.

We could leave things as they are, but it's pretty awkward how the test runners all use different CLI options to select the test target.

There's still quite a bit of refactoring that could be done, to consolidate more code between the test runners. But in the interest of making small, manageable steps, I've only done the first step of converting the command line options.

So it can be reused by other test runners.

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

codecov bot commented Aug 18, 2025

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #17949   +/-   ##
=======================================
  Coverage   98.38%   98.38%           
=======================================
  Files         171      171           
  Lines       22297    22297           
=======================================
  Hits        21938    21938           
  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.

Signed-off-by: Damien George <damien@micropython.org>
The existing "-t" option is changed to "-m".

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge dpgeorge force-pushed the tests-convert-all-to-use-test-instance-arg branch from ede1f75 to eb1a7b1 Compare August 18, 2025 02:08
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