Fixup PythonTask chroot caching.

Review Request #2567 - Created Aug. 4, 2015 and submitted

Information
John Sirois
pants
jsirois/issues/1914_cached_chroot_fix
1914, 1916
91b5270...
Reviewers
pants-reviews
benjyw, kwlzn
Previously there were a few issues that could lead to over-invalidation,
but most importantly, there was an issue leading to under-invalidation.

Fixup chroot target fingerprinting to be transitive, previously just the
top-level targets were fingerprinted.  This fixes under-invalidation
based on changes to python chroot transitive target dependency edits.

Also fixup unstable portions of the fingerprint with a few TODOs added
to do these more cleanly.

Add a PythonTaskTest that exercises these cases as well as the unchanged
chroot case.

 src/python/pants/backend/python/tasks/python_run.py                                            |   2 +-
 src/python/pants/backend/python/tasks/python_task.py                                           |  33 ++++++++++-----
 tests/python/pants_test/backend/python/tasks/BUILD                                             |  24 +++++++----
 tests/python/pants_test/backend/python/tasks/{python_task_test.py => python_task_test_base.py} |  14 +++----
 tests/python/pants_test/backend/python/tasks/test_pytest_run.py                                |   4 +-
 tests/python/pants_test/backend/python/tasks/test_python_eval.py                               |   4 +-
 tests/python/pants_test/backend/python/tasks/test_python_repl.py                               |   4 +-
 tests/python/pants_test/backend/python/tasks/test_python_task.py                               | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/python/pants_test/backend/python/tasks/test_setup_py.py                                  |   4 +-
 9 files changed, 166 insertions(+), 34 deletions(-)
Manually tested pants from this branch against the repro case Paul set
up here: https://github.com/pgroudas/issues-1914
Without the fix his repro works - aka a revert fails to invalidate the
chroot cache.  With the fixed pants, reverts do force a new chroot to be
cached and used as expected.

CI went green here:
  https://travis-ci.org/pantsbuild/pants/builds/73984184
Benjy Weinberger
John Sirois
John Sirois
John Sirois
Review request changed

Status: Closed (submitted)

Loading...