-
Notifications
You must be signed in to change notification settings - Fork 307
Add parallel test execution to CI with pytest-xdist library #2850
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
Very interesting failures. I've restarted the ubuntu 3.12 test just to make sure it isn't macos-specific. As a last resort I think I remember there being a way to tell pytest that some tests can't be run in parallel, but I'm also surprised that these are failing. |
I've been doing some testing of this locally and I think I've discovered one of the main issues although I'm not 100% sure it is the only issue. In |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2850 +/- ##
==========================================
- Coverage 95.96% 95.95% -0.02%
==========================================
Files 366 366
Lines 53593 53615 +22
==========================================
+ Hits 51433 51446 +13
- Misses 2160 2169 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@pytroll/satpy-core and @ClementLaplace any reason not to use |
Pull Request Test Coverage Report for Build 9976726430Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
I'm not sure I'm happy with my choice of fixing my enhancement tests by using a fixture, but I didn't really like any the solutions I came up with either. |
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.
Looks good to me, just one question.
""" | ||
prev_cwd = pathlib.Path.cwd() | ||
tmp_path = tmp_path_factory.mktemp("config") | ||
os.chdir(tmp_path) |
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.
What is the chdir
needed for?
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 tests are testing that configs in the current working directory are discovered and used. However, now that I say that that might not be important to all the tests. I'll try to review the tests and see if this chdir can be limited to only a few 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.
So there is at least one class of tests that I think it is important that the configs come from the current working directory. Or at least it is nice that they test it. The other tests would be fine if the config path was instead added using the satpy.config
interface(s) for adding user custom configs. Either way, this current directory versus satpy.config directory stuff should be handled by other satpy.config
-specific tests and is not necessary to test here. The tests look about the same whether satpy.config
is used versus chdir
, but I think the chdir
ends up being a little cleaner but this is more of a personal preference and if I'm being honest some level of laziness that I don't want to change it.
Unless someone feels strongly I think I'd like this merged as-is and if more cleanup is needed in the future I can do that.
I think it's a great idea! Thanks for bringing this up @ClementLaplace |
Ah github actions only gives use 2 cores except on macos it gives us 3 it seems. I guess "auto" is still a good thing to do for now. |
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.
looks good to me, thanks @ClementLaplace @djhoese !
This PR is related to the parralelisation of the tests as mentioned in this issue