Improve test.pytest failure when coverage is enabled.
Review Request #3334 - Created Jan. 13, 2016 and submitted
|molsen, patricklaw, zundel|
- Avoid an unhandled
./pants test.pytestwhen coverage data files fail to be written due to failures, timeouts, etc.
- Additive test coverage.
CI is green @ https://travis-ci.org/pantsbuild/pants/builds/102231818
manual testing using the repro on #2800:
[illuminati pants (kwlzn/pytest_coverage)]$ ./pants clean-all test.pytest --test-pytest-coverage=1 --timeout-default=1 tests/python/pants_test/java:nailgun_integration INFO] Detected git repository at /Users/kwilson/dev/pants on branch kwlzn/pytest_coverage 15:40:12 00:00 [main] ... 15:40:14 00:02 [test] 15:40:14 00:02 [pytest] 15:40:14 00:02 [run] 15:40:14 00:02 [chroot]============== test session starts =============== platform darwin -- Python 2.7.10 -- py-1.4.30 -- pytest-2.6.4 plugins: timeout collecting 0 itemsWARN] No .coverage file was found! Skipping coverage reporting. collected 1 items tests/python/pants_test/java/test_nailgun_integration.py FAILURE: Timeout of 1 seconds reached 15:40:15 00:03 [complete] FAILURE
I see how this test might exercise the code, but I'm not sure if the failure might be noted any differently whether the shutil.move() problem occurs or not.
You could check for the string
No .coverage file was found! Skipping coverage reporting.'in the pants_run.stderr_data to confirm that this logic got activated.
Address Eric's feedback.
Revision 2 (+34 -24)