https://pantsbuild.org/ logo
f

fast-nail-55400

11/25/2020, 7:25 PM
I’m trying to use
--no-process-execution-cleanup-local-dirs
and
-ldebug
in a pytest integration test of some rules in order to see what the output from a process run would be. I don’t see any log print-out though with the directory of where the process run would be. Any suggestions on what to configure to be able to see that?
h

hundreds-father-404

11/25/2020, 7:28 PM
The log should look like this:
[INFO] preserving local process execution dir
f

fast-nail-55400

11/25/2020, 7:31 PM
right, that is not bring printed out is the issue
Maybe because I’m getting
Error launching process: Os { code: 2, kind: NotFound, message: "No such file or directory" }
?
👍 1
I want to inspect the input root to see what is going on with it
h

hundreds-father-404

11/25/2020, 7:33 PM
Yeah I suspect that’s blocking things. What’s the missing file?
f

fast-nail-55400

11/25/2020, 7:36 PM
it’s not a missing file, it is not knowing the name of the unpacked goroot
or even that it got unpacked
h

hundreds-father-404

11/25/2020, 7:37 PM
what you can do is change the
argv
to run something like
/bin/true
instead. It’ll succeed and you can still see the chroot
f

fast-nail-55400

11/25/2020, 7:37 PM
👍
I assume I still need to configure pytest to not squelch output? I get an exception in the test now and only that exception is shown and no Pants logs
h

hundreds-father-404

11/25/2020, 7:43 PM
I need more context of what you’re doing to answer that. If you’re referring to
--test-output
, that only determines if Pants outputs Pytest’s std{out,err}, not whether we capture it in the first place
f

fast-nail-55400

11/25/2020, 8:00 PM
I’m running the integration test and want to see the logs from the pants run done by the integration test.
which would have the output of the temp directory for the process, correct?
h

hundreds-father-404

11/25/2020, 8:02 PM
Ah. Is the test throwing an exception now, or only the
PantsResult
returned by
run_pants()
has an exit code != 0?
which would have the output of the temp directory for the process
Yeah, it should, so long as you’re using
-ldebug
in the argv for
run_pants()