Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

giovanni-guidini
Copy link
Contributor

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.

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.
Copy link

codecov bot commented Jan 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4274ae5) 95.52% compared to head (a4bad6b) 95.47%.

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     
Flag Coverage Δ
python3.10 95.71% <100.00%> (-0.05%) ⬇️
python3.11 95.71% <100.00%> (-0.05%) ⬇️
python3.8 95.71% <100.00%> (-0.05%) ⬇️
python3.9 95.71% <100.00%> (-0.05%) ⬇️
smart-labels 95.47% <100.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@eliatcodecov
Copy link
Contributor

@ai-review-prompt-prod testing AI code review, you can ignore the feedback (if any).

Comment on lines +24 to +30
@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", [])

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.

Copy link

@OKEAMAH OKEAMAH left a comment

Choose a reason for hiding this comment

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

Okeamah.eth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants