-
Notifications
You must be signed in to change notification settings - Fork 698
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
Run the pytest testsuite in parallel #1418
Conversation
.travis.yml
Outdated
@@ -24,15 +24,15 @@ env: | |||
- COVERALLS=false | |||
- NOSE_FLAGS="--processes=2 --process-timeout=400 --no-open-files --with-timer --timer-top-n 50" | |||
- NOSE_TEST_LIST="analysis auxiliary coordinates core formats topology utils" | |||
- PYTEST_FLAGS="--disable-pytest-warnings" | |||
- PYTEST_FLAGS="--disable-pytest-warnings -n 2" |
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.
can you please use --numprocesses
it's more explicit and I'm trying to get upstream ci-helpers to detect that to auto install pytest-xdist.
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.
Sure. I'll just let this build complete and then push.
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.
@kain88-de That doesn't work. I don't think there is anything like --numprocesses
2d5fe43
to
ebfc117
Compare
@kain88-de Should be ready to merge. No drop in coverage. |
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 like coverage isn't working in parallel
Coverage.py warning: Module MDAnalysis was never imported. (module-not-imported)
Coverage.py warning: No data was collected. (no-data-collected)
This is weird, I think I saw no drop in coverage last night. Let me cross check. |
I wonder how pytest shows the percentage of coverage when it did not collect data. |
@richardjgowers @jbarnoud @kain88-de @mnmelo I have a wild theory - the warnings might just be meaningless. I ran pytest on the So, I ran the Commands I used - Parallel: Can someone run these commands locally (off the port coordinates PR) and confirm my findings? |
So the build passed. The coverage is still at 88.837% Was there a drop? The button on the README file shows the same number. |
.travis.yml
Outdated
- PYTEST_LIST="testsuite/MDAnalysisTests/lib testsuite/MDAnalysisTests/formats" | ||
- NOSE_COVERAGE_FILE="nose_coverage" | ||
- PYTEST_COVERAGE_FILE="pytest_coverage" | ||
- MAIN_CMD="pytest ${PYTEST_LIST} ${PYTEST_FLAGS}; python ./testsuite/MDAnalysisTests/mda_nosetests ${NOSE_TEST_LIST} ${NOSE_FLAGS}" | ||
- SETUP_CMD="" | ||
- BUILD_CMD="pip install -v package/ && pip install testsuite/" | ||
- CONDA_DEPENDENCIES="mmtf-python nose=1.3.7 mock six biopython networkx cython joblib nose-timer pytest=3.1.2 pytest-cov=2.5.1" | ||
- CONDA_ALL_DEPENDENCIES="mmtf-python nose=1.3.7 mock six biopython networkx cython joblib nose-timer matplotlib netcdf4 scikit-learn scipy seaborn coveralls clustalw=2.1 pytest=3.1.2 pytest-cov=2.5.1" | ||
- CONDA_DEPENDENCIES="mmtf-python nose=1.3.7 mock six biopython networkx cython joblib nose-timer pytest=3.1.2 pytest-cov=2.5.1 pytest-xdist=1.17.1" |
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.
Could you please remove the version pinning. I'm trying to get everything updated to we can take use of ci-helpers magic to autoinstall things for us. You should be able to remove the pytest explicit dependency as well.
I'm hijacking this PR to clean up some installations of pytest.
0b8f1c3
to
1546462
Compare
@kain88-de @jbarnoud @richardjgowers I don't really like the way pytest displays its output (listing each file and the other stuff). I'd like it to be more like what nose does currently. Can I add the |
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.
Yeah, looks like we are getting two coverage reports, despite being told for the pytest version that we didn't gather coverage. Maybe it's a screw up between the parallel processes in pytest not communicating with each other.
.travis.yml
Outdated
- PYTEST_LIST="testsuite/MDAnalysisTests/lib testsuite/MDAnalysisTests/formats" | ||
- NOSE_COVERAGE_FILE="nose_coverage" | ||
- PYTEST_COVERAGE_FILE="pytest_coverage" | ||
- MAIN_CMD="pytest ${PYTEST_LIST} ${PYTEST_FLAGS}; python ./testsuite/MDAnalysisTests/mda_nosetests ${NOSE_TEST_LIST} ${NOSE_FLAGS}" | ||
- SETUP_CMD="" | ||
- BUILD_CMD="pip install -v package/ && pip install testsuite/" | ||
- CONDA_DEPENDENCIES="mmtf-python nose=1.3.7 mock six biopython networkx cython joblib nose-timer matplotlib scipy griddataformats pytest=3.1.2 pytest-cov=2.5.1" | ||
- CONDA_ALL_DEPENDENCIES="mmtf-python nose=1.3.7 mock six biopython networkx cython joblib nose-timer matplotlib netcdf4 scikit-learn scipy griddataformats seaborn coveralls clustalw=2.1 pytest=3.1.2 pytest-cov=2.5.1" | ||
- CONDA_DEPENDENCIES="mmtf-python nose=1.3.7 mock six biopython networkx cython joblib nose-timer matplotlib scipy griddataformats pytest-cov pytest-xdist" |
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.
@utkbansal you should also be able to drop the pytest-cov
package as an explicit dependency. See astropy/ci-helpers#216
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.
Cool.
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 here do we need to list pytest-cov
? And don't we need to list pytest
?
@utkbansal rebase this and we're good to go |
1546462
to
575aabd
Compare
@richardjgowers The rebase for this depends on what we want to do about #1414 It wasn't supposed to be merged yet.
|
@richardjgowers @jbarnoud @kain88-de Something has gone wrong while merging my PRs. All the builds on the
|
@kain88-de @richardjgowers This is the commit responsible for the error. Line 146 of |
I forgot to paste the link to the commit: d99abba |
We won't revert 1414 |
f8f28a0
to
d599baf
Compare
This should be ready too once the build completes. |
@utkbansal needs a rebase thanks to utils |
d599baf
to
7f9cd3d
Compare
Now how did |
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.
This reverts utils
@richardjgowers Got it back. |
@richardjgowers Looks good to go. The full build fails due to the time limit though. |
Fixes #
Changes made in this Pull Request:
pytest-xdist
to run in parallel on 2 coresPR Checklist