Skip to content

tools/tinytest-codegen: Ensure consistent tests order. #12906

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

Closed
wants to merge 1 commit into from

Conversation

agatti
Copy link
Contributor

@agatti agatti commented Nov 7, 2023

Make sure the the generated header file contains tests appearing in a predictable order, conforming to tests/run-tests.py's behaviour.

Suggested in #12853 (comment).

Make sure the the generated header file contains tests appearing in a
predictable order, conforming to `tests/run-tests.py`'s behaviour.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
Copy link

github-actions bot commented Nov 7, 2023

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS

Copy link

codecov bot commented Nov 7, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.39%. Comparing base (958c6d9) to head (91bf884).
Report is 875 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #12906   +/-   ##
=======================================
  Coverage   98.39%   98.39%           
=======================================
  Files         158      158           
  Lines       20972    20972           
=======================================
  Hits        20636    20636           
  Misses        336      336           

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

for group in sorted(test_dirs):
tests += [
test for test in sorted(glob("{}/*.py".format(group))) if test not in exclude_tests
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be a lot simpler to just do tests.sort() after this for loop? Then there's no need to flatten anything.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agatti any thought about using sort() to keep this simple?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for the delay, this fell off my radar. The reason for the list flattening was to prevent potential user error, as it was not obvious the tests exclusion list is a set and not an array of sorts.

If that's not a concern I can sort the final list without pre-flattening the input as you suggest.

@dpgeorge dpgeorge added the tools Relates to tools/ directory in source, or other tooling label Nov 9, 2023
@agatti
Copy link
Contributor Author

agatti commented Sep 6, 2024

As tinytest is going away in #15788, this is not needed anymore.

@agatti agatti closed this Sep 6, 2024
@agatti agatti deleted the tinytest-sorted-order branch September 6, 2024 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tools Relates to tools/ directory in source, or other tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants