Fix scoped options initialization in test

Review Request #2850 - Created Sept. 20, 2015 and submitted

Information
Peiyu Wang
pants
peiyuwang:peiyu/fix-scoped-options-in-test
2225
1a56002...
Reviewers
pants-reviews
benjyw, jsirois, stuhood

This is to fix the task scoped options not being initialized for tests,
discovered from debugging https://rbcommons.com/s/twitter/r/2815/

TL;DR a new option was added to CacheSetup subsystem and subsequently passed to
CacheFactory contructor, previous options are also passed but not used so
failing to pass them in test hasn't caused us any trouble until now.

Two issues in context initialization for scoped options in test, one is
how it is used, the other is in fakes.create_options_for_optionables

  • for_task_types is needed so subsystem CacheSetup can be discovered and
    initialized.
  • For task scopes' with more than two enclosing scopes, like
    cache.goal1.task1, cache.py.check, not all enclosing scopes are present.
    In the cache.goal1.task1 case, the intermediate scope cache.goal1 is missing.
    This causes cache.goal1.task1 fail to initialize. Implemented a simplified
    version of Options.complete_scopes in fakes, so scopes initialization can
    happen in their enclosing order, i.e. cache, cache.goal1, cache.goal1.task1

https://travis-ci.org/pantsbuild/pants/builds/81191336

And with the fix https://rbcommons.com/s/twitter/r/2815/

now passed https://travis-ci.org/peiyuwang/pants/builds/81186394
previously failed https://travis-ci.org/pantsbuild/pants/builds/81072424

I am confused about the coverage drop " Coverage decreased (-1.7%) to 73.86%",
https://coveralls.io/builds/3618389 it's supposed not to change anything
about coverage.

Issues

  • 0
  • 4
  • 0
  • 4
Description From Last Updated
Benjy Weinberger
Peiyu Wang
Benjy Weinberger
Peiyu Wang
Review request changed

Status: Closed (submitted)

Change Summary:

Merged as 07f0235fced6823134839c81e52fcd0e735c9ab9

Loading...