Normalize AddressMapper paths for parse/forget.

Review Request #2935 - Created Oct. 6, 2015 and submitted

Information
John Sirois
pants
jsirois/address_mapper/fix_osx
2326
bfac657...
Reviewers
pants-reviews
benjyw, nhoward_tw, zundel
Without proper normalization, errors were seen in OSX tests where the
build_root lay in the per-user tmp dir.

 src/python/pants/engine/exp/mapper.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

An example failure is over here:
https://travis-ci.org/pantsbuild-osx/pants/jobs/83902946

Looks like:

AddressMapperTest.test_invalidate_build_file_removed 

self = <pants_test.engine.exp.test_mapper.AddressMapperTest testMethod=test_invalidate_build_file_removed>

   def test_invalidate_build_file_removed(self):
     resolved = self.address_mapper.resolve(Address.parse('a/b'))
     a_b_target = Target(name='b',
                         dependencies=['//d:e'],
                         configurations=['//a', Configuration(embedded='yes')])
     self.assertEqual(a_b_target, resolved)

     build_file = os.path.join(self.build_root, 'a/b/b.BUILD.json')
     os.unlink(build_file)
     self.assertIs(resolved, self.address_mapper.resolve(Address.parse('a/b')))

     self.address_mapper.invalidate_build_file(build_file)
     with self.assertRaises(ResolveError):
>       self.address_mapper.resolve(Address.parse('a/b'))
E       AssertionError: ResolveError not raised

CI went green here:
https://travis-ci.org/pantsbuild/pants/builds/83971616

Eric Ayers
John Sirois
Eric Ayers
John Sirois
John Sirois
John Sirois
Review request changed

Status: Closed (submitted)

Loading...