migrate changed integration tests to isolated temp git repos and add an environment variable to override buildroot

Review Request #4295 - Created Oct. 11, 2016 and submitted

Information
Yujie Chen
pants
3906, 3946
Reviewers
pants-reviews
kwlzn

Currently, the integration tests in tests/python/pants_test/engine/legacy/test_changed_integration.py rely on mutating the working copy for the purposes of examining real scm diff information to support the changed suite of goals. this means that if there are uncommitted changes, the git diff output will be altered which can subsequently cause the integration tests to fail.

This change does:
1. Each changed integration test creates an isolated git repo and runs inside it. Note: there are 4 tests that do not mutate working copy, thus they are exempted. The isolated git repo is a subdir of buildroot. The current logic will cause git to panic in this case. Thus I set buildroot to the same git dir as well.
2. Modify get_buildroot(). It will first look for an environment variable PANTS_BUILDROOT_OVERRIDE. If set, then its value will be the buildroot path. If not, the usual way of determining buildroot is used. This env var is purely for testing usage.
3. Shuffle targets in pants_test/base/BUILD to follow alphabetical order of target names.

https://travis-ci.org/pantsbuild/pants/builds/167397682

Issues

  • 0
  • 1
  • 2
  • 3
Description From Last Updated
Nick Howard (Twitter)
Kris Wilson
Yujie Chen
Nick Howard (Twitter)
Yujie Chen
Yujie Chen
Yujie Chen
Review request changed

Status: Closed (submitted)

Change Summary:

Merged as https://github.com/pantsbuild/pants/commit/8fe247971f0361570f7640bfdd732e512f1d3e77.
Thanks Nick and Kris!

Loading...