https://pantsbuild.org/ logo
#development
Title
# development
h

happy-kitchen-89482

10/22/2019, 5:36 PM
and in fact I'm running tests in the toolchain repo, not even pants's own tests
cc @hundreds-father-404 ^
Re can we turn off the pants pex creation when running tests from source, unless actually running integration tests?
h

hundreds-father-404

10/23/2019, 12:54 AM
The best idea I have for this would be to keep the check in
./pants
for if the CLI args include
test.*
, then if this the case and the hash has changed for the source files, run
./pants --tag=integration list globs-originally-passed-to-pants-script
. If that returns with something, then regen the PEX. Otherwise, we know it’s just unit tests and can ignore Alternatively, introduce an env var like
NO_REGEN_PEX
to turn off the mechanism 🙂 -- The reason for all this complication is that we have this logic live at the bash script level. We considered having it instead live in
pants-plugins
or `src`—i.e. the logic of whether to call `./pants binary src/python/pants:local_binary && mv dist/pants.pex pants.pex`—but we decided this was too complicated. So, because this logic lives at the bash level, we can’t simply access information like `does this glob contain any targets with the tag
integration
?
h

happy-kitchen-89482

10/23/2019, 1:15 AM
I guess we can just set a NO_REGEN_PEX in our in-repo "pants_from_sources" script
That's a fine solution
this doesn't affect end users, just us when we're developing in our repo against pants sources
h

hundreds-father-404

10/23/2019, 1:16 AM
Currently, we check
CI=true
. As a temporary workaround, you can set that (not sure if that impacts anything else)
h

happy-kitchen-89482

10/23/2019, 1:19 AM
TRAVIS=true
it looks like
👍 1