Added cwd argument to allow JavaTest targets to require particular working directories.

Review Request #2440 - Created July 8, 2015 and submitted

Information
Garrett Malmquist
pants
gmalmquist/per-test-cwds
1772
7e2fb82...
Reviewers
pants-reviews
benjyw, jsirois, zundel

Square has tests that break if they don't run in specific directories, so the previous
strategy of picking the first target's spec_path as the cwd did not work for us in all
cases.

This allows the syntax:

junit_tests(name='tests',
  sources=globs('*.java'),
  dependencies=[...],
  cwd='my/cool/testing/working/directory',
)

junit_run.py now partitions tests by their working directory, before partitioning them by batch size.

Targets which don't have cwd set default to the working directory according to the original logic in junit_run.py (that is, they either use the path to the first Target, or whatever's set by --test-junit-cwd).

Added a test under testprojects/ to test cwd behavior.

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

Issues

  • 0
  • 1
  • 0
  • 1
Description From Last Updated
Eric Ayers
John Sirois
Garrett Malmquist
John Sirois
Garrett Malmquist
Review request changed

Status: Closed (submitted)

Change Summary:

In commit ea32fd2995f3fd1a4199c193313b6fd5da37fc43

Loading...