is there a way to capture additional outputs from ...
# general
a
is there a way to capture additional outputs from
./pants test
? We want to keep the pytest-captured logging in failed tests.
--no-???-cleanup
or whatever sort of works, but seems heavy handed.
h
hm I'm surprised we don't have the
--output-file
option on
test
, which writes output to the file rather than std{out,err}. Is that what you mean?
combined with
--test-show-output=failing
(the default), it would still only show failed tests
a
I think the teams wishes is to capture per-test logging to a file (iirc pytest can do this) as there's a lot of logging.
b
IIRC, pytest's JUnit XML output may include logging etc. (or, at least, has options to via
junit_logging
), thus maybe enabling
[test] report = true
in pants and fiddling with the pytest settings gets some of the way? (https://www.pantsbuild.org/docs/reference-test#advanced-options)
h
Yeah, and some CI providers will structure the output for you, like CircleCI. Looks like in Toolchain's
pants.ci.toml
we set this
Copy code
[test]
report = true
a
hmmm i'll look into it. we are using junit reports
p
junit reports will also capture stdout/stderr from pytest runs.
a
cheers team. sounds like a sane approach. iirc we had an issue with something truncating our Junit report output. But thats not likely going to be a pants problem