When a directory contains both a java_library and junit_test def, make sure the IDE understands this is a test pth, not a lib path

Review Request #996 - Created Sept. 5, 2014 and submitted

Information
Eric Ayers
pants
zundel/ide-prefer-test-path
551
82b8039...
Reviewers
pants-reviews
ity, jsirois

In our repo we have projects with BUILD files with 2 targets like:

java_libary(name='lib', ...)
junit_test(name='test', ...)

Sometimes, the ide_gen code saw the 'java_library' target first and considered that a regular source path, not a test source path, which causes tests to break in the IDE if they depend on libraries only defined in another test source path. In project.iml, we would see the path defined with is_test="False"

This is just a workaround, as ide_gen still might not always add test folders properly: If there is a java_library defined in a BUILD file under /src/test/java but no junit_test, ide_gen mistakenly thinks this is plain source path, not a test source path.

Re-ran goal idea on our test targets, the folders containing both tests and libraries that were previously 'blue' (regular source paths) are now green as they should be.

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

Status: Closed (submitted)

Change Summary:

commit 47f3d03a8c2f28b4b167ed5883639ec232971c28
Loading...