Run the pytest testsuite in parallel #1418
Conversation
@@ -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" |
kain88-de
Jun 21, 2017
Member
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.
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.
utkbansal
Jun 21, 2017
Author
Member
Sure. I'll just let this build complete and then push.
Sure. I'll just let this build complete and then push.
@kain88-de Should be ready to merge. No drop in coverage. |
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. |
- 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" |
kain88-de
Jun 22, 2017
Member
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.
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.
@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 |
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. |
- 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" |
kain88-de
Jun 24, 2017
Member
@utkbansal you should also be able to drop the pytest-cov
package as an explicit dependency. See astropy/ci-helpers#216
@utkbansal you should also be able to drop the pytest-cov
package as an explicit dependency. See astropy/ci-helpers#216
utkbansal
Jun 24, 2017
Author
Member
Cool.
Cool.
richardjgowers
Jun 25, 2017
Member
So here do we need to list pytest-cov
? And don't we need to list pytest
?
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 |
@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 |
This should be ready too once the build completes. |
@utkbansal needs a rebase thanks to utils |
Now how did |
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