-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Conversation
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>
Code size report:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
for group in sorted(test_dirs): | ||
tests += [ | ||
test for test in sorted(glob("{}/*.py".format(group))) if test not in exclude_tests | ||
] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
As tinytest is going away in #15788, this is not needed anymore. |
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).