Added test that shows that nested scope inherits properly from cmdline, config, and env

Review Request #1865 — Created March 4, 2015 and submitted

zundel
pants
zundel/test-options-middle-scoped
1201
8f365d4...
pants-reviews
benjyw, jsirois

Added test that shows that nested scope inherits properly from cmdline, config, and env.

I wrote this to test that https://rbcommons.com/s/twitter/r/1851/ did not break inheriting from a 'middle' scope, e.g. a config value set for 'compile' and 'DEFAULT' in compile.java -> compile -> DEFAULT still properly inherts from 'compile' when you request a value for 'compile.java'

It pleasantly surprised me that it didn't break those cases, but then I discovered that some other scenarios that didn't work the way I expected.

ZU
  1. 
      
  2. Maybe this is working as intended, but it surprised me that this returns 100.

    1. Its probably worth removing the xfails and inserting explanatory comments. I think its as simple as pointing out values are taken from:

      1. a short circuit scan for a value from the following sources in-order: flags, env, config, hardcoded defaults, where
      2. values for each source follow the . hierarchy scoping rule within that source (save for config which allows global setting of a non-global option).
  3. Also returns 100

  4. 
      
BE
  1. 
      
  2. 
      
JS
  1. Ship It!
  2. 
      
ZU
ZU
ZU
Review request changed

Status: Closed (submitted)

Change Summary:

Commit 7cf0417

Loading...