https://pantsbuild.org/ logo
#general
Title
# general
c

calm-artist-46894

02/21/2020, 12:37 AM
Is there a way to printout the target name for each run when I do
./pants binary src/python::
(where I have multiple targets)? When one of them fails, not straightforward to know which one exactly
a

aloof-angle-91616

02/21/2020, 12:38 AM
hm, that's a really good idea and i'm not sure why we don't do that
oh. well.
-ldebug
will give some info. but that's not what you want -- you want this without a huge amount of debug text.
hm. first, what kind of failure? i'm thinking of doing a blanket try/catch around creating a binary and making sure to add the context in the exception message
c

calm-artist-46894

02/21/2020, 1:13 AM
Any build/test errors actually. We do things like:
Copy code
./pants filter --type=python_tests --output-file=$PYTHON_TEST_TARGET libraries::

./pants --positional-arg-file=$PYTHON_TEST_TARGET --tag=-py2 --tag=unittest test --test-pytest-coverage=auto
And when build fails, the first thing I need to do is to figure out which exact target failed and try to re-run/repro the issue with only that target
I wish I can install a custom task to
[setup]
or
[complete]
but they are not goals
Copy code
16:24:58 00:00 [main]                                                                                                                                                                                                                                                                     
               (To run a reporting server: ./pants server)                                                                                                                                                                                                                                
16:24:59 00:01   [setup]                                                                                                                                                                                                                                                                  
16:24:59 00:01     [parse]                                                                                                                                                                                                                                                                
               Executing tasks in goals: unpack-wheels -> deferred-sources -> native-compile -> gen -> link -> pyprep -> setup-py                                                                                                                                                         
16:24:59 00:01   [unpack-wheels]                                                                                                                                                                                                                                                          
16:24:59 00:01     [unpack-wheels]                                                                                                                                                                                                                                                        
16:24:59 00:01   [deferred-sources]                                                                                                                                                                                                                                                       
16:24:59 00:01     [deferred-sources]
16:24:59 00:01   [native-compile]
16:24:59 00:01     [conan-prep]
16:24:59 00:01     [conan-fetch]
16:24:59 00:01     [c-for-ctypes]
16:24:59 00:01     [cpp-for-ctypes]
16:24:59 00:01   [gen]
16:24:59 00:01     [grpcio-prep]
16:24:59 00:01     [grpcio-run]
16:24:59 00:01     [go-thrift]
16:24:59 00:01     [go-protobuf]
16:24:59 00:01   [link]
16:24:59 00:01     [shared-libraries]
16:24:59 00:01   [pyprep]
16:24:59 00:01     [interpreter]
16:24:59 00:01     [build-local-dists]
16:24:59 00:01     [requirements]
16:24:59 00:01     [sources]
16:24:59 00:01   [setup-py]
16:24:59 00:01     [setup-py]
16:24:59 00:01       [find-namespace-packages]
16:25:00 00:02   [complete]
a

aloof-angle-91616

02/21/2020, 1:40 AM
for pytest, one thing you may want to be aware of is
--pytest-args
. if you set
--pytest-args='-vs'
you will get a much more verbose output
👍 1
are you specifically concerned about failures in the pytest task, or
filter
as well?
3 Views