tools/tinytest-codegen: Ensure consistent tests order.#12906
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 <[email protected]>
|
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.
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.
@agatti any thought about using sort() to keep this simple?
There was a problem hiding this comment.
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).