Stops unit tests in test_simple_codegen_task.py in master from failing.

Review Request #2469 - Created July 13, 2015 and submitted

Information
Garrett Malmquist
pants
gmalmquist/fix-simple-codegen-test-caching-failure
1804
31dbedd...
Reviewers
pants-reviews
benjyw, jsirois, zundel

test_execute() was failing because the artifact cached was turned on
for tests in 839b8f86d7d9429d395772594b9aacec09d5c86f. We really
don't want to be using the artifact cache for the synthetic targets
in these unit tests, because the whole point of these unit tests
is to make sure codegen works correctly -- reloading the results of
the previous codegen in the tests making sure codegen works defeats
the purpose.

test_execute() was failing because it expected codegen to run with
a particular set of invalidated targets, and it ran with no targets,
because none of the targets were invalidated (they were reloaded from
the cache).

To fix this, disable_artifact_cache() was called in setUp(), and
test_execute was split into two separate unit tests to test isolated
and global strategies in different test cases (to disentangle which
of them fail).

I also added an explicit check on the number of times execute_codegen
is called for each of these strategies, in addition to just counting
the number of targets they have. This ensures that the test for the
isolated strategy will still fail if none of the targets are
invalidated (rather than just nooping), which is what should be
expected.

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

CI went green again: https://travis-ci.org/pantsbuild/pants/builds/70811356

Garrett Malmquist
John Sirois
Garrett Malmquist
Garrett Malmquist
John Sirois
Garrett Malmquist
Review request changed

Status: Closed (submitted)

Change Summary:

In commit 6557734c862a24aced057feb621da05660ef95f2

Loading...