-
Notifications
You must be signed in to change notification settings - Fork 42
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
feat+fix: preserve test collection order #346
base: main
Are you sure you want to change the base?
Conversation
We run into issues with test ordering with some frequency in the ATS step in CI. This is because ATS scrambles the test order and this uncovers certain dependencies within tests. Sure there's some value in doing that, but fixing these issues is somewhat annoying and actually disrupts the workflow more than is helpful. Scrambling test order needs to be deliberate, not accidental These changes make sure that we preserve the order that pytest collected tests when deciding the order to run them. Notice that it can still run into ordering issues if a test that depends on another test does't get picked to run.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #346 +/- ##
==========================================
- Coverage 95.52% 95.47% -0.05%
==========================================
Files 80 80
Lines 2746 2764 +18
==========================================
+ Hits 2623 2639 +16
- Misses 123 125 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@ai-review-prompt-prod testing AI code review, you can ignore the feedback (if any). |
@property | ||
def collected_labels_in_order(self) -> List[str]: | ||
"""The list of collected labels, in the order returned by the testing tool. | ||
This is a superset of all other lists. | ||
""" | ||
return self.get("collected_labels_in_order", []) | ||
|
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.
The collected_labels_in_order
property should be moved to the end of the class to maintain the logical grouping of methods.
We run into issues with test ordering with some frequency in the ATS
step in CI. This is because ATS scrambles the test order and this
uncovers certain dependencies within tests.
Sure there's some value in doing that, but fixing these issues is
somewhat annoying and actually disrupts the workflow more than is
helpful. Scrambling test order needs to be deliberate, not accidental
These changes make sure that we preserve the order that pytest
collected tests when deciding the order to run them.
Notice that it can still run into ordering issues if a test that
depends on another test does't get picked to run.