[engine] Make ScmProjectTree pickable and fix most GitFSTest tests

Review Request #3770 — Created April 27, 2016 and submitted

3189, 3286
kwlzn, patricklaw, stuhood, wisechengyi

Two things to make ScmProjectTree picklable:

  • _reader, GitRepositoryReader contains a Popen instance. This review marks it @memoized so it is saved by memoized.
  • _scm, Git contains a logger, this review moves the logger to the module.

Also added is to initialize Git FS for test, only two tests fail now, created https://github.com/pantsbuild/pants/issues/3281 to address separately.
(Assertion errors not pickle or exceptions)

https://travis-ci.org/peiyuwang/pants/builds/126266801 passed
https://travis-ci.org/peiyuwang/pants/builds/126289749 passed
https://travis-ci.org/peiyuwang/pants/builds/126550497 passed

  • 0
  • 0
  • 1
  • 0
  • 1
Description From Last Updated
  1. Thanks!

  2. This will skip the test for both PosixFSTest and GitFSTest... I think to skip it in just the subclass, you'd have to redefine the method in the subclass and call super(..).test_name and annotate it with skip.

    1. Good catch! done.


                           collected 22 items 
                           tests/python/pants_test/engine/exp/test_fs.py .s......s...s......s..
                           ===== 18 passed, 4 skipped in 11.15 seconds ======


                           collected 22 items 
                           tests/python/pants_test/engine/exp/test_fs.py ............s......s..
                           ===== 20 passed, 2 skipped in 10.37 seconds ======
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted as 265d140e037e533546721e7546ba90a23b4d63d8