assert_cmd icon indicating copy to clipboard operation
assert_cmd copied to clipboard

Allow customising number of lines shown before <n lines omitted>

Open gibfahn opened this issue 2 years ago • 10 comments

Often in CI I find the important details are lost behind:

```
<72 lines omitted>
```

this makes it hard to debug issues. It would be great to have an environment variable or similar to customise how much is printed.

gibfahn avatar Aug 14 '23 22:08 gibfahn

I've been hesitant to include env variables for controlling things, so far. Unsure if I'm more open to that or a feature flag.

epage avatar Aug 16 '23 16:08 epage

A feature flag that disables truncating would be great for me if that works for you.

gibfahn avatar Aug 31 '23 20:08 gibfahn

I'm also not a big fan of feature flags, so that was a bit of "which evil do I prefer?"

epage avatar Aug 31 '23 21:08 epage

Fair enough.

I keep hitting issues where truncated output hides the key details of what went wrong in CI, so I'm also weighing up using a git fork (not ideal) vs not using the crate, vs waiting for this to be an option.

I guess this could also be a set of options on the Command struct, so I could do something like:

let mut cmd = Command::cargo_bin("mycli")?;
cmd.truncate(false);
// ...

gibfahn avatar Sep 05 '23 00:09 gibfahn

An alternative would be an option to print the full stdout and stderr to a temp file somewhere, so when the output is small one could just see it inline, but when it is large one could go find it if needed.

gibfahn avatar Sep 25 '23 12:09 gibfahn

I guess this could also be a set of options on the Command struct, so I could do something like:

let mut cmd = Command::cargo_bin("mycli")?;
cmd.truncate(false);
// ...

to be able to configure in this way would be very convenient -- also encountered the need to see the full output

s373r avatar Aug 13 '24 10:08 s373r