export NO_REGEN_PEX=true iirc. See the pants scrip...
# general
h
export NO_REGEN_PEX=true iirc. See the pants script for the exact env var
r
Thanks! 😸
The
./v2
experience is amazing ❤️
❤️ 1
h
I’m glad you like it!! Use —test-debug for a more interactive experience and to be able to use debuggers (Current bug that you must pass —no-v2-ui to use the debuggers)
r
I had no idea I could use debuggers with tests :D
Oh wow this is cool
h
It gets even better. Add
import ipdb; ipdb.set_trace()
, then run with
--no-v2-ui --pytest-args='-s'
!
a
is there a reason we can't have this on by default outside of travis?
h
It’s technically not safe when running
PantsRunIntegrationTest
-style tests because those depend on
pants.pex
and that file will be out-of-date. Personally, we never run those tests anymore at Toolchain, though, because tests for V2 code don’t use PantsRunIntegrationTest. So, if Twitter / people working on V1 code like the JVM tests were fine with the risk of integration tests being stale from a stale
pants.pex
, I’d be fine with turning on
NO_REGEN_PEX
by default
Another approach is to try to get more intelligent with it. If
integration
is in the file name, only then regen the Pex. Although, this is not a safe heuristic. There are some tests that are
PantsRunIntegrationTests
but don’t have
integration
in the file name. There are also V2 tests with the name
_integration_test.py
that don’t use
PantsRunIntegrationTests
a
tests for V2 code don’t use PantsRunIntegrationTest
why is this?
like there are still some tests that require PantsRunIntegrationTest iirc
h
Because they can be much more self-contained and precise. Most V2 tests set up the rule graph with only the rules they need, so a Python test is independent of what changes are happening to JVM code. Whereas now, virtually any change to
src/python/pants
will invalidate the entire V1 integration test suite because
pants.pex
will have changed We do still have a couple
PantsRunIntegrationTests
that touch V2 code, such as testing
./pants --no-v1 --v2 goals
, but the majority of tests don’t use it
a
hm, ok, thanks!
❤️ 1