few-alarm-32433
08/15/2020, 1:01 AMchroot
. What is the canonical way to test the build tree itself? Or maybe there is a short-hand way to declare a dependency on pants + its build files?hundreds-father-404
08/15/2020, 3:41 AMPantsRunIntegrationTest
from the pantsbuild.pants.testutil
distribution. I’m still documenting it at https://www.pantsbuild.org/v2.0/docs/rules-api-testing, but tl;dr
1. add pants_requirement(dist='pantsbuild.pants.testutil')
in a BUILD file. This will automatically use your pants_version
. See https://www.pantsbuild.org/v2.0/docs/plugins-overview#building-in-repo-plugins-with-pants for a little more about that.
2. Add a new test that subclasses PantsRunIntegrationTest
. See https://github.com/pantsbuild/pants/blob/6f243d7d206c0d49e897a1f1eacd0186dd9b755b/src/python/pants/help/help_integration_test.py#L10-L17 for an example of running the help
goal.hundreds-father-404
08/15/2020, 3:42 AMPantsRunIntegrationTest
changes a little. For some versions, it would expect a file called pants.pex
to be present at your build root. More recently, that isn’t necessary)few-alarm-32433
08/17/2020, 2:20 PMfew-alarm-32433
08/17/2020, 2:21 PMhundreds-father-404
08/17/2020, 2:43 PM